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

Method setResponse

DEVELOPER/core/NDMaterial.cpp:236–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234//end of adding thermo-mechanical functions, L.Jiang [SIF]
235
236Response*
237NDMaterial::setResponse (const char **argv, int argc,
238 OPS_Stream &output)
239{
240 Response *theResponse =0;
241 const char *matType = this->getType();
242
243 output.tag("NdMaterialOutput");
244 output.attr("matType",this->getClassType());
245 output.attr("matTag",this->getTag());
246
247 if (strcmp(argv[0],"stress") == 0 || strcmp(argv[0],"stresses") == 0) {
248 const Vector &res = this->getStress();
249 int size = res.Size();
250
251 if ( (strcmp(matType,"PlaneStress") == 0 && size == 3) ||
252 (strcmp(matType,"PlaneStrain") == 0 && size == 3)) {
253 output.tag("ResponseType","sigma11");
254 output.tag("ResponseType","sigma22");
255 output.tag("ResponseType","sigma12");
256 } else if (strcmp(matType,"ThreeDimensional") == 0 && size == 6) {
257 output.tag("ResponseType","sigma11");
258 output.tag("ResponseType","sigma22");
259 output.tag("ResponseType","sigma33");
260 output.tag("ResponseType","sigma12");
261 output.tag("ResponseType","sigma23");
262 output.tag("ResponseType","sigma13");
263 } else {
264 for (int i=0; i<size; i++)
265 output.tag("ResponseType","UnknownStress");
266 }
267 theResponse = new MaterialResponse(this, 1, this->getStress());
268
269 } else if (strcmp(argv[0],"strain") == 0 || strcmp(argv[0],"strains") == 0) {
270 const Vector &res = this->getStrain();
271 int size = res.Size();
272 if ( (strcmp(matType,"PlaneStress") == 0 && size == 3) ||
273 (strcmp(matType,"PlaneStrain") == 0 && size == 3)) {
274 output.tag("ResponseType","eta11");
275 output.tag("ResponseType","eta22");
276 output.tag("ResponseType","eta12");
277 } else if (strcmp(matType,"ThreeDimensional") == 0 && size == 6) {
278 output.tag("ResponseType","eps11");
279 output.tag("ResponseType","eps22");
280 output.tag("ResponseType","eps33");
281 output.tag("ResponseType","eps12");
282 output.tag("ResponseType","eps23");
283 output.tag("ResponseType","eps13");
284 } else {
285 for (int i=0; i<size; i++)
286 output.tag("ResponseType","UnknownStrain");
287 }
288 theResponse = new MaterialResponse(this, 2, this->getStress());
289 }
290 //Adding temperature and thermal expansion output,L.Jiang [SIF]
291 else if (strcmp(argv[0], "TempAndElong") == 0 || strcmp(argv[0], "TempAndElong") == 0) {
292 const Vector &res = this->getTempAndElong();
293 int size = res.Size();

Callers

nothing calls this directly

Calls 10

getTypeMethod · 0.45
tagMethod · 0.45
attrMethod · 0.45
getClassTypeMethod · 0.45
getTagMethod · 0.45
getStressMethod · 0.45
SizeMethod · 0.45
getStrainMethod · 0.45
getTangentMethod · 0.45
endTagMethod · 0.45

Tested by

no test coverage detected