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

Function OPS_PeerMotion

SRC/domain/pattern/PeerMotion.cpp:63–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61
62OPS_Export void *
63OPS_PeerMotion(void)
64{
65 // Pointer to a uniaxial material that will be returned
66 TimeSeries *theSeries = 0;
67
68 int numRemainingArgs = OPS_GetNumRemainingInputArgs();
69
70 if (numRemainingArgs < 4) {
71 opserr << "WARNING: invalid num args PeerMotion <tag?> $eqMotion $station $type $factor\n";
72 return 0;
73 }
74
75 int tag = 0; // default tag = 0
76 double factor = 0.0;
77 int numData = 0;
78
79 char *eqMotion = 0;
80 char *station = 0;
81 char *type = 0;
82
83 // get tag if provided
84 if (numRemainingArgs == 5 || numRemainingArgs == 7 || numRemainingArgs == 9) {
85 numData = 1;
86 if (OPS_GetIntInput(&numData, &tag) != 0) {
87 opserr << "WARNING invalid series tag in Constant tag?" << endln;
88 return 0;
89 }
90 numRemainingArgs -= 1;
91 }
92
93 if ((OPS_GetStringCopy(&eqMotion) != 0) || eqMotion == 0) {
94 opserr << "WARNING invalid eqMotion for PeerMotion with tag: " << tag << endln;
95 return 0;
96 }
97
98 if ((OPS_GetStringCopy(&station) != 0) || station == 0) {
99 opserr << "WARNING invalid station for PeerMotion with tag: " << tag << endln;
100 return 0;
101 }
102
103 if ((OPS_GetStringCopy(&type) != 0) || type == 0) {
104 opserr << "WARNING invalid type for PeerMotion with tag: " << tag << endln;
105 return 0;
106 }
107
108
109 if (OPS_GetDouble(&numData, &factor) != 0) {
110 opserr << "WARNING invalid factor in PeerMotion Series with tag?" << tag << endln;
111 return 0;
112 }
113
114 theSeries = new PeerMotion(tag, eqMotion, station, type, factor);
115
116 if (theSeries == 0) {
117 opserr << "WARNING ran out of memory creating PeerMotion with tag: " << tag << "\n";
118 return 0;
119 }
120

Callers 1

Calls 3

OPS_GetIntInputFunction · 0.50
OPS_GetStringCopyFunction · 0.50

Tested by

no test coverage detected