| 218 | |
| 219 | |
| 220 | int |
| 221 | getLoadFactor(ClientData clientData, Tcl_Interp *interp, Tcl_Size argc, |
| 222 | TCL_Char ** const argv) |
| 223 | { |
| 224 | assert(clientData != nullptr); |
| 225 | Domain* domain = (Domain*)clientData; |
| 226 | |
| 227 | if (argc < 2) { |
| 228 | opserr << OpenSees::PromptValueError |
| 229 | << "no load pattern supplied -- getLoadFactor\n"; |
| 230 | return TCL_ERROR; |
| 231 | } |
| 232 | |
| 233 | int pattern; |
| 234 | if (Tcl_GetInt(interp, argv[1], &pattern) != TCL_OK) { |
| 235 | opserr << OpenSees::PromptValueError |
| 236 | << "reading load pattern tag -- getLoadFactor\n"; |
| 237 | return TCL_ERROR; |
| 238 | } |
| 239 | |
| 240 | LoadPattern *the_pattern = domain->getLoadPattern(pattern); |
| 241 | if (the_pattern == nullptr) { |
| 242 | opserr << OpenSees::PromptValueError << "load pattern with tag " << pattern |
| 243 | << " not found in domain -- getLoadFactor\n"; |
| 244 | return TCL_ERROR; |
| 245 | } |
| 246 | |
| 247 | double factor = the_pattern->getLoadFactor(); |
| 248 | Tcl_SetObjResult(interp, Tcl_NewDoubleObj(factor)); |
| 249 | |
| 250 | return TCL_OK; |
| 251 | } |
| 252 | |
| 253 | |
| 254 |
nothing calls this directly
no test coverage detected