本文整理汇总了C++中StructuralMaterial::giveInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ StructuralMaterial::giveInterface方法的具体用法?C++ StructuralMaterial::giveInterface怎么用?C++ StructuralMaterial::giveInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StructuralMaterial
的用法示例。
在下文中一共展示了StructuralMaterial::giveInterface方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: giveFirstPKStressVectorGrad
void
LargeStrainMasterMaterialGrad :: giveFirstPKStressVectorGrad(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &vF, double nonlocalCumulatedStrain, TimeStep *tStep)
{
LargeStrainMasterMaterialStatus *status = static_cast< LargeStrainMasterMaterialStatus * >( this->giveStatus(gp) );
this->initTempStatus(gp);
MaterialMode mode = gp->giveMaterialMode();
if ( mode == _3dMat ) {
Material *mat;
StructuralMaterial *sMat;
mat = domain->giveMaterial(slaveMat);
sMat = dynamic_cast< StructuralMaterial * >(mat);
if ( sMat == NULL ) {
OOFEM_WARNING("material %d has no Structural support", slaveMat);
return;
}
GradDpMaterialExtensionInterface *dpmat = static_cast< GradDpMaterialExtensionInterface * >( sMat->giveInterface(GradDpMaterialExtensionInterfaceType) );
if ( !dpmat ) {
OOFEM_ERROR("Material doesn't implement the required DpGrad interface!");
}
double lambda1, lambda2, lambda3, E1, E2, E3;
FloatArray eVals, SethHillStrainVector, stressVector, stressM;
FloatMatrix F, C, eVecs, SethHillStrain;
FloatMatrix L1, L2, T;
//store of deformation gradient into 3x3 matrix
F.beMatrixForm(vF);
//compute right Cauchy-Green tensor(C), its eigenvalues and eigenvectors
C.beTProductOf(F, F);
// compute eigen values and eigen vectors of C
C.jaco_(eVals, eVecs, 40);
// compute Seth - Hill's strain measure, it depends on mParameter
lambda1 = eVals.at(1);
lambda2 = eVals.at(2);
lambda3 = eVals.at(3);
if ( m == 0 ) {
E1 = 1. / 2. * log(lambda1);
E2 = 1. / 2. * log(lambda2);
E3 = 1. / 2. * log(lambda3);
} else {
E1 = 1. / ( 2. * m ) * ( pow(lambda1, m) - 1. );
E2 = 1. / ( 2. * m ) * ( pow(lambda2, m) - 1. );
E3 = 1. / ( 2. * m ) * ( pow(lambda3, m) - 1. );
}
SethHillStrain.resize(3, 3);
for ( int i = 1; i < 4; i++ ) {
for ( int j = 1; j < 4; j++ ) {
SethHillStrain.at(i, j) = E1 * eVecs.at(i, 1) * eVecs.at(j, 1) + E2 *eVecs.at(i, 2) * eVecs.at(j, 2) + E3 *eVecs.at(i, 3) * eVecs.at(j, 3);
}
}
SethHillStrainVector.beSymVectorFormOfStrain(SethHillStrain);
dpmat->giveRealStressVectorGrad(stressVector, answer2, gp, SethHillStrainVector, nonlocalCumulatedStrain, tStep);
this->constructTransformationMatrix(T, eVecs);
stressVector.at(4) = 2 * stressVector.at(4);
stressVector.at(5) = 2 * stressVector.at(5);
stressVector.at(6) = 2 * stressVector.at(6);
stressM.beProductOf(T, stressVector);
stressM.at(4) = 1. / 2. * stressM.at(4);
stressM.at(5) = 1. / 2. * stressM.at(5);
stressM.at(6) = 1. / 2. * stressM.at(6);
this->constructL1L2TransformationMatrices(L1, L2, eVals, stressM, E1, E2, E3);
FloatMatrix junk, P, TL;
FloatArray secondPK;
junk.beProductOf(L1, T);
P.beTProductOf(T, junk);
//transformation of the stress to the 2PK stress and then to 1PK
stressVector.at(4) = 0.5 * stressVector.at(4);
stressVector.at(5) = 0.5 * stressVector.at(5);
stressVector.at(6) = 0.5 * stressVector.at(6);
secondPK.beProductOf(P, stressVector);
answer1.beProductOf(F, secondPK); // P = F*S
junk.zero();
junk.beProductOf(L2, T);
TL.beTProductOf(T, junk);
status->setPmatrix(P);
status->setTLmatrix(TL);
status->letTempStressVectorBe(answer1);
} else {
OOFEM_ERROR("Unknown material mode.");
}
}