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

Method update

SRC/analysis/integrator/ArcLength.cpp:225–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225int
226ArcLength::update(const Vector &dU)
227{
228 /// opserr<<" update: start"<<endln;
229
230 AnalysisModel *theModel = this->getAnalysisModel();
231 LinearSOE *theLinSOE = this->getLinearSOE();
232 if (theModel == 0 || theLinSOE == 0) {
233 opserr << "WARNING ArcLength::update() ";
234 opserr << "No AnalysisModel or LinearSOE has been set\n";
235 return -1;
236 }
237
238 (*deltaUbar) = dU; // have to do this as the SOE is gonna change
239//opserr<<"deltaUbar= "<<*deltaUbar<<endln;
240
241//opserr<<"Update: phat is = "<<*phat<<"////////////////////////////"<<endln;
242 // determine dUhat
243 theLinSOE->setB(*phat);
244 theLinSOE->solve();
245
246 (*deltaUhat) = theLinSOE->getX();
247
248 // determine the coeeficients of our quadratic equation
249 a = alpha2 + ((*deltaUhat)^(*deltaUhat));
250 b = alpha2*deltaLambdaStep
251 + ((*deltaUhat)^(*deltaUbar))
252 + ((*deltaUstep)^(*deltaUhat));
253 b *= 2.0;
254 c = 2*((*deltaUstep)^(*deltaUbar)) + ((*deltaUbar)^(*deltaUbar));
255 // check for a solution to quadratic
256 b24ac = b*b - 4.0*a*c;
257 if (b24ac < 0) {
258 opserr << "ArcLength::update() - imaginary roots due to multiple instability";
259 opserr << " directions - initial load increment was too large\n";
260 opserr << "a: " << a << " b: " << b << " c: " << c << " b24ac: " << b24ac << endln;
261 return -1;
262 }
263 double a2 = 2.0*a;
264 if (a2 == 0.0) {
265 opserr << "ArcLength::update() - zero denominator";
266 opserr << " alpha was set to 0.0 and zero reference load\n";
267 return -2;
268 }
269
270 // determine the roots of the quadratic
271 double sqrtb24ac = sqrt(b24ac);
272 double dlambda1 = (-b + sqrtb24ac)/a2;
273 double dlambda2 = (-b - sqrtb24ac)/a2;
274//opserr<<"squareRoot of b24ac= "<<sqrtb24ac<<endln;
275 double val = (*deltaUhat)^(*deltaUstep);
276 double theta1 = ((*deltaUstep)^(*deltaUstep)) + ((*deltaUbar)^(*deltaUstep));
277 // double theta2 = theta1 + dlambda2*val;
278 theta1 += dlambda1*val;
279
280 // choose dLambda based on angle between incremental displacement before
281 // and after this step -- want positive
282 double dLambda;

Callers

nothing calls this directly

Calls 10

getAnalysisModelMethod · 0.45
getLinearSOEMethod · 0.45
setBMethod · 0.45
solveMethod · 0.45
getXMethod · 0.45
addVectorMethod · 0.45
incrDispMethod · 0.45
applyLoadDomainMethod · 0.45
updateDomainMethod · 0.45
setXMethod · 0.45

Tested by

no test coverage detected