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

Function OPS_NDGetStrain

SRC/interpreter/OpenSeesNDTestCommands.cpp:154–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152
153
154void* OPS_NDGetStrain()
155{
156 int tag = 0;
157 int size = 6;
158
159 int numdata = 1;
160 if (OPS_GetIntInput(&numdata, &tag) < 0) return 0;
161
162 NDMaterial* mat = OPS_getNDMaterial(tag);
163
164 if (mat == NULL)
165 {
166 opserr << "OPS_NDGetStrain - material with tag " << tag << " does not exist" << endln;
167 return 0;
168 }
169
170 const Vector &strain = mat->getStrain();
171
172 std::vector<double> values(size);
173 for (int i = 0; i < 6; i++) {
174 values[i] = strain(i);
175 }
176 if (OPS_SetDoubleOutput(&size, &values[0], false) < 0) {
177 opserr << "WARNING OPS_NDGetStress - failed to set double inputs\n";
178 return 0;
179 }
180
181
182 return 0;
183}
184
185
186

Callers

nothing calls this directly

Calls 4

OPS_GetIntInputFunction · 0.70
OPS_SetDoubleOutputFunction · 0.70
OPS_getNDMaterialFunction · 0.50
getStrainMethod · 0.45

Tested by

no test coverage detected