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