| 1245 | } |
| 1246 | |
| 1247 | int |
| 1248 | ComponentElement2d::getResponse (int responseID, Information &eleInfo) |
| 1249 | { |
| 1250 | double N, M1, M2, V; |
| 1251 | double L = theCoordTransf->getInitialLength(); |
| 1252 | this->getResistingForce(); |
| 1253 | static Vector vect4(4); |
| 1254 | static Vector vect2(2); |
| 1255 | static Matrix kb(3,3); |
| 1256 | |
| 1257 | switch (responseID) { |
| 1258 | case 1: // stiffness |
| 1259 | return eleInfo.setMatrix(this->getTangentStiff()); |
| 1260 | |
| 1261 | case 2: // global forces |
| 1262 | return eleInfo.setVector(this->getResistingForce()); |
| 1263 | |
| 1264 | case 3: // local forces |
| 1265 | // Axial |
| 1266 | N = q(0); |
| 1267 | P(3) = N; |
| 1268 | P(0) = -N+p0[0]; |
| 1269 | // Moment |
| 1270 | M1 = q(1); |
| 1271 | M2 = q(2); |
| 1272 | P(2) = M1; |
| 1273 | P(5) = M2; |
| 1274 | // Shear |
| 1275 | V = (M1+M2)/L; |
| 1276 | P(1) = V+p0[1]; |
| 1277 | P(4) = -V+p0[2]; |
| 1278 | return eleInfo.setVector(P); |
| 1279 | |
| 1280 | case 4: // basic forces |
| 1281 | return eleInfo.setVector(q); |
| 1282 | |
| 1283 | case 5: // basic forces |
| 1284 | vect4.Zero(); |
| 1285 | if (end1Hinge != 0) { |
| 1286 | vect4(0) = end1Hinge->getStrain(); |
| 1287 | vect4(1) = end1Hinge->getStress(); |
| 1288 | } |
| 1289 | if (end2Hinge != 0) { |
| 1290 | vect4(2) = end2Hinge->getStrain(); |
| 1291 | vect4(3) = end2Hinge->getStress(); |
| 1292 | } |
| 1293 | return eleInfo.setVector(vect4); |
| 1294 | |
| 1295 | case 6: // hinge tangent |
| 1296 | if (end1Hinge != 0) { |
| 1297 | vect2(0) = end1Hinge->getTangent(); |
| 1298 | } |
| 1299 | if (end2Hinge != 0) { |
| 1300 | vect2(1) = end2Hinge->getTangent(); |
| 1301 | } |
| 1302 | return eleInfo.setVector(vect2); |
| 1303 | |
| 1304 | case 8: |
nothing calls this directly
no test coverage detected