void GradDpElement :: computeStressVectorAndLocalCumulatedStrain(FloatArray &answer, double localCumulatedStrain, GaussPoint *gp, TimeStep *tStep) { NLStructuralElement *elem = this->giveNLStructuralElement(); double nlCumulatedStrain; int nlGeo = elem->giveGeometryMode(); StructuralCrossSection *cs = elem->giveStructuralCrossSection(); GradDpMaterialExtensionInterface *dpmat = static_cast< GradDpMaterialExtensionInterface * >( cs->giveMaterialInterface(GradDpMaterialExtensionInterfaceType, gp) ); if ( !dpmat ) { OOFEM_ERROR("Material doesn't implement the required DpGrad interface!"); } this->computeNonlocalCumulatedStrain(nlCumulatedStrain, gp, tStep); if ( nlGeo == 0 ) { FloatArray Epsilon; this->computeLocalStrainVector(Epsilon, gp, tStep); dpmat->giveRealStressVectorGrad(answer, localCumulatedStrain, gp, Epsilon, nlCumulatedStrain, tStep); } else if ( nlGeo == 1 ) { if ( elem->giveDomain()->giveEngngModel()->giveFormulation() == TL ) { FloatArray vF; this->computeDeformationGradientVector(vF, gp, tStep); dpmat->giveFirstPKStressVectorGrad(answer, localCumulatedStrain, gp, vF, nlCumulatedStrain, tStep); } else { FloatArray vF; this->computeDeformationGradientVector(vF, gp, tStep); dpmat->giveCauchyStressVectorGrad(answer, localCumulatedStrain, gp, vF, nlCumulatedStrain, tStep); } } }
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."); } }