| 1323 | } |
| 1324 | |
| 1325 | int Joint2D::getResponse(int responseID, Information& eleInformation) |
| 1326 | { |
| 1327 | switch (responseID) { |
| 1328 | case -1: |
| 1329 | return -1; |
| 1330 | |
| 1331 | case 1: |
| 1332 | if (eleInformation.theVector != 0) |
| 1333 | { |
| 1334 | const Vector& disp = theNodes[4]->getTrialDisp(); |
| 1335 | (*(eleInformation.theVector))(0) = disp(0); |
| 1336 | (*(eleInformation.theVector))(1) = disp(1); |
| 1337 | (*(eleInformation.theVector))(2) = disp(2); |
| 1338 | (*(eleInformation.theVector))(3) = disp(3); |
| 1339 | } |
| 1340 | return 0; |
| 1341 | |
| 1342 | case 2: |
| 1343 | if (eleInformation.theVector != 0) |
| 1344 | { |
| 1345 | const Vector& node1Crd = theNodes[0]->getCrds(); |
| 1346 | const Vector& node2Crd = theNodes[1]->getCrds(); |
| 1347 | const Vector& node3Crd = theNodes[2]->getCrds(); |
| 1348 | const Vector& node4Crd = theNodes[3]->getCrds(); |
| 1349 | |
| 1350 | const Vector& node1Disp = theNodes[0]->getDisp(); |
| 1351 | const Vector& node2Disp = theNodes[1]->getDisp(); |
| 1352 | const Vector& node3Disp = theNodes[2]->getDisp(); |
| 1353 | const Vector& node4Disp = theNodes[3]->getDisp(); |
| 1354 | |
| 1355 | Vector v1(2); |
| 1356 | Vector v2(2); |
| 1357 | Vector v3(2); |
| 1358 | Vector v4(2); |
| 1359 | |
| 1360 | // calculate the current coordinates of four external nodes |
| 1361 | for (int i = 0; i < 2; i++) |
| 1362 | { |
| 1363 | v1(i) = node1Crd(i) + node1Disp(i); |
| 1364 | v2(i) = node2Crd(i) + node2Disp(i); |
| 1365 | v3(i) = node3Crd(i) + node3Disp(i); |
| 1366 | v4(i) = node4Crd(i) + node4Disp(i); |
| 1367 | } |
| 1368 | |
| 1369 | v3 = v3 - v1; |
| 1370 | v4 = v4 - v2; |
| 1371 | |
| 1372 | v1(0) = v3.Norm(); |
| 1373 | v1(1) = v4.Norm(); |
| 1374 | |
| 1375 | *(eleInformation.theVector) = v1; |
| 1376 | } |
| 1377 | return 0; |
| 1378 | |
| 1379 | case 3: |
| 1380 | if (eleInformation.theVector != 0) |
| 1381 | { |
| 1382 | for (int i = 0; i < 5; i++) |
nothing calls this directly
no test coverage detected