本文整理汇总了C++中UniaxialMaterial::getVariable方法的典型用法代码示例。如果您正苦于以下问题:C++ UniaxialMaterial::getVariable方法的具体用法?C++ UniaxialMaterial::getVariable怎么用?C++ UniaxialMaterial::getVariable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniaxialMaterial
的用法示例。
在下文中一共展示了UniaxialMaterial::getVariable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
opserr<<"WARNING: FiberSection3dThermal failed to find the fiber with locy: "<<yi <<" , locZ: "<<zi <<endln;
}
else if (zi<= dataTempe[15]){
FiberTemperature = dataTempe[10] - (dataTempe[10] - dataTempe[13])*(dataTempe[12] - zi) /(dataTempe[12] - dataTempe[15]);
}
else if (zi<= dataTempe[18]){
FiberTemperature = dataTempe[13] - (dataTempe[13] - dataTempe[16])*(dataTempe[15] - zi) /(dataTempe[15] - dataTempe[18]);
}
else if (zi<= dataTempe[21]){
FiberTemperature = dataTempe[16] - (dataTempe[16] - dataTempe[19])*(dataTempe[18] - zi) /(dataTempe[18] - dataTempe[21]);
}
else if (zi<= dataTempe[24]){
FiberTemperature = dataTempe[19] - (dataTempe[19] - dataTempe[22])*(dataTempe[21] - zi) /(dataTempe[21] - dataTempe[24]);
}
else {
opserr<<"WARNING: FiberSection3dThermal failed to find the fiber with locy: "<<yi <<" , locZ: "<<zi <<endln;
}
}
else if (yi <= dataTempe[3])
{
FiberTemperature = dataTempe[0] - (dataTempe[1] - yi) * (dataTempe[0] - dataTempe[2])/(dataTempe[1] - dataTempe[3]);
}
else if ( yi <= dataTempe[5] )
{
FiberTemperature = dataTempe[2] - (dataTempe[3] - yi) * (dataTempe[2] - dataTempe[4])/(dataTempe[3] - dataTempe[5]);
}
else if ( yi <= dataTempe[7] )
{
FiberTemperature = dataTempe[4] - (dataTempe[5] - yi) * (dataTempe[4] - dataTempe[6])/(dataTempe[5] - dataTempe[7]);
}
else if ( yi <= dataTempe[9] )
{
FiberTemperature = dataTempe[6] - (dataTempe[7] - yi) * (dataTempe[6] - dataTempe[8])/(dataTempe[7] - dataTempe[9]);
}
else {
if (zi <= dataTempe[12]){
opserr<<"WARNING: FiberSection3dThermal failed to find the fiber with locy: "<<yi <<" , locZ: "<<zi <<endln;
}
else if (zi<= dataTempe[15]){
FiberTemperature = dataTempe[11] - (dataTempe[11] - dataTempe[14])*(dataTempe[12] - zi) /(dataTempe[12] - dataTempe[15]);
}
else if (zi<= dataTempe[18]){
FiberTemperature = dataTempe[14] - (dataTempe[14] - dataTempe[17])*(dataTempe[15] - zi) /(dataTempe[15] - dataTempe[18]);
}
else if (zi<= dataTempe[21]){
FiberTemperature = dataTempe[17] - (dataTempe[17] - dataTempe[20])*(dataTempe[18] - zi) /(dataTempe[18] - dataTempe[21]);
}
else if (zi<= dataTempe[24]){
FiberTemperature = dataTempe[20] - (dataTempe[20] - dataTempe[23])*(dataTempe[21] - zi) /(dataTempe[21] - dataTempe[24]);
}
else {
opserr<<"WARNING: FiberSection3dThermal failed to find the fiber with locy: "<<yi <<" , locZ: "<<zi <<endln;
}
}
}
// determine material strain and set it
double tangent =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();
FiberTemperature = tData(0);
tangent = tData(1);
ThermalElongation = tData(2);
FiberTempMax = tData(3);
// double strain = -ThermalElongation;
// theMat->setTrialTemperature(strain, FiberTemperature, stress, tangent, ThermalElongation);
Fiber_T[i] = FiberTemperature;
Fiber_TMax[i] = FiberTempMax;
ThermalTangent[i] = tangent;
ThermalElong[i] = ThermalElongation;
}
// calculate section resisting force due to thermal load
double FiberForce;
double SectionArea = 0;
double ThermalElongMoment = 0;
for (int i = 0; i < numFibers; i++) {
FiberForce = ThermalTangent[i]*matData[3*i+2]*ThermalElong[i];
sTData[0] += FiberForce;
sTData[1] += FiberForce*(matData[3*i] - yBar);
sTData[2] += FiberForce*(matData[3*i+1] - zBar);
SectionArea += matData[3*i+2];
//need to be revised by neallee
ThermalElongMoment += ThermalElong[i] * matData[3 * i + 2];
}
double ThermalMoment;
ThermalMoment = abs(sTData[1]);
// sTData[1] = ThermalMoment;
AverageThermalElong = ThermalElongMoment / SectionArea;
return *sT;
}
示例2: 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;
}