| 572 | } |
| 573 | |
| 574 | int OPS_setParameter() { |
| 575 | double newValue = 0.0; |
| 576 | ID eleIDs(0, 32); |
| 577 | int numEle = 0; |
| 578 | int flag = 0; |
| 579 | |
| 580 | const char *opt = OPS_GetString(); |
| 581 | |
| 582 | int numdata = 1; |
| 583 | if (strcmp(opt, "-val") == 0) { |
| 584 | if (OPS_GetDoubleInput(&numdata, &newValue) < 0) { |
| 585 | opserr << "WARNING: failed to get paramber value\n"; |
| 586 | return -1; |
| 587 | } |
| 588 | } else { |
| 589 | opserr << "WARNING setParameter: -val not found \n"; |
| 590 | return -1; |
| 591 | } |
| 592 | |
| 593 | if (OPS_GetNumRemainingInputArgs() == 0) return 0; |
| 594 | |
| 595 | opt = OPS_GetString(); |
| 596 | |
| 597 | if ((strcmp(opt, "-ele") == 0) || (strcmp(opt, "-eles") == 0) || |
| 598 | (strcmp(opt, "-element") == 0)) { |
| 599 | // |
| 600 | // read in a list of ele until end of command or other flag |
| 601 | // |
| 602 | |
| 603 | int eleTag; |
| 604 | while (OPS_GetNumRemainingInputArgs() > 0) { |
| 605 | if (OPS_GetIntInput(&numdata, &eleTag) < 0) { |
| 606 | // back on arg |
| 607 | OPS_ResetCurrentInputArg(-1); |
| 608 | break; |
| 609 | } else { |
| 610 | eleIDs[numEle] = eleTag; |
| 611 | numEle++; |
| 612 | } |
| 613 | } |
| 614 | |
| 615 | if (numEle > 0) flag = 1; |
| 616 | |
| 617 | } else if (strcmp(opt, "-eleRange") == 0) { |
| 618 | flag = 2; |
| 619 | |
| 620 | // ensure no segmentation fault if user messes up |
| 621 | if (OPS_GetNumRemainingInputArgs() < 2) { |
| 622 | opserr << "WARNING recorder Element .. -eleRange start? end? .. - " |
| 623 | "no ele tags specified\n"; |
| 624 | return -1; |
| 625 | } |
| 626 | |
| 627 | // |
| 628 | // read in start and end tags of two elements & add set [start,end] |
| 629 | // |
| 630 | |
| 631 | int start, end; |
no test coverage detected