| 108 | |
| 109 | |
| 110 | int |
| 111 | ModifiedNewton::solveCurrentStep(void) |
| 112 | { |
| 113 | // set up some pointers and check they are valid |
| 114 | // NOTE this could be taken away if we set Ptrs as protecetd in superclass |
| 115 | AnalysisModel *theAnalysisModel = this->getAnalysisModelPtr(); |
| 116 | IncrementalIntegrator *theIncIntegratorr = this->getIncrementalIntegratorPtr(); |
| 117 | LinearSOE *theSOE = this->getLinearSOEptr(); |
| 118 | |
| 119 | if ((theAnalysisModel == 0) || (theIncIntegratorr == 0) || (theSOE == 0) || (theTest == 0)){ |
| 120 | opserr << "WARNING ModifiedNewton::solveCurrentStep() - setLinks() has"; |
| 121 | opserr << " not been called - or no ConvergenceTest has been set\n"; |
| 122 | return -5; |
| 123 | } |
| 124 | |
| 125 | // we form the tangent |
| 126 | // Timer timer1; |
| 127 | // timer1.start(); |
| 128 | |
| 129 | if (theIncIntegratorr->formUnbalance() < 0) { |
| 130 | opserr << "WARNING ModifiedNewton::solveCurrentStep() -"; |
| 131 | opserr << "the Integrator failed in formUnbalance()\n"; |
| 132 | return -2; |
| 133 | } |
| 134 | |
| 135 | SOLUTION_ALGORITHM_tangentFlag = tangent; |
| 136 | if (factorOnce!=2) { |
| 137 | if (theIncIntegratorr->formTangent(tangent, iFactor, cFactor) < 0){ |
| 138 | opserr << "WARNING ModifiedNewton::solveCurrentStep() -"; |
| 139 | opserr << "the Integrator failed in formTangent()\n"; |
| 140 | return -1; |
| 141 | } |
| 142 | if (factorOnce==1) { |
| 143 | factorOnce =2; |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | // set itself as the ConvergenceTest objects EquiSolnAlgo |
| 148 | theTest->setEquiSolnAlgo(*this); |
| 149 | if (theTest->start() < 0) { |
| 150 | opserr << "ModifiedNewton::solveCurrentStep() -"; |
| 151 | opserr << "the ConvergenceTest object failed in start()\n"; |
| 152 | return -3; |
| 153 | } |
| 154 | |
| 155 | // repeat until convergence is obtained or reach max num iterations |
| 156 | int result = -1; |
| 157 | numIterations = 0; |
| 158 | do { |
| 159 | //Timer timer2; |
| 160 | //timer2.start(); |
| 161 | if (theSOE->solve() < 0) { |
| 162 | opserr << "WARNING ModifiedNewton::solveCurrentStep() -"; |
| 163 | opserr << "the LinearSysOfEqn failed in solve()\n"; |
| 164 | return -3; |
| 165 | } |
| 166 | //timer2.pause(); |
| 167 | //opserr << "TIMER::SOLVE()- " << timer2; |
nothing calls this directly
no test coverage detected