本文整理汇总了C++中UniaxialMaterial::commitSensitivity方法的典型用法代码示例。如果您正苦于以下问题:C++ UniaxialMaterial::commitSensitivity方法的具体用法?C++ UniaxialMaterial::commitSensitivity怎么用?C++ UniaxialMaterial::commitSensitivity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniaxialMaterial
的用法示例。
在下文中一共展示了UniaxialMaterial::commitSensitivity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Matrix
int
FiberSection3dThermal::commitSensitivity(const Vector& defSens, int gradIndex, int numGrads)
{
// here add SHVs to store the strain sensitivity.
if (SHVs == 0) {
SHVs = new Matrix(3,numGrads);
}
(*SHVs)(0,gradIndex) = defSens(0);
(*SHVs)(1,gradIndex) = defSens(1);
(*SHVs)(2,gradIndex) = defSens(2);
int loc = 0;
double d0 = defSens(0);
double d1 = defSens(1);
double d2 = defSens(2);
for (int i = 0; i < numFibers; i++) {
UniaxialMaterial *theMat = theMaterials[i];
double y = matData[loc++] - yBar;
double z = matData[loc++] - zBar;
loc++; // skip A data.
double strainSens = d0 + y*d1 + z*d2;
theMat->commitSensitivity(strainSens,gradIndex,numGrads);
}
return 0;
}
示例2: defSens
int
FiberSection3d::commitSensitivity(const Vector& defSens, int gradIndex, int numGrads)
{
double d0 = defSens(0);
double d1 = defSens(1);
double d2 = defSens(2);
//dedh = defSens;
static double yLocs[10000];
static double zLocs[10000];
if (sectionIntegr != 0)
sectionIntegr->getFiberLocations(numFibers, yLocs, zLocs);
else {
for (int i = 0; i < numFibers; i++) {
yLocs[i] = matData[3*i];
zLocs[i] = matData[3*i+1];
}
}
static double dydh[10000];
static double dzdh[10000];
if (sectionIntegr != 0)
sectionIntegr->getLocationsDeriv(numFibers, dydh, dzdh);
else {
for (int i = 0; i < numFibers; i++) {
dydh[i] = 0.0;
dzdh[i] = 0.0;
}
}
double y, z;
double depsdh = 0;
for (int i = 0; i < numFibers; i++) {
UniaxialMaterial *theMat = theMaterials[i];
y = yLocs[i] - yBar;
z = zLocs[i] - zBar;
// determine material strain and set it
depsdh = d0 - y*d1 + z*d2 - dydh[i]*e(1) + dzdh[i]*e(2);
theMat->commitSensitivity(depsdh,gradIndex,numGrads);
}
return 0;
}
示例3: defSens
int
FiberSection2d::commitSensitivity(const Vector& defSens,
int gradIndex, int numGrads)
{
double d0 = defSens(0);
double d1 = defSens(1);
dedh = defSens;
static double fiberLocs[10000];
if (sectionIntegr != 0)
sectionIntegr->getFiberLocations(numFibers, fiberLocs);
else {
for (int i = 0; i < numFibers; i++)
fiberLocs[i] = matData[2*i];
}
static double locsDeriv[10000];
static double areaDeriv[10000];
if (sectionIntegr != 0) {
sectionIntegr->getLocationsDeriv(numFibers, locsDeriv);
sectionIntegr->getWeightsDeriv(numFibers, areaDeriv);
}
else {
for (int i = 0; i < numFibers; i++) {
locsDeriv[i] = 0.0;
areaDeriv[i] = 0.0;
}
}
double y;
double kappa = e(1);
for (int i = 0; i < numFibers; i++) {
UniaxialMaterial *theMat = theMaterials[i];
y = fiberLocs[i] - yBar;
// determine material strain and set it
double strainSens = d0 - y*d1 - locsDeriv[i]*kappa;
theMat->commitSensitivity(strainSens,gradIndex,numGrads);
}
return 0;
}