| 518 | |
| 519 | |
| 520 | int AlphaOS::formElementResidual(void) |
| 521 | { |
| 522 | // calculate Residual Force |
| 523 | AnalysisModel *theModel = this->getAnalysisModel(); |
| 524 | LinearSOE *theSOE = this->getLinearSOE(); |
| 525 | |
| 526 | // loop through the FE_Elements and add the residual |
| 527 | FE_Element *elePtr; |
| 528 | FE_EleIter &theEles = theModel->getFEs(); |
| 529 | while((elePtr = theEles()) != 0) { |
| 530 | if (theSOE->addB(elePtr->getResidual(this), elePtr->getID()) < 0) { |
| 531 | opserr << "WARNING AlphaOS::formElementResidual() -"; |
| 532 | opserr << " failed in addB for ID " << elePtr->getID(); |
| 533 | return -1; |
| 534 | } |
| 535 | if (alpha < 1.0) { |
| 536 | if (statusFlag == CURRENT_TANGENT) { |
| 537 | if (theSOE->addB(elePtr->getK_Force(*Ut-*Upt), elePtr->getID(), alpha-1.0) < 0) { |
| 538 | opserr << "WARNING AlphaOS::formElementResidual() -"; |
| 539 | opserr << " failed in addB for ID " << elePtr->getID(); |
| 540 | return -2; |
| 541 | } |
| 542 | } else if (statusFlag == INITIAL_TANGENT) { |
| 543 | if (theSOE->addB(elePtr->getKi_Force(*Ut-*Upt), elePtr->getID(), alpha-1.0) < 0) { |
| 544 | opserr << "WARNING AlphaOS::formElementResidual() -"; |
| 545 | opserr << " failed in addB for ID " << elePtr->getID(); |
| 546 | return -2; |
| 547 | } |
| 548 | } |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | return 0; |
| 553 | } |
no test coverage detected