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

Function determineDt

SRC/runtime/runtime/BasicAnalysisBuilder.cpp:541–568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539
540
541static double
542determineDt(double dT,
543 double dtMin,
544 double dtMax,
545 int Jd,
546 ConvergenceTest *theTest)
547{
548 double newDt = dT;
549
550 // get the number of trial steps in the last solveCurrentStep()
551 double numLastIter = 1.0;
552 if (theTest != 0)
553 numLastIter = theTest->getNumTests();
554
555
556 // determine new dT based on last dT and Jd and #iter of last step
557 double factor = Jd/numLastIter;
558 newDt *= factor;
559
560 // ensure: dtMin <~~ dT <= dtMax
561 if (newDt < dtMin)
562 newDt = dtMin - DBL_EPSILON; // to ensure we get out of the analysis
563 // loop if can't converge on next step
564 else if (newDt > dtMax)
565 newDt = dtMax;
566
567 return newDt;
568}
569
570
571int

Callers 1

analyzeVariableMethod · 0.85

Calls 1

getNumTestsMethod · 0.45

Tested by

no test coverage detected