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

Method update

SRC/analysis/integrator/ExplicitDifferenceStatic.cpp:386–436  ·  view source on GitHub ↗

Update the response quantities

Source from the content-addressed store, hash-verified

384
385// Update the response quantities
386int ExplicitDifferenceStatic::update(const Vector &Udotdot)
387{
388 updateCount++;
389 if (updateCount > 2) {
390 opserr << "WARNING ExplicitDifferenceStatic::update() - called more than once -";
391 opserr << " ExplicitDifferenceStatic integration scheme requires a LINEAR solution algorithm\n";
392 return -1;
393 }
394
395 AnalysisModel *theModel = this->getAnalysisModel();
396 if (theModel == 0) {
397 opserr << "WARNING ExplicitDifferenceStatic::update() - no AnalysisModel set\n";
398 return -2;
399 }
400
401 if (Ut == 0) {
402 opserr << "WARNING ExplicitDifferenceStatic::update() - domainChange() failed or not called\n";
403 return -3;
404 }
405
406 if (Udotdot.Size() != Utdotdot->Size()) {
407 opserr << "WARNING ExplicitDifferenceStatic::update() - Vectors of incompatible size ";
408 opserr << " expecting " << Utdotdot->Size() << " obtained " << Udotdot.Size() << endln;
409 return -4;
410 }
411
412 // Update acceleration: weighted average for stability
413 // a_{t+dt} = (3*a_new + a_old) / 4
414 double halfT = deltaT * 0.125;
415
416 Utdotdot1->addVector(0.0, Udotdot, 3.0);
417 Utdotdot1->addVector(1.0, *Utdotdot, 1.0);
418
419 // Update velocity for output (v at t+dt from leap-frog v at t+0.5*dt)
420 Utdot1->addVector(0.0, *Utdot, 1.0);
421 Utdot1->addVector(1.0, *Utdotdot1, halfT);
422
423 // Set response in model
424 theModel->setResponse(*Ut, *Utdot1, Udotdot);
425
426 if (theModel->updateDomain() < 0) {
427 opserr << "ExplicitDifferenceStatic::update() - failed to update the domain\n";
428 return -5;
429 }
430
431 // Store acceleration for next step
432 (*Utdotdot) = Udotdot;
433 (*Utdotdot1) = Udotdot;
434
435 return 0;
436}
437
438// Commit the state
439int ExplicitDifferenceStatic::commit(void)

Callers

nothing calls this directly

Calls 5

getAnalysisModelMethod · 0.45
SizeMethod · 0.45
addVectorMethod · 0.45
setResponseMethod · 0.45
updateDomainMethod · 0.45

Tested by

no test coverage detected