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

Function specifyAnalysis

SRC/runtime/commands/analysis/analysis.cpp:98–145  ·  view source on GitHub ↗

command invoked to build an Analysis object

Source from the content-addressed store, hash-verified

96// command invoked to build an Analysis object
97//
98static int
99specifyAnalysis(ClientData clientData, Tcl_Interp *interp, Tcl_Size argc,
100 TCL_Char ** const argv)
101{
102 assert(clientData != nullptr);
103 BasicAnalysisBuilder *builder = (BasicAnalysisBuilder*)clientData;
104
105 if (argc < 2) {
106 opserr << OpenSees::PromptValueError
107 << "need to specify an analysis type (Static, Transient)\n";
108 return TCL_ERROR;
109 }
110
111 int argi = 1;
112
113 if (strcmp(argv[argi], "-linear") == 0) {
114 if (argc < 3) {
115 opserr << OpenSees::PromptValueError << "need to specify an analysis type (Static, Transient)\n";
116 return TCL_ERROR;
117 }
118 Tcl_Eval(interp, "algorithm Linear\n"
119 "test FixedNumIter 1\n"
120 );
121 argi++;
122 }
123 if (strcmp(argv[argi], "Static") == 0) {
124 builder->setStaticAnalysis();
125 return TCL_OK;
126
127 } else if (strcmp(argv[argi], "Transient") == 0) {
128 builder->setTransientAnalysis();
129 return TCL_OK;
130 }
131
132 else if (((strcmp(argv[1], "VariableTimeStepTransient") == 0) ||
133 (strcmp(argv[1], "TransientWithVariableTimeStep") == 0) ||
134 (strcmp(argv[1], "VariableTransient") == 0))) {
135 opserr << "Unimplemented\n";
136 return TCL_ERROR;
137
138 } else {
139 opserr << OpenSees::PromptValueError << "Analysis type '" << argv[1]
140 << "' does not exists (Static or Transient only). \n";
141 return TCL_ERROR;
142 }
143
144 return TCL_OK;
145}
146
147//
148// Command invoked to build the model, i.e. to invoke analyze()

Callers

nothing calls this directly

Calls 2

setStaticAnalysisMethod · 0.45
setTransientAnalysisMethod · 0.45

Tested by

no test coverage detected