| 599 | |
| 600 | |
| 601 | int AlphaOSGeneralized_TP::formElementResidual(void) |
| 602 | { |
| 603 | // calculate Residual Force |
| 604 | AnalysisModel *theModel = this->getAnalysisModel(); |
| 605 | LinearSOE *theSOE = this->getLinearSOE(); |
| 606 | |
| 607 | // loop through the FE_Elements and add the residual |
| 608 | FE_Element *elePtr; |
| 609 | FE_EleIter &theEles = theModel->getFEs(); |
| 610 | while((elePtr = theEles()) != 0) { |
| 611 | if (theSOE->addB(elePtr->getResidual(this),elePtr->getID()) < 0) { |
| 612 | opserr << "WARNING AlphaOSGeneralized_TP::formElementResidual() -"; |
| 613 | opserr << " failed in addB for ID " << elePtr->getID(); |
| 614 | return -1; |
| 615 | } |
| 616 | if (alphaKU > 0.0) { |
| 617 | if (statusFlag == CURRENT_TANGENT) { |
| 618 | if (theSOE->addB(elePtr->getK_Force(*Ut-*Upt), elePtr->getID(), -alphaKU) < 0) { |
| 619 | opserr << "WARNING AlphaOSGeneralized_TP::formElementResidual() -"; |
| 620 | opserr << " failed in addB for ID " << elePtr->getID(); |
| 621 | return -2; |
| 622 | } |
| 623 | } else if (statusFlag == INITIAL_TANGENT) { |
| 624 | if (theSOE->addB(elePtr->getKi_Force(*Ut-*Upt), elePtr->getID(), -alphaKU) < 0) { |
| 625 | opserr << "WARNING AlphaOSGeneralized_TP::formElementResidual() -"; |
| 626 | opserr << " failed in addB for ID " << elePtr->getID(); |
| 627 | return -2; |
| 628 | } |
| 629 | } |
| 630 | } |
| 631 | } |
| 632 | |
| 633 | return 0; |
| 634 | } |
no test coverage detected