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

Method commitSensitivity

SRC/material/section/FiberSection2dThermal.cpp:1374–1419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1372}
1373
1374int
1375FiberSection2dThermal::commitSensitivity(const Vector& defSens,
1376 int gradIndex, int numGrads)
1377{
1378 double d0 = defSens(0);
1379 double d1 = defSens(1);
1380
1381 dedh = defSens;
1382
1383 double fiberLocs[10000];
1384
1385 if (sectionIntegr != 0)
1386 sectionIntegr->getFiberLocations(numFibers, fiberLocs);
1387 else {
1388 for (int i = 0; i < numFibers; i++)
1389 fiberLocs[i] = matData[2*i];
1390 }
1391
1392 double locsDeriv[10000];
1393 double areaDeriv[10000];
1394
1395 if (sectionIntegr != 0) {
1396 sectionIntegr->getLocationsDeriv(numFibers, locsDeriv);
1397 sectionIntegr->getWeightsDeriv(numFibers, areaDeriv);
1398 }
1399 else {
1400 for (int i = 0; i < numFibers; i++) {
1401 locsDeriv[i] = 0.0;
1402 areaDeriv[i] = 0.0;
1403 }
1404 }
1405
1406 double y;
1407 double kappa = e(1);
1408
1409 for (int i = 0; i < numFibers; i++) {
1410 UniaxialMaterial *theMat = theMaterials[i];
1411 y = fiberLocs[i] - yBar;
1412
1413 // determine material strain and set it
1414 double strainSens = d0 - y*d1 - locsDeriv[i]*kappa;
1415 theMat->commitSensitivity(strainSens,gradIndex,numGrads);
1416 }
1417
1418 return 0;
1419}
1420
1421// AddingSensitivity:END ///////////////////////////////////
1422

Callers

nothing calls this directly

Calls 3

getFiberLocationsMethod · 0.45
getLocationsDerivMethod · 0.45
getWeightsDerivMethod · 0.45

Tested by

no test coverage detected