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

Function getLoadFactor

SRC/runtime/commands/domain/commands.cpp:220–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218
219
220int
221getLoadFactor(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

Callers

nothing calls this directly

Calls 2

getLoadPatternMethod · 0.45
getLoadFactorMethod · 0.45

Tested by

no test coverage detected