| 531 | } |
| 532 | |
| 533 | int 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 |
no test coverage detected