| 109 | |
| 110 | |
| 111 | int |
| 112 | NewtonHallM::solveCurrentStep(void) |
| 113 | { |
| 114 | // set up some pointers and check they are valid |
| 115 | // NOTE this could be taken away if we set Ptrs as protecetd in superclass |
| 116 | AnalysisModel *theAnaModel = this->getAnalysisModelPtr(); |
| 117 | IncrementalIntegrator *theIntegrator = this->getIncrementalIntegratorPtr(); |
| 118 | //IncrementalIntegrator *theIntegratorSens=this->getIncrementalIntegratorPtr();//Abbas |
| 119 | LinearSOE *theSOE = this->getLinearSOEptr(); |
| 120 | |
| 121 | if ((theAnaModel == 0) || (theIntegrator == 0) || (theSOE == 0) |
| 122 | || (theTest == 0)){ |
| 123 | opserr << "WARNING NewtonHallM::solveCurrentStep() - setLinks() has"; |
| 124 | opserr << " not been called - or no ConvergenceTest has been set\n"; |
| 125 | return -5; |
| 126 | } |
| 127 | |
| 128 | if (theIntegrator->formUnbalance() < 0) { |
| 129 | opserr << "WARNING NewtonHallM::solveCurrentStep() -"; |
| 130 | opserr << "the Integrator failed in formUnbalance()\n"; |
| 131 | return -2; |
| 132 | } |
| 133 | |
| 134 | // set itself as the ConvergenceTest objects EquiSolnAlgo |
| 135 | theTest->setEquiSolnAlgo(*this); |
| 136 | if (theTest->start() < 0) { |
| 137 | opserr << "NewtnRaphson::solveCurrentStep() -"; |
| 138 | opserr << "the ConvergenceTest object failed in start()\n"; |
| 139 | return -3; |
| 140 | } |
| 141 | |
| 142 | int result = -1; |
| 143 | numIterations = 0; |
| 144 | |
| 145 | do { |
| 146 | |
| 147 | int tangent = HALL_TANGENT; |
| 148 | SOLUTION_ALGORITHM_tangentFlag = tangent; |
| 149 | |
| 150 | double iFact, cFact; |
| 151 | if (method == 0) { |
| 152 | iFact = iFactor*exp(-alpha*numIterations); |
| 153 | cFact = 1.0 - iFact; |
| 154 | } else if (method ==1) { |
| 155 | double iFact0 = 1.0/(1. + exp(-alpha*c)); |
| 156 | iFact = 1/(1 + exp(alpha*(numIterations-c))); |
| 157 | iFact = iFactor*iFact/iFact0; |
| 158 | cFact = 1.0 - iFact; |
| 159 | } else { |
| 160 | iFact = iFactor; |
| 161 | cFact = cFactor; |
| 162 | } |
| 163 | |
| 164 | if (theIntegrator->formTangent(tangent, iFact, cFact) < 0){ |
| 165 | opserr << "WARNING NewtonHallM::solveCurrentStep() -"; |
| 166 | opserr << "the Integrator failed in formTangent()\n"; |
| 167 | return -1; |
| 168 | } |
nothing calls this directly
no test coverage detected