analyze a transient step
| 475 | |
| 476 | // analyze a transient step |
| 477 | int |
| 478 | BasicAnalysisBuilder::analyzeStep(double dT) |
| 479 | { |
| 480 | int result = 0; |
| 481 | if (theAnalysisModel->analysisStep(dT) < 0) { |
| 482 | opserr << "DirectIntegrationAnalysis::analyze() - the AnalysisModel failed"; |
| 483 | opserr << " at time " << theDomain->getCurrentTime() << "\n"; |
| 484 | theDomain->revertToLastCommit(); |
| 485 | return -2; |
| 486 | } |
| 487 | |
| 488 | // check if domain has undergone change |
| 489 | int stamp = theDomain->hasDomainChanged(); |
| 490 | if (stamp != domainStamp) { |
| 491 | domainStamp = stamp; |
| 492 | if (this->domainChanged() < 0) { |
| 493 | opserr << "DirectIntegrationAnalysis::analyze() - domainChanged() failed\n"; |
| 494 | return -1; |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | if (theTransientIntegrator->newStep(dT) < 0) { |
| 499 | opserr << "DirectIntegrationAnalysis::analyze() - the Integrator failed"; |
| 500 | opserr << " at time " << theDomain->getCurrentTime() << "\n"; |
| 501 | theDomain->revertToLastCommit(); |
| 502 | theTransientIntegrator->revertToLastStep(); |
| 503 | return -2; |
| 504 | } |
| 505 | |
| 506 | result = theAlgorithm->solveCurrentStep(); |
| 507 | if (result < 0) { |
| 508 | if (AnalyzeFailedMessage.find(result) != AnalyzeFailedMessage.end()) { |
| 509 | opserr << OpenSees::PromptAnalysisFailure << AnalyzeFailedMessage[result]; |
| 510 | } |
| 511 | theDomain->revertToLastCommit(); |
| 512 | theTransientIntegrator->revertToLastStep(); |
| 513 | return -3; |
| 514 | } |
| 515 | |
| 516 | if (theTransientIntegrator->shouldComputeAtEachStep()) { |
| 517 | result = theTransientIntegrator->computeSensitivities(); |
| 518 | if (result < 0) { |
| 519 | opserr << "TransientAnalysis::analyze() - the SensitivityAlgorithm failed"; |
| 520 | opserr << " at time " << theDomain->getCurrentTime() << "\n"; |
| 521 | theDomain->revertToLastCommit(); |
| 522 | theTransientIntegrator->revertToLastStep(); |
| 523 | return -5; |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | result = theTransientIntegrator->commit(); |
| 528 | if (result < 0) { |
| 529 | opserr << "DirectIntegrationAnalysis::analyze() - "; |
| 530 | opserr << "the Integrator failed to commit"; |
| 531 | opserr << " at time " << theDomain->getCurrentTime() << "\n"; |
| 532 | theDomain->revertToLastCommit(); |
| 533 | theTransientIntegrator->revertToLastStep(); |
| 534 | return -4; |
no test coverage detected