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

Function OPS_GroundMotion

SRC/domain/groundMotion/GroundMotion.cpp:40–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38#include <string>
39
40void* OPS_GroundMotion()
41{
42 TimeSeries* accelSeries = 0;
43 TimeSeries* velSeries = 0;
44 TimeSeries* dispSeries = 0;
45 TimeSeriesIntegrator* seriesIntegrator = 0;
46 double dtInt = 0.01;
47 double fact = 1.0;
48
49 while(OPS_GetNumRemainingInputArgs() > 1) {
50 std::string type = OPS_GetString();
51 if(type == "-accel"||type == "-acceleration") {
52 int tstag;
53 int numData = 1;
54 if(OPS_GetIntInput(&numData,&tstag) < 0) return 0;
55 accelSeries = OPS_getTimeSeries(tstag);
56 dtInt = accelSeries->getTimeIncr(0.0);
57 } else if(type == "-vel"||type == "-velocity") {
58 int tstag;
59 int numData = 1;
60 if(OPS_GetIntInput(&numData,&tstag) < 0) return 0;
61 velSeries = OPS_getTimeSeries(tstag);
62 dtInt = velSeries->getTimeIncr(0.0);
63 } else if(type == "-disp"||type == "-displacement") {
64 int tstag;
65 int numData = 1;
66 if(OPS_GetIntInput(&numData,&tstag) < 0) return 0;
67 dispSeries = OPS_getTimeSeries(tstag);
68 dtInt = dispSeries->getTimeIncr(0.0);
69 } else if(type == "-fact"||type == "-factor") {
70 int numData = 1;
71 if(OPS_GetDoubleInput(&numData,&fact) < 0) return 0;
72 }
73 }
74
75 if(accelSeries==0&&dispSeries==0&&velSeries==0) {
76 opserr<<"no time series is specified\n";
77 return 0;
78 }
79
80 return new GroundMotion(dispSeries,velSeries,accelSeries,seriesIntegrator,dtInt,fact);
81}
82
83GroundMotion::GroundMotion(TimeSeries *dispSeries,
84 TimeSeries *velSeries,

Callers

nothing calls this directly

Calls 6

OPS_getTimeSeriesFunction · 0.85
OPS_GetStringFunction · 0.50
OPS_GetIntInputFunction · 0.50
OPS_GetDoubleInputFunction · 0.50
getTimeIncrMethod · 0.45

Tested by

no test coverage detected