| 89 | // Performs the linear solution algorithm. |
| 90 | |
| 91 | int |
| 92 | Linear::solveCurrentStep(void) |
| 93 | { |
| 94 | // set up some pointers and check they are valid |
| 95 | // NOTE this could be taken away if we set Ptrs as protecetd in superclass |
| 96 | |
| 97 | AnalysisModel *theAnalysisModel = this->getAnalysisModelPtr(); |
| 98 | LinearSOE *theSOE = this->getLinearSOEptr(); |
| 99 | IncrementalIntegrator *theIncIntegrator = |
| 100 | this->getIncrementalIntegratorPtr(); |
| 101 | |
| 102 | if ((theAnalysisModel == 0) || (theIncIntegrator ==0 ) || (theSOE == 0)){ |
| 103 | opserr << "WARNING Linear::solveCurrentStep() -"; |
| 104 | opserr << "setLinks() has not been called.\n"; |
| 105 | return -5; |
| 106 | } |
| 107 | |
| 108 | if (factorOnce != 2) { |
| 109 | if (theIncIntegrator->formTangent(incrTangent) < 0) { |
| 110 | opserr << "WARNING Linear::solveCurrentStep() -"; |
| 111 | opserr << "the Integrator failed in formTangent()\n"; |
| 112 | return -1; |
| 113 | } |
| 114 | if (factorOnce == 1) |
| 115 | factorOnce = 2; |
| 116 | } |
| 117 | |
| 118 | |
| 119 | if (theIncIntegrator->formUnbalance() < 0) { |
| 120 | opserr << "WARNING Linear::solveCurrentStep() -"; |
| 121 | opserr << "the Integrator failed in formUnbalance()\n"; |
| 122 | return -2; |
| 123 | } |
| 124 | |
| 125 | if (theSOE->solve() < 0) { |
| 126 | opserr << "WARNING Linear::solveCurrentStep() -"; |
| 127 | opserr << "the LinearSOE failed in solve()\n"; |
| 128 | return -3; |
| 129 | } |
| 130 | |
| 131 | const Vector &deltaU = theSOE->getX(); |
| 132 | |
| 133 | if (theIncIntegrator->update(deltaU) < 0) { |
| 134 | opserr << "WARNING Linear::solveCurrentStep() -"; |
| 135 | opserr << "the Integrator failed in update()\n"; |
| 136 | return -4; |
| 137 | } |
| 138 | |
| 139 | return 0; |
| 140 | } |
| 141 | |
| 142 | int |
| 143 | Linear::setConvergenceTest(ConvergenceTest *theNewTest) |
nothing calls this directly
no test coverage detected