| 345 | } |
| 346 | |
| 347 | int |
| 348 | BasicAnalysisBuilder::analyzeStatic(int numSteps, int flag) |
| 349 | { |
| 350 | int result = 0; |
| 351 | |
| 352 | for (int i=0; i<numSteps; i++) { |
| 353 | // This is used for parallelization |
| 354 | result = theAnalysisModel->analysisStep(0.0); |
| 355 | if (result < 0) { |
| 356 | opserr << "The AnalysisModel failed\n"; |
| 357 | opserr << " at step: " << i << " with domain at load factor "; |
| 358 | opserr << theDomain->getCurrentTime() << "\n"; |
| 359 | theDomain->revertToLastCommit(); |
| 360 | return -2; |
| 361 | } |
| 362 | |
| 363 | // Check for change in Domain since last step. As a change can |
| 364 | // occur in a commit() in a domain decomp with load balancing |
| 365 | // this must now be inside the loop |
| 366 | int stamp = theDomain->hasDomainChanged(); |
| 367 | |
| 368 | if (stamp != domainStamp) { |
| 369 | domainStamp = stamp; |
| 370 | result = this->domainChanged(); |
| 371 | if (result < 0) { |
| 372 | opserr << "domainChanged failed"; |
| 373 | opserr << " at step " << i << " of " << numSteps << "\n"; |
| 374 | return -1; |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | if (flag & Increment) { |
| 379 | result = theStaticIntegrator->newStep(); |
| 380 | if (result < 0) { |
| 381 | opserr << "The Integrator failed at step: " << i |
| 382 | << " with domain at load factor " << theDomain->getCurrentTime() << "\n"; |
| 383 | theDomain->revertToLastCommit(); |
| 384 | theStaticIntegrator->revertToLastStep(); |
| 385 | return -2; |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | if (flag & Iterate) { |
| 390 | result = theAlgorithm->solveCurrentStep(); |
| 391 | if (result < 0) { |
| 392 | // Print error message if we have one |
| 393 | if (AnalyzeFailedMessage.find(result) != AnalyzeFailedMessage.end()) { |
| 394 | opserr << OpenSees::PromptAnalysisFailure << AnalyzeFailedMessage[result]; |
| 395 | } |
| 396 | theDomain->revertToLastCommit(); |
| 397 | theStaticIntegrator->revertToLastStep(); |
| 398 | return -3; |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | if (theStaticIntegrator->shouldComputeAtEachStep()) { |
| 403 | result = theStaticIntegrator->computeSensitivities(); |
| 404 | if (result < 0) { |
no test coverage detected