| 45 | |
| 46 | OPS_Export void * |
| 47 | OPS_ConstantSeries(void) |
| 48 | { |
| 49 | // Pointer to a uniaxial material that will be returned |
| 50 | TimeSeries *theSeries = 0; |
| 51 | |
| 52 | int numRemainingArgs = OPS_GetNumRemainingInputArgs(); |
| 53 | |
| 54 | int tag = 0; |
| 55 | double cFactor = 1.0; |
| 56 | int numData = 0; |
| 57 | |
| 58 | if (numRemainingArgs != 0) { |
| 59 | |
| 60 | if (numRemainingArgs == 1 || numRemainingArgs == 3) { |
| 61 | numData = 1; |
| 62 | if (OPS_GetIntInput(&numData, &tag) != 0) { |
| 63 | opserr << "WARNING invalid series tag in ConstantSeries tag? <-factor factor?>" << endln; |
| 64 | return 0; |
| 65 | } |
| 66 | numRemainingArgs --; |
| 67 | } |
| 68 | |
| 69 | if (numRemainingArgs > 1) { |
| 70 | const char *argvS = OPS_GetString(); |
| 71 | if (argvS == 0) { |
| 72 | opserr << "WARNING string error in ConstantSeries with tag: " << tag << endln; |
| 73 | return 0; |
| 74 | } |
| 75 | numData = 1; |
| 76 | if (OPS_GetDouble(&numData, &cFactor) != 0) { |
| 77 | opserr << "WARNING invalid factor in ConstantSeries with tag: " << tag << endln; |
| 78 | return 0; |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | theSeries = new ConstantSeries(tag, cFactor); |
| 84 | |
| 85 | if (theSeries == 0) { |
| 86 | opserr << "WARNING ran out of memory creating ConstantTimeSeries with tag: " << tag << "\n"; |
| 87 | return 0; |
| 88 | } |
| 89 | |
| 90 | return theSeries; |
| 91 | } |
| 92 | |
| 93 | |
| 94 | ConstantSeries::ConstantSeries(int tag, double theFactor) |
no test coverage detected