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

Function OPS_getLoadFactor

SRC/interpreter/OpenSeesOutputCommands.cpp:533–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

531}
532
533int OPS_getLoadFactor()
534{
535 if (OPS_GetNumRemainingInputArgs() < 1) {
536 opserr << "WARNING no load pattern supplied -- getLoadFactor\n";
537 return -1;
538 }
539
540 int pattern;
541 int numdata = 1;
542 if (OPS_GetIntInput(&numdata, &pattern) < 0) {
543 opserr << "ERROR reading load pattern tag -- getLoadFactor\n";
544 return -1;
545 }
546
547 Domain* theDomain = OPS_GetDomain();
548 if (theDomain == 0) return -1;
549 LoadPattern *thePattern = theDomain->getLoadPattern(pattern);
550 if (thePattern == 0) {
551 opserr << "ERROR load pattern with tag " << pattern << " not found in domain -- getLoadFactor\n";
552 return -1;
553 }
554
555 double factor = thePattern->getLoadFactor();
556 if (OPS_SetDoubleOutput(&numdata, &factor, true) < 0) {
557 opserr << "WARNING failed to set load factor\n";
558 return -1;
559 }
560
561 return 0;
562}
563
564// printNode():
565// function to print out the nodal information contained in line

Callers 2

Tcl_ops_getLoadFactorFunction · 0.85
Py_ops_getLoadFactorFunction · 0.85

Calls 6

OPS_GetIntInputFunction · 0.70
OPS_GetDomainFunction · 0.70
OPS_SetDoubleOutputFunction · 0.70
getLoadPatternMethod · 0.45
getLoadFactorMethod · 0.45

Tested by

no test coverage detected