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

Method commitSensitivity

SRC/material/section/FiberSection2d.cpp:1425–1470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1423}
1424
1425int
1426FiberSection2d::commitSensitivity(const Vector& defSens,
1427 int gradIndex, int numGrads)
1428{
1429 double d0 = defSens(0);
1430 double d1 = defSens(1);
1431
1432 dedh = defSens;
1433
1434 static double fiberLocs[10000];
1435
1436 if (sectionIntegr != 0)
1437 sectionIntegr->getFiberLocations(numFibers, fiberLocs);
1438 else {
1439 for (int i = 0; i < numFibers; i++)
1440 fiberLocs[i] = matData[2*i];
1441 }
1442
1443 static double locsDeriv[10000];
1444 static double areaDeriv[10000];
1445
1446 if (sectionIntegr != 0) {
1447 sectionIntegr->getLocationsDeriv(numFibers, locsDeriv);
1448 sectionIntegr->getWeightsDeriv(numFibers, areaDeriv);
1449 }
1450 else {
1451 for (int i = 0; i < numFibers; i++) {
1452 locsDeriv[i] = 0.0;
1453 areaDeriv[i] = 0.0;
1454 }
1455 }
1456
1457 double y;
1458 double kappa = e(1);
1459
1460 for (int i = 0; i < numFibers; i++) {
1461 UniaxialMaterial *theMat = theMaterials[i];
1462 y = fiberLocs[i] - yBar;
1463
1464 // determine material strain and set it
1465 double strainSens = d0 - y*d1 - locsDeriv[i]*kappa;
1466 theMat->commitSensitivity(strainSens,gradIndex,numGrads);
1467 }
1468
1469 return 0;
1470}
1471
1472// AddingSensitivity:END ///////////////////////////////////
1473

Callers

nothing calls this directly

Calls 3

getFiberLocationsMethod · 0.45
getLocationsDerivMethod · 0.45
getWeightsDerivMethod · 0.45

Tested by

no test coverage detected