本文整理汇总了C++中StructuralMaterial::giveStressStrainMask方法的典型用法代码示例。如果您正苦于以下问题:C++ StructuralMaterial::giveStressStrainMask方法的具体用法?C++ StructuralMaterial::giveStressStrainMask怎么用?C++ StructuralMaterial::giveStressStrainMask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StructuralMaterial
的用法示例。
在下文中一共展示了StructuralMaterial::giveStressStrainMask方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: giveReducedCharacteristicVector
void
SimpleCrossSection :: giveReducedCharacteristicVector(FloatArray &answer, GaussPoint *gp,
const FloatArray &charVector3d)
//
// returns reduced stressVector or strainVector from full 3d vector reduced
// to vector required by gp->giveStressStrainMode()
//
{
MaterialMode mode = gp->giveMaterialMode();
StructuralMaterial *mat = static_cast< StructuralMaterial * >( gp->giveElement()->giveMaterial() );
IntArray indx;
int size = charVector3d.giveSize();
int i, j;
if ( ( mode == _3dShell ) || ( mode == _3dBeam ) || ( mode == _2dPlate ) || ( mode == _2dBeam ) ) {
if ( size != 12 ) {
OOFEM_ERROR("SimpleCrossSection :: giveReducedCharacteristicVector - charVector3d size mismatch");
}
mat->giveStressStrainMask( indx, ReducedForm, gp->giveMaterialMode() );
answer.resize( indx.giveSize() );
answer.zero();
for ( i = 1; i <= indx.giveSize(); i++ ) {
if ( ( j = indx.at(i) ) ) {
answer.at(i) = charVector3d.at(j);
}
}
return;
} else if ( mode == _3dBeam ) {
if ( size != 6 ) {
OOFEM_ERROR("SimpleCrossSection :: giveReducedCharacteristicVector - charVector3d size mismatch");
}
answer = charVector3d;
return;
} else if ( mode == _PlaneStressRot ) {
if ( size != 7 ) {
OOFEM_ERROR("SimpleCrossSection :: giveReducedCharacteristicVector - charVector3d size mismatch");
}
mat->giveStressStrainMask( indx, ReducedForm, gp->giveMaterialMode() );
answer.resize( indx.giveSize() );
answer.zero();
for ( i = 1; i <= indx.giveSize(); i++ ) {
if ( ( j = indx.at(i) ) ) {
answer.at(i) = charVector3d.at(j);
}
}
return;
} else {
StructuralCrossSection :: giveReducedCharacteristicVector(answer, gp, charVector3d);
return;
}
}
示例2: giveFullCharacteristicVector
void
SimpleCrossSection :: giveFullCharacteristicVector(FloatArray &answer,
GaussPoint *gp,
const FloatArray &strainVector)
//
// returns full 3d strain vector from strainVector in reducedMode
// based on StressStrainMode in gp
// strainVector {eps_x,eps_y,eps_z,gamma_yz,gamma_zx,gamma_xy}
//
// enhaced method in order to support cases with integral bending (2dplate, 3dshell..)
// in such cases full strain vector has the form:
// strainVectorShell {eps_x,eps_y,eps_z,gamma_yz,gamma_zx,gamma_xy, kappa_x,kappa_y,kappa_y,kappa_yz,kappa_xz,kappa_xy}
//
// enhanced method in order to support 3dbeam elements
// in such cases full strain vector has the form:
// strainVector {eps_x, gamma_xz, gamma_xy, \der{phi_x}{x}, kappa_y, kappa_z}
//
// enhance support also for PlaneStressRot case with full strain vector of form
// {eps_x,eps_y,eps_z,gamma_yz,gamma_zx,gamma_xy,(omega_xy-(dv/dx-du/dy)*0.5)}
//
//
{
MaterialMode mode = gp->giveMaterialMode();
StructuralMaterial *mat = static_cast< StructuralMaterial * >( gp->giveMaterial() );
IntArray indx;
int i, j, answerSize = 0;
//if (mode == _3dShell) {answer = strainVector; return ;}
//if (mode == _3dBeam) {answer = strainVector; return ;}
if ( ( mode == _3dShell ) || ( mode == _3dBeam ) || ( mode == _2dPlate ) || ( mode == _2dBeam ) || ( mode == _PlaneStressRot ) ||(mode == _3dMatGrad)||(mode == _1dMatGrad)||(mode == _PlaneStrainGrad)||(mode == _PlaneStressGrad) ) {
if ( ( mode == _3dShell ) || ( mode == _3dBeam ) || ( mode == _2dPlate ) || ( mode == _2dBeam ) ) {
answerSize = 12;
}
if ( mode == _PlaneStressRot || (mode == _3dMatGrad) || (mode == _1dMatGrad) || (mode == _PlaneStrainGrad) || (mode == _PlaneStressGrad) ) {
answerSize = 7;
}
answer.resize(answerSize);
answer.zero();
mat->giveStressStrainMask( indx, ReducedForm, gp->giveMaterialMode() );
for ( i = 1; i <= indx.giveSize(); i++ ) {
if ( ( j = indx.at(i) ) ) {
answer.at(j) = strainVector.at(i);
}
}
return;
} else {
StructuralCrossSection :: giveFullCharacteristicVector(answer, gp, strainVector);
return;
}
}