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

Function OPS_groundMotion

SRC/interpreter/OpenSeesPatternCommands.cpp:1195–1397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1193}
1194
1195int OPS_groundMotion()
1196{
1197 GroundMotion *theMotion = 0;
1198 int gMotionTag;
1199
1200 MultiSupportPattern *thePattern = theActiveMultiSupportPattern;
1201 if (thePattern == 0) {
1202 opserr << "WARNING no active multi support pattern - groundMotion\n";
1203 return -1;
1204 }
1205
1206 // make sure at least one other argument to contain integrator
1207 if (OPS_GetNumRemainingInputArgs() < 2) {
1208 opserr << "WARNING invalid command - want: groundMotion tag type <args>\n";
1209 opserr << " valid types: AccelRecord and Interpolated \n";
1210 return -1;
1211 }
1212
1213 int numdata = 1;
1214 if (OPS_GetIntInput(&numdata, &gMotionTag) < 0) {
1215 opserr << "WARNING invalid tag: groundMotion tag type <args>\n";
1216 return -1;
1217 }
1218
1219 const char* type = OPS_GetString();
1220 if ((strcmp(type,"Series") == 0) ||
1221 (strcmp(type,"Plain") == 0)) {
1222
1223 TimeSeries *accelSeries = 0;
1224 TimeSeries *velSeries = 0;
1225 TimeSeries *dispSeries = 0;
1226 TimeSeriesIntegrator *seriesIntegrator = 0;
1227
1228 double dtInt = 0.01;
1229 double fact = 1.0;
1230 while (OPS_GetNumRemainingInputArgs() > 1) {
1231 const char* flag = OPS_GetString();
1232 if ((strcmp(flag,"-accel") == 0) ||
1233 (strcmp(flag,"-acceleration") == 0)) {
1234
1235 int tsTag;
1236 if (OPS_GetIntInput(&numdata, &tsTag) < 0) {
1237 opserr << "WARNING failed to get accel time series tag\n";
1238 return -1;
1239 }
1240
1241 accelSeries = OPS_getTimeSeries(tsTag);
1242
1243 if (accelSeries == 0) {
1244 opserr << "WARNING invalid accel series: " << tsTag;
1245 opserr << " groundMotion tag Series -accel {series}\n";
1246 return -1;
1247 }
1248
1249
1250 } else if ((strcmp(flag,"-vel") == 0) ||
1251 (strcmp(flag,"-velocity") == 0)) {
1252

Callers 2

Tcl_ops_groundMotionFunction · 0.85
Py_ops_groundMotionFunction · 0.85

Calls 8

OPS_getTimeSeriesFunction · 0.85
OPS_TimeSeriesIntegratorFunction · 0.85
OPS_GetIntInputFunction · 0.70
OPS_GetStringFunction · 0.70
OPS_GetDoubleInputFunction · 0.70
getMotionMethod · 0.45
addMotionMethod · 0.45

Tested by

no test coverage detected