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

Method solveCurrentStep

SRC/analysis/algorithm/equiSolnAlgo/KrylovNewton.cpp:94–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94int
95KrylovNewton::solveCurrentStep(void)
96{
97 // set up some pointers and check they are valid
98 // NOTE this could be taken away if we set Ptrs as protecetd in superclass
99 AnalysisModel *theAnaModel = this->getAnalysisModelPtr();
100 IncrementalIntegrator *theIntegrator = this->getIncrementalIntegratorPtr();
101 LinearSOE *theSOE = this->getLinearSOEptr();
102
103 if ((theAnaModel == 0) || (theIntegrator == 0) || (theSOE == 0)
104 || (theTest == 0)){
105 opserr << "WARNING KrylovNewton::solveCurrentStep() - setLinks() has";
106 opserr << " not been called - or no ConvergenceTest has been set\n";
107 return -5;
108 }
109
110 // Get size information from SOE
111 numEqns = theSOE->getNumEqn();
112 if (maxDimension > numEqns)
113 maxDimension = numEqns;
114
115 if (v == 0) {
116 // Need to allocate an extra vector for "next" update
117 v = new Vector*[maxDimension+1];
118 for (int i = 0; i < maxDimension+1; i++)
119 v[i] = new Vector(numEqns);
120 }
121
122 if (Av == 0) {
123 Av = new Vector*[maxDimension+1];
124 for (int i = 0; i < maxDimension+1; i++)
125 Av[i] = new Vector(numEqns);
126 }
127
128 if (AvData == 0)
129 AvData = new double [maxDimension*numEqns];
130
131 if (rData == 0)
132 // The LAPACK least squares subroutine overwrites the RHS vector
133 // with the solution vector ... these vectors are not the same
134 // size, so we need to use the max size
135 rData = new double [(numEqns > maxDimension) ? numEqns : maxDimension];
136
137 // Length of work vector should be >= 2*min(numEqns,maxDimension)
138 // See dgels subroutine documentation
139 lwork = 2 * ((numEqns < maxDimension) ? numEqns : maxDimension);
140
141 if (work == 0)
142 work = new double [lwork];
143
144 // Evaluate system residual R(y_0)
145 if (theIntegrator->formUnbalance() < 0) {
146 opserr << "WARNING KrylovNewton::solveCurrentStep() -";
147 opserr << "the Integrator failed in formUnbalance()\n";
148 return -2;
149 }
150
151

Callers

nothing calls this directly

Calls 13

leastSquaresMethod · 0.95
getLinearSOEptrMethod · 0.80
getAnalysisModelPtrMethod · 0.45
getNumEqnMethod · 0.45
formUnbalanceMethod · 0.45
setEquiSolnAlgoMethod · 0.45
startMethod · 0.45
formTangentMethod · 0.45
solveMethod · 0.45
updateMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected