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

Method addPDeltaStiff

SRC/element/twoNodeLink/TwoNodeLinkSection.cpp:1470–1570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1468
1469
1470void TwoNodeLinkSection::addPDeltaStiff(Matrix &kLocal, const Vector& qBasic)
1471{
1472 int dirID;
1473 double N = 0.0;
1474
1475 int numDIR = theSection->getOrder();
1476 const ID &type = theSection->getType();
1477
1478 // get axial force
1479 for (int i=0; i<numDIR; i++) {
1480 int dirID = this->getDirID(type(i));
1481 if (dirID == 0)
1482 N = qBasic(i);
1483 }
1484
1485 if (N != 0.0) {
1486 for (int i=0; i<numDIR; i++) {
1487 int dirID = this->getDirID(type(i));
1488 // switch on dimensionality of element
1489 switch (elemType) {
1490 case D2N4:
1491 if (dirID == 1) {
1492 double NoverL = N/L;
1493 NoverL *= 1.0-Mratio(2)-Mratio(3);
1494 kLocal(1,1) += NoverL;
1495 kLocal(1,3) -= NoverL;
1496 kLocal(3,1) -= NoverL;
1497 kLocal(3,3) += NoverL;
1498 }
1499 break;
1500 case D2N6:
1501 if (dirID == 1) {
1502 double NoverL = N/L;
1503 NoverL *= 1.0-Mratio(2)-Mratio(3);
1504 kLocal(1,1) += NoverL;
1505 kLocal(1,4) -= NoverL;
1506 kLocal(4,1) -= NoverL;
1507 kLocal(4,4) += NoverL;
1508 }
1509 else if (dirID == 2) {
1510 kLocal(2,1) -= Mratio(2)*N;
1511 kLocal(2,4) += Mratio(2)*N;
1512 kLocal(5,1) -= Mratio(3)*N;
1513 kLocal(5,4) += Mratio(3)*N;
1514 }
1515 break;
1516 case D3N6:
1517 if (dirID == 1) {
1518 double NoverL = N/L;
1519 NoverL *= 1.0-Mratio(2)-Mratio(3);
1520 kLocal(1,1) += NoverL;
1521 kLocal(1,4) -= NoverL;
1522 kLocal(4,1) -= NoverL;
1523 kLocal(4,4) += NoverL;
1524 }
1525 else if (dirID == 2) {
1526 double NoverL = N/L;
1527 NoverL *= 1.0-Mratio(0)-Mratio(1);

Callers 1

Calls 4

getDirIDMethod · 0.95
typeEnum · 0.50
getOrderMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected