Command invoked to build the model, i.e. to invoke analyze() on the Analysis object
| 149 | // on the Analysis object |
| 150 | // |
| 151 | static int |
| 152 | analyzeModel(ClientData clientData, Tcl_Interp *interp, Tcl_Size argc, |
| 153 | TCL_Char ** const argv) |
| 154 | { |
| 155 | assert(clientData != nullptr); |
| 156 | BasicAnalysisBuilder *builder = (BasicAnalysisBuilder*)clientData; |
| 157 | |
| 158 | int result = 0; |
| 159 | int commit = BasicAnalysisBuilder::Increment |
| 160 | | BasicAnalysisBuilder::Iterate |
| 161 | | BasicAnalysisBuilder::Commit; |
| 162 | |
| 163 | for (int i=2; i<argc; i++) { |
| 164 | if (strcmp(argv[i], "-operation") == 0) { |
| 165 | if (argc < i+2) { |
| 166 | opserr << OpenSees::PromptValueError << "operation key requires argument\n"; |
| 167 | return TCL_ERROR; |
| 168 | } |
| 169 | i++; |
| 170 | if (strcmp(argv[i], "commit") == 0) { |
| 171 | commit = BasicAnalysisBuilder::Commit; |
| 172 | } |
| 173 | else if (strcmp(argv[i], "increment") == 0) { |
| 174 | commit = BasicAnalysisBuilder::Increment; |
| 175 | } |
| 176 | else if (strcmp(argv[i], "iteration") == 0) { |
| 177 | commit = BasicAnalysisBuilder::Iterate; |
| 178 | } |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | switch (builder->CurrentAnalysisFlag) { |
| 183 | case BasicAnalysisBuilder::STATIC_ANALYSIS: { |
| 184 | int numIncr; |
| 185 | if (argc < 2) { |
| 186 | opserr << OpenSees::PromptValueError << "static analysis: analysis numIncr?\n"; |
| 187 | return TCL_ERROR; |
| 188 | } |
| 189 | |
| 190 | if (Tcl_GetInt(interp, argv[1], &numIncr) != TCL_OK) |
| 191 | return TCL_ERROR; |
| 192 | |
| 193 | result = builder->analyze(numIncr, 0.0, commit); |
| 194 | break; |
| 195 | } |
| 196 | case BasicAnalysisBuilder::TRANSIENT_ANALYSIS: { |
| 197 | double dT; |
| 198 | int numIncr; |
| 199 | if (argc < 3) { |
| 200 | opserr << OpenSees::PromptValueError << "transient analysis: analysis numIncr? deltaT?\n"; |
| 201 | return TCL_ERROR; |
| 202 | } |
| 203 | if (Tcl_GetInt(interp, argv[1], &numIncr) != TCL_OK) |
| 204 | return TCL_ERROR; |
| 205 | if (Tcl_GetDouble(interp, argv[2], &dT) != TCL_OK) |
| 206 | return TCL_ERROR; |
| 207 | |
| 208 | if (argc == 6) { |
nothing calls this directly
no test coverage detected