| 627 | |
| 628 | |
| 629 | int |
| 630 | Element::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 | |
| 674 | double Element::getCharacteristicLength(void) |
| 675 | { |
no test coverage detected