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

Function OPS_HHTExplicit

SRC/analysis/integrator/HHTExplicit.cpp:46–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45
46void * 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
97HHTExplicit::HHTExplicit()

Callers 2

OPS_IntegratorFunction · 0.85
specifyIntegratorFunction · 0.85

Calls 3

OPS_GetStringFunction · 0.50
OPS_ResetCurrentInputArgFunction · 0.50

Tested by

no test coverage detected