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

Method update

SRC/analysis/integrator/CollocationHSFixedNumIter.cpp:398–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396
397
398int CollocationHSFixedNumIter::update(const Vector &deltaU)
399{
400 AnalysisModel *theModel = this->getAnalysisModel();
401 if (theModel == 0) {
402 opserr << "WARNING CollocationHSFixedNumIter::update() - no AnalysisModel set\n";
403 return -1;
404 }
405 ConvergenceTest *theTest = this->getConvergenceTest();
406 if (theTest == 0) {
407 opserr << "WARNING CollocationHSFixedNumIter::update() - no ConvergenceTest set\n";
408 return -2;
409 }
410
411 // check domainChanged() has been called, i.e. Ut will not be zero
412 if (Ut == 0) {
413 opserr << "WARNING CollocationHSFixedNumIter::update() - domainChange() failed or not called\n";
414 return -3;
415 }
416
417 // check deltaU is of correct size
418 if (deltaU.Size() != U->Size()) {
419 opserr << "WARNING CollocationHSFixedNumIter::update() - Vectors of incompatible size ";
420 opserr << " expecting " << U->Size() << " obtained " << deltaU.Size() << endln;
421 return -4;
422 }
423
424 // get interpolation location and scale displacement increment
425 x = (double) theTest->getNumTests()/theTest->getMaxNumTests();
426 if (polyOrder == 1) {
427 (*scaledDeltaU) = x*((*U)+deltaU) - (x-1.0)*(*Ut) - (*U);
428 }
429 else if (polyOrder == 2) {
430 (*scaledDeltaU) = x*(x+1.0)/2.0*((*U)+deltaU) - (x-1.0)*(x+1.0)*(*Ut)
431 + (x-1.0)*x/2.0*(*Utm1) - (*U);
432 }
433 else if (polyOrder == 3) {
434 (*scaledDeltaU) = x*(x+1.0)*(x+2.0)/6.0*((*U)+deltaU) - (x-1.0)*(x+1.0)*(x+2.0)/2.0*(*Ut)
435 + (x-1.0)*x*(x+2.0)/2.0*(*Utm1) - (x-1.0)*x*(x+1.0)/6.0*(*Utm2) - (*U);
436 }
437 else {
438 opserr << "WARNING CollocationHSFixedNumIter::update() - polyOrder > 3 not supported\n";
439 return -5;
440 }
441
442 // determine the response at t+theta*deltaT
443 U->addVector(1.0, *scaledDeltaU, c1);
444
445 Udot->addVector(1.0, *scaledDeltaU, c2);
446
447 Udotdot->addVector(1.0, *scaledDeltaU, c3);
448
449 // update the response at the DOFs
450 theModel->setResponse(*U, *Udot, *Udotdot);
451 if (theModel->updateDomain() < 0) {
452 opserr << "CollocationHSFixedNumIter::update() - failed to update the domain\n";
453 return -5;
454 }
455

Callers

nothing calls this directly

Calls 8

getAnalysisModelMethod · 0.45
getConvergenceTestMethod · 0.45
SizeMethod · 0.45
getNumTestsMethod · 0.45
getMaxNumTestsMethod · 0.45
addVectorMethod · 0.45
setResponseMethod · 0.45
updateDomainMethod · 0.45

Tested by

no test coverage detected