| 38 | #include <string> |
| 39 | |
| 40 | void* 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 | |
| 83 | GroundMotion::GroundMotion(TimeSeries *dispSeries, |
| 84 | TimeSeries *velSeries, |
nothing calls this directly
no test coverage detected