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

Function specifyAnalysis

SRC/tcl/commands.cpp:2452–2962  ·  view source on GitHub ↗

command invoked to allow the Analysis object to be built

Source from the content-addressed store, hash-verified

2450// command invoked to allow the Analysis object to be built
2451//
2452int
2453specifyAnalysis(ClientData clientData, Tcl_Interp *interp, int argc,
2454 TCL_Char **argv)
2455{
2456 // make sure at least one other argument to contain type of system
2457 if (argc < 2) {
2458 opserr << "WARNING need to specify an analysis type (Static, Transient)\n";
2459 return TCL_ERROR;
2460 }
2461
2462 //
2463 // do nothing if request is for the same analysis type!
2464 //
2465
2466 if ((strcmp(argv[1],"Static") == 0) && (theStaticAnalysis != 0))
2467 return TCL_OK;
2468
2469 if (((strcmp(argv[1],"VariableTimeStepTransient") == 0) ||
2470 (strcmp(argv[1],"TransientWithVariableTimeStep") == 0) ||
2471 (strcmp(argv[1],"VariableTransient") == 0)) &&
2472 (theVariableTimeStepTransientAnalysis != 0))
2473 return TCL_OK;
2474
2475 if ((strcmp(argv[1],"Transient") == 0) && (theTransientAnalysis != 0))
2476 return TCL_OK;
2477
2478 //
2479 // analysis changing .. delete the old analysis
2480 //
2481
2482 if (theStaticAnalysis != 0) {
2483 delete theStaticAnalysis;
2484 theStaticAnalysis = 0;
2485 opserr << "WARNING: analysis .. StaticAnalysis already exists => wipeAnalysis not invoked, problems may arise\n";
2486 }
2487
2488 if (theTransientAnalysis != 0) {
2489 delete theTransientAnalysis;
2490 theTransientAnalysis = 0;
2491 theVariableTimeStepTransientAnalysis = 0;
2492 opserr << "WARNING: analysis .. TransientAnalysis already exists => wipeAnalysis not invoked, problems may arise\n";
2493 }
2494
2495 // check argv[1] for type of SOE and create it
2496 if (strcmp(argv[1],"Static") == 0) {
2497 // make sure all the components have been built,
2498 // otherwise print a warning and use some defaults
2499 if (theAnalysisModel == 0)
2500 theAnalysisModel = new AnalysisModel();
2501
2502 if (theTest == 0)
2503 theTest = new CTestNormUnbalance(1.0e-6,25,0);
2504
2505 if (theAlgorithm == 0) {
2506 opserr << "WARNING analysis Static - no Algorithm yet specified, \n";
2507 opserr << " NewtonRaphson default will be used\n";
2508
2509 theAlgorithm = new NewtonRaphson(*theTest);

Callers

nothing calls this directly

Calls 4

setAnalysisModelMethod · 0.45
setEigenSOEMethod · 0.45

Tested by

no test coverage detected