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

Method solveCurrentStep

SRC/analysis/algorithm/equiSolnAlgo/BFGS.cpp:212–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210
211
212int
213BFGS::solveCurrentStep(void)
214{
215
216 // set up some pointers and check they are valid
217 // NOTE this could be taken away if we set Ptrs as protecetd in superclass
218
219 AnalysisModel *theAnaModel = this->getAnalysisModelPtr();
220
221 IncrementalIntegrator *theIntegrator = this->getIncrementalIntegratorPtr();
222
223 LinearSOE *theSOE = this->getLinearSOEptr();
224
225 if ((theAnaModel == 0) || (theIntegrator == 0) || (theSOE == 0)
226 || (theTest == 0)){
227 opserr << "WARNING BFGS::solveCurrentStep() - setLinks() has";
228 opserr << " not been called - or no ConvergenceTest has been set\n";
229 return -5;
230 }
231
232 // set itself as the ConvergenceTest objects EquiSolnAlgo
233 theTest->setEquiSolnAlgo(*this);
234 if (theTest->start() < 0) {
235 opserr << "BFGS::solveCurrentStep() -";
236 opserr << "the ConvergenceTest object failed in start()\n";
237 return -3;
238 }
239
240 localTest->setEquiSolnAlgo(*this);
241
242 if (rdotz == 0)
243 rdotz = new double[numberLoops+3];
244
245 if (sdotr == 0)
246 sdotr = new double[numberLoops+3];
247
248
249 int result = -1;
250 int count = 0;
251 do {
252
253 // opserr << " BFGS -- Forming New Tangent" << endln;
254
255 //form the initial tangent
256 if (theIntegrator->formTangent(tangent) < 0){
257 opserr << "WARNING BFGS::solveCurrentStep() -";
258 opserr << "the Integrator failed in formTangent()\n";
259 return -1;
260 }
261
262 //form the initial residual
263 if (theIntegrator->formUnbalance() < 0) {
264 opserr << "WARNING BFGS::solveCurrentStep() -";
265 opserr << "the Integrator failed in formUnbalance()\n";
266 }
267
268 //solve
269 if (theSOE->solve() < 0) {

Callers 10

analyzeMethod · 0.45
analyzeMethod · 0.45
analyzeMethod · 0.45
analyzeMethod · 0.45
analyzeStepMethod · 0.45
analyzeMethod · 0.45
analyzeStaticMethod · 0.45
analyzeStepMethod · 0.45
analyzeVariableMethod · 0.45

Calls 14

getLinearSOEptrMethod · 0.80
getBMethod · 0.80
getAnalysisModelPtrMethod · 0.45
setEquiSolnAlgoMethod · 0.45
startMethod · 0.45
formTangentMethod · 0.45
formUnbalanceMethod · 0.45
solveMethod · 0.45
updateMethod · 0.45
getXMethod · 0.45
getNumEqnMethod · 0.45

Tested by

no test coverage detected