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

Method addResistingForceToNodalReaction

SRC/element/Element.cpp:637–680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

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