MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / addResistingForceToNodalReaction

Method addResistingForceToNodalReaction

DEVELOPER/core/Element.cpp:629–672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

627
628
629int
630Element::addResistingForceToNodalReaction(int flag)
631{
632 int result = 0;
633 int numNodes = this->getNumExternalNodes();
634 Node **theNodes = this->getNodePtrs();
635
636 static Vector theVector(48);
637
638 //
639 // now determine the resisting force
640 //
641
642 const Vector *theResistingForce =0;
643 if (flag == 0)
644 theResistingForce = &(this->getResistingForce());
645 else if (flag == 1) {
646 theResistingForce = &(this->getResistingForceIncInertia());
647 }
648 else if (flag == 2)
649 theResistingForce = &(this->getRayleighDampingForces());
650
651
652 //
653 // iterate over the elements nodes; determine nodes contribution & add it
654 //
655
656 int nodalDOFCount = 0;
657
658 for (int i=0; i<numNodes; i++) {
659 Node *theNode = theNodes[i];
660
661 int numNodalDOF = theNode->getNumberDOF();
662 theVector.resize(numNodalDOF);
663
664 for (int j=0; j<numNodalDOF; j++) {
665 (theVector)(j) = (*theResistingForce)(nodalDOFCount);
666 nodalDOFCount++;
667 }
668 result +=theNode->addReactionForce(theVector, 1.0);
669 }
670
671 return result;
672}
673
674double Element::getCharacteristicLength(void)
675{

Callers 1

Calls 6

getResistingForceMethod · 0.80
getNumExternalNodesMethod · 0.45
getNodePtrsMethod · 0.45
getNumberDOFMethod · 0.45
resizeMethod · 0.45
addReactionForceMethod · 0.45

Tested by

no test coverage detected