本文整理汇总了C++中UniaxialMaterial::revertToLastCommit方法的典型用法代码示例。如果您正苦于以下问题:C++ UniaxialMaterial::revertToLastCommit方法的具体用法?C++ UniaxialMaterial::revertToLastCommit怎么用?C++ UniaxialMaterial::revertToLastCommit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniaxialMaterial
的用法示例。
在下文中一共展示了UniaxialMaterial::revertToLastCommit方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OPS_InvokeMaterialObject
static
void OPS_InvokeMaterialObject(struct matObject *theMat, modelState *theModel,double *strain, double *tang, double *stress, int *isw, int *result)
{
int matType = theMat->theParam[0];
if (matType == 1) {
// UniaxialMaterial *theMaterial = theUniaxialMaterials[matCount];
UniaxialMaterial *theMaterial = (UniaxialMaterial *)theMat->matObjectPtr;
if (theMaterial == 0) {
*result = -1;
return;
}
if (*isw == ISW_COMMIT) {
*result = theMaterial->commitState();
return;
} else if (*isw == ISW_REVERT) {
*result = theMaterial->revertToLastCommit();
return;
} else if (*isw == ISW_REVERT_TO_START) {
*result = theMaterial->revertToStart();
return;
} else if (*isw == ISW_FORM_TANG_AND_RESID) {
double matStress = 0.0;
double matTangent = 0.0;
int res = theMaterial->setTrial(strain[0], matStress, matTangent);
stress[0] = matStress;
tang[0] = matTangent;
*result = res;
return;
}
}
return;
}
示例2:
int
FiberSection3dThermal::revertToLastCommit(void)
{
int err = 0;
// Last committed section deformations
e = eCommit;
kData[0] = 0.0; kData[1] = 0.0; kData[2] = 0.0; kData[3] = 0.0;
kData[4] = 0.0; kData[5] = 0.0; kData[6] = 0.0; kData[7] = 0.0;
kData[8] = 0.0;
sData[0] = 0.0; sData[1] = 0.0; sData[2] = 0.0;
int loc = 0;
for (int i = 0; i < numFibers; i++) {
UniaxialMaterial *theMat = theMaterials[i];
double y = matData[loc++] - yBar;
double z = matData[loc++] - zBar;
double A = matData[loc++];
// invoke revertToLast on the material
err += theMat->revertToLastCommit();
double tangent = theMat->getTangent();
double stress = theMat->getStress();
double value = tangent * A;
double vas1 = y*value;
double vas2 = z*value;
double vas1as2 = vas1*z;
kData[0] += value;
kData[1] += vas1;
kData[2] += vas2;
kData[4] += vas1 * y;
kData[5] += vas1as2;
kData[8] += vas2 * z;
double fs0 = stress * A;
sData[0] += fs0;
sData[1] += fs0 * y;
sData[2] += fs0 * z;
}
kData[3] = kData[1];
kData[6] = kData[2];
kData[7] = kData[5];
return err;
}
示例3:
int
FiberSection2d::revertToLastCommit(void)
{
int err = 0;
// Last committed section deformations
e = eCommit;
kData[0] = 0.0; kData[1] = 0.0; kData[2] = 0.0; kData[3] = 0.0;
sData[0] = 0.0; sData[1] = 0.0;
static double fiberLocs[10000];
static double fiberArea[10000];
if (sectionIntegr != 0) {
sectionIntegr->getFiberLocations(numFibers, fiberLocs);
sectionIntegr->getFiberWeights(numFibers, fiberArea);
}
else {
for (int i = 0; i < numFibers; i++) {
fiberLocs[i] = matData[2*i];
fiberArea[i] = matData[2*i+1];
}
}
for (int i = 0; i < numFibers; i++) {
UniaxialMaterial *theMat = theMaterials[i];
double y = fiberLocs[i] - yBar;
double A = fiberArea[i];
// invoke revertToLast on the material
err += theMat->revertToLastCommit();
// get material stress & tangent for this strain and determine ks and fs
double tangent = theMat->getTangent();
double stress = theMat->getStress();
double ks0 = tangent * A;
double ks1 = ks0 * -y;
kData[0] += ks0;
kData[1] += ks1;
kData[3] += ks1 * -y;
double fs0 = stress * A;
sData[0] = fs0;
sData[1] = fs0 * -y;
}
kData[2] = kData[1];
return err;
}
示例4: ks
int
RCFTSTLFiberSection3D::revertToLastCommit(void)
{
int err = 0;
// Last committed section deformations
e = eCommit;
kData[0] = 0.0; kData[1] = 0.0; kData[2] = 0.0;
kData[3] = 0.0; kData[4] = 0.0; kData[5] = 0.0;
kData[6] = 0.0; kData[7] = 0.0; kData[8] = 0.0;
kData[9] = 0.0; kData[10] = 0.0; kData[11] = 0.0;
kData[12] = 0.0; kData[13] = 0.0; kData[14] = 0.0;
kData[15] = 0.0;
sData[0] = 0.0; sData[1] = 0.0; sData[2] = 0.0;
int loc = 0;
for (int i = 0; i < numFibers; i++) {
UniaxialMaterial *theMat = theMaterials[i];
double y = matData[loc++] - yBar;
double z = matData[loc++] - zBar;
double A = matData[loc++];
// invoke revertToLast on the material
err += theMat->revertToLastCommit();
double tangent = theMat->getTangent();
double stress = theMat->getStress();
double value = tangent * A;
double vas1 = y*value;
double vas2 = z*value;
double vas1as2 = vas1*z;
double vas2as2 = vas2*z;
double vas1as1 = vas1*y;
kData[0] += value;
kData[1] -= vas1;
kData[2] -= vas2;
kData[3] = 0.0;
kData[4] -= vas1;
kData[5] += vas1as1;
kData[6] += vas1as2;
kData[7] = 0.0;
kData[8] -= vas2;
kData[9] += vas1as2;
kData[10]+= vas2as2;
kData[11] = 0.0;
kData[12] = 0.0;
kData[13] = 0.0;
kData[14] = 0.0;
kData[15] = GJ;
double fs0 = stress * A;
sData[0] += fs0;
sData[1] -= fs0 * y;
sData[2] -= fs0 * z;
}
ks(0,0) = kData[0];
ks(0,1) = ks(1,0) = kData[1];
ks(0,2) = ks(2,0) = kData[2];
ks(1,1) = kData[5];
ks(1,2) = ks(2,1) = kData[6];
ks(2,2) = kData[10];
ks(3,3) = GJ;
return err;
}
示例5:
int
FiberSection3d::revertToLastCommit(void)
{
int err = 0;
kData[0] = 0.0; kData[1] = 0.0; kData[2] = 0.0; kData[3] = 0.0;
kData[4] = 0.0; kData[5] = 0.0; kData[6] = 0.0; kData[7] = 0.0;
kData[8] = 0.0;
sData[0] = 0.0; sData[1] = 0.0; sData[2] = 0.0;
static double yLocs[10000];
static double zLocs[10000];
static double fiberArea[10000];
if (sectionIntegr != 0) {
sectionIntegr->getFiberLocations(numFibers, yLocs, zLocs);
sectionIntegr->getFiberWeights(numFibers, fiberArea);
}
else {
for (int i = 0; i < numFibers; i++) {
yLocs[i] = matData[3*i];
zLocs[i] = matData[3*i+1];
fiberArea[i] = matData[3*i+2];
}
}
for (int i = 0; i < numFibers; i++) {
UniaxialMaterial *theMat = theMaterials[i];
double y = yLocs[i] - yBar;
double z = zLocs[i] - zBar;
double A = fiberArea[i];
// invoke revertToLast on the material
err += theMat->revertToLastCommit();
double tangent = theMat->getTangent();
double stress = theMat->getStress();
double value = tangent * A;
double vas1 = -y*value;
double vas2 = z*value;
double vas1as2 = vas1*z;
kData[0] += value;
kData[1] += vas1;
kData[2] += vas2;
kData[4] += vas1 * -y;
kData[5] += vas1as2;
kData[8] += vas2 * z;
double fs0 = stress * A;
sData[0] += fs0;
sData[1] += fs0 * -y;
sData[2] += fs0 * z;
}
kData[3] = kData[1];
kData[6] = kData[2];
kData[7] = kData[5];
return err;
}