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

Method analyzeVariable

SRC/runtime/runtime/BasicAnalysisBuilder.cpp:571–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569
570
571int
572BasicAnalysisBuilder::analyzeVariable(int numSteps, double dT, double dtMin, double dtMax, int Jd)
573{
574
575 // set some variables
576 int result = 0;
577 double totalTimeIncr = numSteps * dT;
578 double currentTimeIncr = 0.0;
579 double currentDt = dT;
580
581 // loop until analysis has performed the total time incr requested
582 while (currentTimeIncr < totalTimeIncr) {
583
584 if (theAnalysisModel->analysisStep(currentDt) < 0) {
585 opserr << "DirectIntegrationAnalysis::analyze() - the AnalysisModel failed in newStepDomain";
586 opserr << " at time " << theDomain->getCurrentTime() << "\n";
587 theDomain->revertToLastCommit();
588 return -2;
589 }
590
591 // check if domain has undergone change
592 int stamp = theDomain->hasDomainChanged();
593 if (stamp != domainStamp) {
594 domainStamp = stamp;
595 if (this->domainChanged() < 0) {
596 opserr << "DirectIntegrationAnalysis::analyze() - domainChanged() failed\n";
597 return -1;
598 }
599 }
600
601 //
602 // do newStep(), solveCurrentStep() and commit() as in regular
603 // DirectINtegrationAnalysis - difference is we do not return
604 // if a failure - we stop the analysis & resize time step if failure
605 //
606
607 if (theTransientIntegrator->newStep(currentDt) < 0) {
608 result = -2;
609 }
610
611
612 if (result >= 0) {
613 result = theAlgorithm->solveCurrentStep();
614 if (result < 0)
615 result = -3;
616 }
617
618 if (result >= 0) {
619 result = theTransientIntegrator->commit();
620 if (result < 0)
621 result = -4;
622 }
623
624 // if the time step was successful increment delta T for the analysis
625 // otherwise revert the Domain to last committed state & see if can go on
626
627 if (result >= 0)
628 currentTimeIncr += currentDt;

Callers 1

analyzeModelFunction · 0.80

Calls 10

domainChangedMethod · 0.95
determineDtFunction · 0.85
analysisStepMethod · 0.45
getCurrentTimeMethod · 0.45
revertToLastCommitMethod · 0.45
hasDomainChangedMethod · 0.45
newStepMethod · 0.45
solveCurrentStepMethod · 0.45
commitMethod · 0.45
revertToLastStepMethod · 0.45

Tested by

no test coverage detected