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

Method commitSensitivity

SRC/material/section/NDFiberSection2d.cpp:1541–1600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1539}
1540
1541int
1542NDFiberSection2d::commitSensitivity(const Vector& defSens,
1543 int gradIndex, int numGrads)
1544{
1545 double d0 = defSens(0);
1546 double d1 = defSens(1);
1547 double d2 = defSens(2);
1548
1549 dedh = defSens;
1550
1551 static double fiberLocs[10000];
1552
1553 if (sectionIntegr != 0)
1554 sectionIntegr->getFiberLocations(numFibers, fiberLocs);
1555 else {
1556 for (int i = 0; i < numFibers; i++)
1557 fiberLocs[i] = matData[2*i];
1558 }
1559
1560 static double locsDeriv[10000];
1561 static double areaDeriv[10000];
1562
1563 if (sectionIntegr != 0) {
1564 sectionIntegr->getLocationsDeriv(numFibers, locsDeriv);
1565 sectionIntegr->getWeightsDeriv(numFibers, areaDeriv);
1566 }
1567 else {
1568 for (int i = 0; i < numFibers; i++) {
1569 locsDeriv[i] = 0.0;
1570 areaDeriv[i] = 0.0;
1571 }
1572 }
1573
1574 double y;
1575 double kappa = e(1);
1576 double gamma = e(2);
1577
1578 static Vector depsdh(2);
1579
1580 double rootAlpha = 1.0;
1581 if (alpha != 1.0)
1582 rootAlpha = sqrt(alpha);
1583
1584 double drootAlphadh = 0.0;
1585 if (parameterID == 1)
1586 drootAlphadh = 0.5/rootAlpha;
1587
1588 depsdh(1) = rootAlpha*d2 + drootAlphadh*gamma;
1589
1590 for (int i = 0; i < numFibers; i++) {
1591 NDMaterial *theMat = theMaterials[i];
1592 y = fiberLocs[i] - yBar;
1593
1594 // determine material strain and set it
1595 depsdh(0) = d0 - y*d1 - locsDeriv[i]*kappa;
1596 theMat->commitSensitivity(depsdh,gradIndex,numGrads);
1597 }
1598

Callers

nothing calls this directly

Calls 3

getFiberLocationsMethod · 0.45
getLocationsDerivMethod · 0.45
getWeightsDerivMethod · 0.45

Tested by

no test coverage detected