| 44 | |
| 45 | |
| 46 | void * OPS_HHTExplicit(void) |
| 47 | { |
| 48 | // pointer to an integrator that will be returned |
| 49 | TransientIntegrator *theIntegrator = 0; |
| 50 | |
| 51 | int argc = OPS_GetNumRemainingInputArgs(); |
| 52 | if (argc < 1 || argc > 3) { |
| 53 | opserr << "WARNING - incorrect number of args want HHTExplicit $alpha <-updateElemDisp>\n"; |
| 54 | opserr << " or HHTExplicit $alpha $gamma <-updateElemDisp>\n"; |
| 55 | return 0; |
| 56 | } |
| 57 | |
| 58 | bool updElemDisp = false; |
| 59 | double dData[2]; |
| 60 | int numData = 0; |
| 61 | |
| 62 | // count number of numeric parameters |
| 63 | while (OPS_GetNumRemainingInputArgs() > 0) { |
| 64 | const char *argvLoc = OPS_GetString(); |
| 65 | if (strcmp(argvLoc, "-updateElemDisp") == 0) { |
| 66 | break; |
| 67 | } |
| 68 | numData++; |
| 69 | } |
| 70 | // reset to read from beginning |
| 71 | OPS_ResetCurrentInputArg(2); |
| 72 | |
| 73 | if (OPS_GetDouble(&numData, dData) != 0) { |
| 74 | opserr << "WARNING - invalid args want HHTExplicit $alpha <-updateElemDisp>\n"; |
| 75 | opserr << " or HHTExplicit $alpha $gamma <-updateElemDisp>\n"; |
| 76 | return 0; |
| 77 | } |
| 78 | |
| 79 | if (numData+1 == argc) { |
| 80 | const char *argvLoc = OPS_GetString(); |
| 81 | if (strcmp(argvLoc, "-updateElemDisp") == 0) |
| 82 | updElemDisp = true; |
| 83 | } |
| 84 | |
| 85 | if (numData == 1) |
| 86 | theIntegrator = new HHTExplicit(dData[0], updElemDisp); |
| 87 | else if (numData == 2) |
| 88 | theIntegrator = new HHTExplicit(dData[0], dData[1], updElemDisp); |
| 89 | |
| 90 | if (theIntegrator == 0) |
| 91 | opserr << "WARNING - out of memory creating HHTExplicit integrator\n"; |
| 92 | |
| 93 | return theIntegrator; |
| 94 | } |
| 95 | |
| 96 | |
| 97 | HHTExplicit::HHTExplicit() |
no test coverage detected