本文整理汇总了C++中UniaxialMaterial::setTrial方法的典型用法代码示例。如果您正苦于以下问题:C++ UniaxialMaterial::setTrial方法的具体用法?C++ UniaxialMaterial::setTrial怎么用?C++ UniaxialMaterial::setTrial使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniaxialMaterial
的用法示例。
在下文中一共展示了UniaxialMaterial::setTrial方法的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: deforms
int
FiberSection2d::setTrialSectionDeformation (const Vector &deforms)
{
int res = 0;
e = deforms;
kData[0] = 0.0; kData[1] = 0.0; kData[2] = 0.0; kData[3] = 0.0;
sData[0] = 0.0; sData[1] = 0.0;
double d0 = deforms(0);
double d1 = deforms(1);
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];
// determine material strain and set it
double strain = d0 - y*d1;
double tangent, stress;
res += theMat->setTrial(strain, stress, tangent);
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 res;
}
示例3: deforms
int
FiberSection3d::setTrialSectionDeformation (const Vector &deforms)
{
int res = 0;
e = deforms;
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;
double d0 = deforms(0);
double d1 = deforms(1);
double d2 = deforms(2);
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];
// determine material strain and set it
double strain = d0 - y*d1 + z*d2;
double tangent, stress;
res += theMat->setTrial(strain, stress, tangent);
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 res;
}
示例4: deforms
int
RCFTSTLFiberSection3D::setTrialSectionDeformation (const Vector &deforms)
{
int res = 0;
e = deforms;
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;
double d0 = deforms(0);
double d1 = deforms(1);
double d2 = deforms(2);
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++];
// determine material strain and set it
double strain = d0 - y*d1 - z*d2;
double tangent, stress;
res = theMat->setTrial(strain, stress, tangent);
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;
//kData[0] = 449602.6;
//kData[5] = 6968845.86;
//kData[10] = 6968845.86;
//ks(0,0) = 449602.6;
//ks(0,1) = ks(1,0) = 0.0;
//ks(0,2) = ks(2,0) = 0.0;
//ks(1,1) = 6968845.86;
//ks(1,2) = ks(2,1) = 0.0;
//ks(2,2) = 6968845.86;
//ks(3,3) = GJ;
//kData[0] = 1000.0;
//kData[5] = 1.0;
//kData[10] = 1.0;
//ks(0,0) = 1000.0;
//ks(0,1) = ks(1,0) = 0.0;
//ks(0,2) = ks(2,0) = 0.0;
//ks(1,1) = 1.0;
//ks(1,2) = ks(2,1) = 0.0;
//ks(2,2) = 1.0;
//ks(3,3) = GJ;
//kData[0] = 43200000.0;
//kData[5] = 14400000.0;
//kData[10] = 14400000.0;
//ks(0,0) = 43200000.0;
//ks(0,1) = ks(1,0) = 0.0;
//ks(0,2) = ks(2,0) = 0.0;
//ks(1,1) = 14400000.0;
//.........这里部分代码省略.........
示例5: tData
int
FiberSection3dThermal::setTrialSectionDeformation (const Vector &deforms)
{
int res = 0;
e = deforms;
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;
double d0 = deforms(0);
double d1 = deforms(1);
double d2 = deforms(2);
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++];
double FiberTemperature = Fiber_T[i]; //Added by Liming to obtain fiber T;
double FiberTempMax= Fiber_TMax[i]; //Maximum Temp;
int jy;
int jz;
jy = i*3; //retrieve temp along y
jz = i*3+1; //retrieve temp along z
double yi;
double zi;
yi = matData[jy];
zi = matData[jz];
//---Calculating the Fiber Temperature---end
double strain = d0 + y*d1 + z*d2; //axial strain d0, rotational degree d1,d2;
double tangent =0.0;
double stress = 0.0;
double ThermalElongation = 0.0;
static Vector tData(4);
static Information iData(tData);
tData(0) = FiberTemperature;
tData(1) = tangent;
tData(2) = ThermalElongation;
tData(3) = FiberTempMax;
iData.setVector(tData);
theMat->getVariable("ElongTangent", iData);
tData = iData.getData();
tangent = tData(1);
ThermalElongation = tData(2);
// determine material strain and set it
strain = d0 + y*d1 + z*d2 - ThermalElongation;
res += theMat->setTrial(strain, FiberTemperature, stress, tangent, ThermalElongation);
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 res;
}