| 64 | } |
| 65 | |
| 66 | int |
| 67 | PeriodicNewton::solveCurrentStep(void) |
| 68 | { |
| 69 | // set up some pointers and check they are valid |
| 70 | // NOTE this could be taken away if we set Ptrs as protecetd in superclass |
| 71 | AnalysisModel *theAnalysisModel = this->getAnalysisModelPtr(); |
| 72 | IncrementalIntegrator *theIncIntegratorr = this->getIncrementalIntegratorPtr(); |
| 73 | LinearSOE *theSOE = this->getLinearSOEptr(); |
| 74 | |
| 75 | if ((theAnalysisModel == 0) || (theIncIntegratorr == 0) || (theSOE == 0) |
| 76 | || (theTest == 0)){ |
| 77 | opserr << "WARNING PeriodicNewton::solveCurrentStep() - setLinks() has"; |
| 78 | opserr << " not been called - or no ConvergenceTest has been set\n"; |
| 79 | return -5; |
| 80 | } |
| 81 | |
| 82 | // we form the tangent |
| 83 | |
| 84 | if (theIncIntegratorr->formUnbalance() < 0) { |
| 85 | opserr << "WARNING PeriodicNewton::solveCurrentStep() -"; |
| 86 | opserr << "the Integrator failed in formUnbalance()\n"; |
| 87 | return -2; |
| 88 | } |
| 89 | |
| 90 | if (theIncIntegratorr->formTangent(tangent) < 0){ |
| 91 | opserr << "WARNING PeriodicNewton::solveCurrentStep() -"; |
| 92 | opserr << "the Integrator failed in formTangent()\n"; |
| 93 | return -1; |
| 94 | } |
| 95 | |
| 96 | // set itself as the ConvergenceTest objects EquiSolnAlgo |
| 97 | theTest->setEquiSolnAlgo(*this); |
| 98 | if (theTest->start() < 0) { |
| 99 | opserr << "PeriodicNewton::solveCurrentStep() -"; |
| 100 | opserr << "the ConvergenceTest object failed in start()\n"; |
| 101 | return -3; |
| 102 | } |
| 103 | |
| 104 | // repeat until convergence is obtained or reach max num iterations |
| 105 | int result = -1; |
| 106 | int count = 0; |
| 107 | int iter = 0; |
| 108 | do { |
| 109 | if (theSOE->solve() < 0) { |
| 110 | opserr << "WARNING PeriodicNewton::solveCurrentStep() -"; |
| 111 | opserr << "the LinearSysOfEqn failed in solve()\n"; |
| 112 | return -3; |
| 113 | } |
| 114 | |
| 115 | if (theIncIntegratorr->update(theSOE->getX()) < 0) { |
| 116 | opserr << "WARNING PeriodicNewton::solveCurrentStep() -"; |
| 117 | opserr << "the Integrator failed in update()\n"; |
| 118 | return -4; |
| 119 | } |
| 120 | |
| 121 | if (theIncIntegratorr->formUnbalance() < 0) { |
| 122 | opserr << "WARNING PeriodicNewton::solveCurrentStep() -"; |
| 123 | opserr << "the Integrator failed in formUnbalance()\n"; |
nothing calls this directly
no test coverage detected