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

Method getResponse

SRC/material/section/FiberSection2d.cpp:1101–1168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1099
1100
1101int
1102FiberSection2d::getResponse(int responseID, Information &sectInfo)
1103{
1104 if (responseID == 5) {
1105 int numData = 5*numFibers;
1106 Vector data(numData);
1107 int count = 0;
1108 for (int j = 0; j < numFibers; j++) {
1109 data(count) = matData[2*j];
1110 data(count+1) = 0.0;
1111 data(count+2) = matData[2*j+1];
1112 data(count+3) = theMaterials[j]->getStress();
1113 data(count+4) = theMaterials[j]->getStrain();
1114 count += 5;
1115 }
1116 return sectInfo.setVector(data);
1117 }
1118 if (responseID == 55) {
1119 int numData = 6*numFibers;
1120 Vector data(numData);
1121 int count = 0;
1122 for (int j = 0; j < numFibers; j++) {
1123 data(count) = matData[2*j]; // y
1124 data(count+1) = 0.0; // z
1125 data(count+2) = matData[2*j+1]; // A
1126 data(count+3) = (double)theMaterials[j]->getTag();
1127 data(count+4) = theMaterials[j]->getStress();
1128 data(count+5) = theMaterials[j]->getStrain();
1129 count += 6;
1130 }
1131 return sectInfo.setVector(data);
1132 }
1133 else if (responseID == 6) {
1134
1135 int count = 0;
1136 for (int j = 0; j < numFibers; j++) {
1137 if (theMaterials[j]->hasFailed() == true)
1138 count++;
1139 }
1140 return sectInfo.setInt(count);
1141
1142 } else if (responseID == 7) {
1143 int count = 0;
1144 for (int j = 0; j < numFibers; j++) {
1145 if (theMaterials[j]->hasFailed() == true) {
1146 count+=1;
1147 }
1148 }
1149 if (count == numFibers)
1150 count = 1;
1151 else
1152 count = 0;
1153
1154 return sectInfo.setInt(count);
1155 }
1156 //by SAJalali
1157 else if (responseID == 8) {
1158 return sectInfo.setDouble(getEnergy());

Callers

nothing calls this directly

Calls 7

getStressMethod · 0.45
getStrainMethod · 0.45
setVectorMethod · 0.45
getTagMethod · 0.45
hasFailedMethod · 0.45
setIntMethod · 0.45
setDoubleMethod · 0.45

Tested by

no test coverage detected