| 1372 | } |
| 1373 | |
| 1374 | void TwoNodeLinkSection::addPDeltaForces(Vector &pLocal, const Vector& qBasic) |
| 1375 | { |
| 1376 | int dirID; |
| 1377 | double N = 0.0; |
| 1378 | double deltal1 = 0.0; |
| 1379 | double deltal2 = 0.0; |
| 1380 | |
| 1381 | int numDIR = theSection->getOrder(); |
| 1382 | const ID &type = theSection->getType(); |
| 1383 | |
| 1384 | for (int i=0; i<numDIR; i++) { |
| 1385 | int dirID = this->getDirID(type(i)); |
| 1386 | |
| 1387 | // get axial force and local disp differences |
| 1388 | if (dirID == 0) |
| 1389 | N = qBasic(i); |
| 1390 | else if (dirID == 1 && numDIM > 1) |
| 1391 | deltal1 = ul(1+numDOF/2) - ul(1); |
| 1392 | else if (dirID == 2 && numDIM > 2) |
| 1393 | deltal2 = ul(2+numDOF/2) - ul(2); |
| 1394 | } |
| 1395 | |
| 1396 | if (N != 0.0 && (deltal1 != 0.0 || deltal2 != 0.0)) { |
| 1397 | for (int i=0; i<numDIR; i++) { |
| 1398 | int dirID = this->getDirID(type(i)); |
| 1399 | |
| 1400 | // switch on dimensionality of element |
| 1401 | switch (elemType) { |
| 1402 | case D2N4: |
| 1403 | if (dirID == 1) { |
| 1404 | double VpDelta = N*deltal1/L; |
| 1405 | VpDelta *= 1.0-Mratio(2)-Mratio(3); |
| 1406 | pLocal(1) -= VpDelta; |
| 1407 | pLocal(3) += VpDelta; |
| 1408 | } |
| 1409 | break; |
| 1410 | case D2N6: |
| 1411 | if (dirID == 1) { |
| 1412 | double VpDelta = N*deltal1/L; |
| 1413 | VpDelta *= 1.0-Mratio(2)-Mratio(3); |
| 1414 | pLocal(1) -= VpDelta; |
| 1415 | pLocal(4) += VpDelta; |
| 1416 | } |
| 1417 | else if (dirID == 2) { |
| 1418 | double MpDelta = N*deltal1; |
| 1419 | pLocal(2) += Mratio(2)*MpDelta; |
| 1420 | pLocal(5) += Mratio(3)*MpDelta; |
| 1421 | } |
| 1422 | break; |
| 1423 | case D3N6: |
| 1424 | if (dirID == 1) { |
| 1425 | double VpDelta = N*deltal1/L; |
| 1426 | VpDelta *= 1.0-Mratio(2)-Mratio(3); |
| 1427 | pLocal(1) -= VpDelta; |
| 1428 | pLocal(4) += VpDelta; |
| 1429 | } |
| 1430 | else if (dirID == 2) { |
| 1431 | double VpDelta = N*deltal2/L; |
no test coverage detected