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

Method getResponse

DEVELOPER/core/UniaxialMaterial.cpp:304–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304int
305UniaxialMaterial::getResponse(int responseID, Information &matInfo)
306{
307 static Vector stressStrain(2);
308 static Vector stressStrainTangent(3);
309
310 static Vector tempData(2); //L.jiang [SIF]
311 static Information infoData(tempData); //L.jiang [SIF]
312
313 // each subclass must implement its own stuff
314
315 // added for sensitivity recorder. Quan 2009
316 if ((responseID>10000)&&(responseID<20000)){
317 matInfo.setDouble(this->getStressSensitivity(responseID-10000,false));
318 return 0;
319 }
320 else if (responseID>20000){
321 matInfo.setDouble(this->getStrainSensitivity(responseID-20000));
322 return 0;
323 }
324
325 double kInit;
326 double stress;
327 double strain;
328
329 switch (responseID) {
330 case 1:
331 matInfo.setDouble(this->getStress());
332 return 0;
333
334 case 2:
335 matInfo.setDouble(this->getTangent());
336 return 0;
337
338 case 3:
339 matInfo.setDouble(this->getStrain());
340 return 0;
341
342 case 6: // an approx to plastic strain
343 strain = this->getStrain();
344 stress = this->getStress();
345 kInit = this->getTangent();
346 strain = strain-stress/kInit;
347 matInfo.setDouble(strain);
348 return 0;
349
350 case 4:
351 stressStrain(0) = this->getStress();
352 stressStrain(1) = this->getStrain();
353 matInfo.setVector(stressStrain);
354 return 0;
355
356 case 5:
357 stressStrainTangent(0) = this->getStress();
358 stressStrainTangent(1) = this->getStrain();
359 stressStrainTangent(2) = this->getTangent();
360 matInfo.setVector(stressStrainTangent);
361 return 0;

Callers

nothing calls this directly

Calls 9

getStressSensitivityMethod · 0.95
getStrainSensitivityMethod · 0.95
setDoubleMethod · 0.45
getStressMethod · 0.45
getTangentMethod · 0.45
getStrainMethod · 0.45
setVectorMethod · 0.45
getVariableMethod · 0.45
getDataMethod · 0.45

Tested by

no test coverage detected