MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / solveCurrentStep

Method solveCurrentStep

SRC/analysis/algorithm/equiSolnAlgo/NewtonHallM.cpp:111–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109
110
111int
112NewtonHallM::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 }

Callers

nothing calls this directly

Calls 12

getLinearSOEptrMethod · 0.80
getAnalysisModelPtrMethod · 0.45
formUnbalanceMethod · 0.45
setEquiSolnAlgoMethod · 0.45
startMethod · 0.45
formTangentMethod · 0.45
solveMethod · 0.45
updateMethod · 0.45
getXMethod · 0.45
testMethod · 0.45
recordMethod · 0.45

Tested by

no test coverage detected