void GradDpElement :: computeStiffnessMatrix_uk(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep) { NLStructuralElement *elem = this->giveNLStructuralElement(); double dV; StructuralCrossSection *cs = elem->giveStructuralCrossSection(); int nlGeo = elem->giveGeometryMode(); FloatArray Nk; FloatMatrix B, SNk, gPSigma; answer.clear(); for ( auto &gp: *elem->giveIntegrationRule(0) ) { GradDpMaterialExtensionInterface *dpmat = dynamic_cast< GradDpMaterialExtensionInterface * >( cs->giveMaterialInterface(GradDpMaterialExtensionInterfaceType, gp) ); if ( !dpmat ) { OOFEM_ERROR("Material doesn't implement the required DpGrad interface!"); } dpmat->givePDGradMatrix_uk(gPSigma, rMode, gp, tStep); this->computeNkappaMatrixAt(gp, Nk); elem->computeBmatrixAt(gp, B); if ( nlGeo == 1 ) { if ( elem->domain->giveEngngModel()->giveFormulation() == AL ) { elem->computeBmatrixAt(gp, B); } else { elem->computeBHmatrixAt(gp, B); } } dV = elem->computeVolumeAround(gp); SNk.beProductOf(gPSigma, Nk); answer.plusProductUnsym(B, SNk, -dV); } }
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 GradDpElement :: computeStiffnessMatrix_kk(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep) { StructuralElement *elem = this->giveStructuralElement(); double dV; FloatMatrix lStiff; FloatArray Nk; FloatMatrix Bk, LBk; StructuralCrossSection *cs = elem->giveStructuralCrossSection(); answer.clear(); for ( auto &gp: *elem->giveIntegrationRule(0) ) { GradDpMaterialExtensionInterface *dpmat = dynamic_cast< GradDpMaterialExtensionInterface * >( cs->giveMaterialInterface(GradDpMaterialExtensionInterfaceType, gp) ); if ( !dpmat ) { OOFEM_ERROR("Material doesn't implement the required DpGrad interface!"); } this->computeNkappaMatrixAt(gp, Nk); this->computeBkappaMatrixAt(gp, Bk); dV = elem->computeVolumeAround(gp); dpmat->givePDGradMatrix_kk(lStiff, rMode, gp, tStep); answer.plusProductUnsym(Nk, Nk, dV); if ( dpmat->giveAveragingType() == 0 || dpmat->giveAveragingType() == 1 ) { double l = lStiff.at(1, 1); answer.plusProductUnsym(Bk, Bk, l * l * dV); } else if ( dpmat->giveAveragingType() == 2 ) { LBk.beProductOf(lStiff, Bk); answer.plusProductUnsym(Bk, LBk, dV); } } }
void LargeStrainMasterMaterialGrad :: giveInternalLength(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) { this->initTempStatus(gp); GradDpMaterialExtensionInterface *graddpmat = dynamic_cast< GradDpMaterialExtensionInterface * >( domain->giveMaterial(slaveMat)->giveInterface(GradDpMaterialExtensionInterfaceType) ); if ( graddpmat == NULL ) { OOFEM_WARNING("material %d has no Structural support", slaveMat); return; } graddpmat->givePDGradMatrix_kk(answer, mode, gp, tStep); }
void GradDpElement :: computeStiffnessMatrix_uu(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep) { NLStructuralElement *elem = this->giveNLStructuralElement(); StructuralCrossSection *cs = elem->giveStructuralCrossSection(); FloatMatrix B, D, DB; int nlGeo = elem->giveGeometryMode(); bool matStiffSymmFlag = elem->giveCrossSection()->isCharacteristicMtrxSymmetric(rMode); answer.clear(); for ( GaussPoint *gp: *elem->giveIntegrationRule(0) ) { GradDpMaterialExtensionInterface *dpmat = dynamic_cast< GradDpMaterialExtensionInterface * >( cs->giveMaterialInterface(GradDpMaterialExtensionInterfaceType, gp) ); if ( !dpmat ) { OOFEM_ERROR("Material doesn't implement the required DpGrad interface!"); } if ( nlGeo == 0 ) { elem->computeBmatrixAt(gp, B); } else if ( nlGeo == 1 ) { if ( elem->domain->giveEngngModel()->giveFormulation() == AL ) { elem->computeBmatrixAt(gp, B); } else { elem->computeBHmatrixAt(gp, B); } } dpmat->givePDGradMatrix_uu(D, rMode, gp, tStep); double dV = elem->computeVolumeAround(gp); DB.beProductOf(D, B); if ( matStiffSymmFlag ) { answer.plusProductSymmUpper(B, DB, dV); } else { answer.plusProductUnsym(B, DB, dV); } } if ( elem->domain->giveEngngModel()->giveFormulation() == AL ) { FloatMatrix initialStressMatrix; elem->computeInitialStressMatrix(initialStressMatrix, tStep); answer.add(initialStressMatrix); } if ( matStiffSymmFlag ) { answer.symmetrized(); } }
void LargeStrainMasterMaterialGrad :: give3dKappaMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) { LargeStrainMasterMaterialStatus *status = static_cast< LargeStrainMasterMaterialStatus * >( this->giveStatus(gp) ); this->initTempStatus(gp); FloatMatrix kappaMatrix; GradDpMaterialExtensionInterface *graddpmat = dynamic_cast< GradDpMaterialExtensionInterface * >( domain->giveMaterial(slaveMat)->giveInterface(GradDpMaterialExtensionInterfaceType) ); if ( graddpmat == NULL ) { OOFEM_WARNING("material %d has no Structural support", slaveMat); return; } graddpmat->givePDGradMatrix_ku(kappaMatrix, mode, gp, tStep); kappaMatrix.at(1, 4) = 2. * kappaMatrix.at(1, 4); kappaMatrix.at(1, 5) = 2. * kappaMatrix.at(1, 5); kappaMatrix.at(1, 6) = 2. * kappaMatrix.at(1, 6); answer.beProductTOf( kappaMatrix, status->givePmatrix() ); }
void LargeStrainMasterMaterialGrad :: give3dGprime(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) { LargeStrainMasterMaterialStatus *status = static_cast< LargeStrainMasterMaterialStatus * >( this->giveStatus(gp) ); this->initTempStatus(gp); FloatMatrix gPrime; GradDpMaterialExtensionInterface *graddpmat = dynamic_cast< GradDpMaterialExtensionInterface * >( domain->giveMaterial(slaveMat)->giveInterface(GradDpMaterialExtensionInterfaceType) ); if ( graddpmat == NULL ) { OOFEM_WARNING("material %d has no Structural support", slaveMat); return; } graddpmat->givePDGradMatrix_uk(gPrime, mode, gp, tStep); gPrime.at(4, 1) = 2. * gPrime.at(4, 1); gPrime.at(5, 1) = 2. * gPrime.at(5, 1); gPrime.at(6, 1) = 2. * gPrime.at(6, 1); answer.beProductOf(status->givePmatrix(), gPrime); }
void GradDpElement :: computeStiffnessMatrix_ku(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep) { double dV; NLStructuralElement *elem = this->giveNLStructuralElement(); FloatArray Nk; FloatMatrix B, DkuB, Dku; StructuralCrossSection *cs = elem->giveStructuralCrossSection(); answer.clear(); int nlGeo = elem->giveGeometryMode(); for ( auto &gp: *elem->giveIntegrationRule(0) ) { GradDpMaterialExtensionInterface *dpmat = dynamic_cast< GradDpMaterialExtensionInterface * >( cs->giveMaterialInterface(GradDpMaterialExtensionInterfaceType, gp) ); if ( !dpmat ) { OOFEM_ERROR("Material doesn't implement the required DpGrad interface!"); } elem->computeBmatrixAt(gp, B); if ( nlGeo == 1 ) { if ( elem->domain->giveEngngModel()->giveFormulation() == AL ) { elem->computeBmatrixAt(gp, B); } else { elem->computeBHmatrixAt(gp, B); } } dpmat->givePDGradMatrix_ku(Dku, rMode, gp, tStep); this->computeNkappaMatrixAt(gp, Nk); dV = elem->computeVolumeAround(gp); DkuB.beProductOf(Dku, B); answer.plusProductUnsym(Nk, DkuB, -dV); if ( dpmat->giveAveragingType() == 2 ) { double dl1, dl2, dl3; FloatArray Gk; FloatMatrix D, DB, LDB; FloatMatrix Bk, BktM22, BktM22Gk, BktM12, BktM12Gk, M22(2, 2), M12(2, 2); FloatMatrix dL1(1, 3), dL2(1, 3), result1, result2, dLdS, n(2, 2); this->computeBkappaMatrixAt(gp, Bk); dpmat->givePDGradMatrix_uu(D, rMode, gp, tStep); dpmat->givePDGradMatrix_LD(dLdS, rMode, gp, tStep); this->computeNonlocalGradient(Gk, gp, tStep); dl1 = dLdS.at(3, 3); dl2 = dLdS.at(4, 4); dl3 = dLdS.at(5, 5); n.at(1, 1) = dLdS.at(1, 1); n.at(1, 2) = dLdS.at(1, 2); n.at(2, 1) = dLdS.at(2, 1); n.at(2, 2) = dLdS.at(2, 2); // first term Bk^T M22 G L1 D B // M22 = n2 \otimes n2 M22.at(1, 1) = n.at(1, 2) * n.at(1, 2); M22.at(1, 2) = n.at(1, 2) * n.at(2, 2); M22.at(2, 1) = n.at(2, 2) * n.at(1, 2); M22.at(2, 2) = n.at(2, 2) * n.at(2, 2); // dL1 dL1.at(1, 1) = dl1 * n.at(1, 1) * n.at(1, 1) + dl2 *n.at(1, 2) * n.at(1, 2); dL1.at(1, 2) = dl1 * n.at(2, 1) * n.at(2, 1) + dl2 *n.at(2, 2) * n.at(2, 2); dL1.at(1, 3) = dl1 * n.at(1, 1) * n.at(2, 1) + dl2 *n.at(1, 2) * n.at(2, 2); DB.beProductOf(D, B); LDB.beProductOf(dL1, DB); BktM22.beTProductOf(Bk, M22); ///@todo This can't possibly work if this is uncommented (!) / Mikael //BktM22Gk.beProductOf(BktM22,Gk); result1.beProductOf(BktM22Gk, LDB); answer.add(dV, result1); // This would be slightly shorter and faster; //GkLDB.beProductOf(Gk, LDB); //MGkLDB.beProductOf(M22, GkLDB); //answer.plusProductUnsym(Bk, MGkLDB, dV); // M12 + M21 = n1 \otimes n2 + n2 \otimes n1 M12.at(1, 1) = n.at(1, 1) * n.at(1, 2) + n.at(1, 2) * n.at(1, 1); M12.at(1, 2) = n.at(1, 1) * n.at(2, 2) + n.at(1, 2) * n.at(2, 1); M12.at(2, 1) = n.at(2, 1) * n.at(1, 2) + n.at(2, 2) * n.at(1, 1); M12.at(2, 2) = n.at(2, 1) * n.at(2, 2) + n.at(2, 2) * n.at(2, 1); //dL2 dL2.at(1, 1) = dl3 * ( n.at(1, 1) * n.at(1, 2) + n.at(1, 1) * n.at(1, 2) ); dL2.at(1, 2) = dl3 * ( n.at(2, 1) * n.at(2, 2) + n.at(2, 1) * n.at(2, 2) ); dL2.at(1, 3) = dl3 * ( n.at(1, 2) * n.at(2, 1) + n.at(1, 1) * n.at(2, 2) ); LDB.beProductOf(dL2, DB); BktM12.beTProductOf(Bk, M12); ///@todo This can't possibly work if this is uncommented (!) / Mikael //BktM12Gk.beProductOf(BktM12,Gk); result2.beProductOf(BktM12Gk, LDB); answer.add(dV, result2); // This would be slightly shorter and faster; //GkLDB.beProductOf(Gk, LDB); //MGkLDB.beProductOf(M12, GkLDB); //answer.plusProductUnsym(Bk, MGkLDB, dV); } } }
void GradDpElement :: computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep) { //set displacement and nonlocal location array this->setDisplacementLocationArray(); this->setNonlocalLocationArray(); NLStructuralElement *elem = this->giveNLStructuralElement(); StructuralCrossSection *cs = elem->giveStructuralCrossSection(); FloatMatrix B, D, DB; FloatMatrix DkuB, Dku; FloatArray Nk; FloatMatrix SNk, gPSigma; FloatMatrix lStiff; FloatMatrix Bk, LBk; FloatMatrix answer_uu, answer_ku, answer_uk, answer_kk; int nlGeo = elem->giveGeometryMode(); bool matStiffSymmFlag = elem->giveCrossSection()->isCharacteristicMtrxSymmetric(rMode); for ( auto &gp : *elem->giveIntegrationRule(0) ) { GradDpMaterialExtensionInterface *dpmat = dynamic_cast< GradDpMaterialExtensionInterface * >( cs->giveMaterialInterface(GradDpMaterialExtensionInterfaceType, gp) ); if ( !dpmat ) { OOFEM_ERROR("Material doesn't implement the required DpGrad interface!"); } double dV = elem->computeVolumeAround(gp); if ( nlGeo == 0 ) { elem->computeBmatrixAt(gp, B); } else if ( nlGeo == 1 ) { if ( elem->domain->giveEngngModel()->giveFormulation() == AL ) { elem->computeBmatrixAt(gp, B); } else { elem->computeBHmatrixAt(gp, B); } } this->computeNkappaMatrixAt(gp, Nk); this->computeBkappaMatrixAt(gp, Bk); dpmat->givePDGradMatrix_uu(D, rMode, gp, tStep); dpmat->givePDGradMatrix_ku(Dku, rMode, gp, tStep); dpmat->givePDGradMatrix_uk(gPSigma, rMode, gp, tStep); dpmat->givePDGradMatrix_kk(lStiff, rMode, gp, tStep); /////////////////////////////////////////////////////////////////// uu: DB.beProductOf(D, B); if ( matStiffSymmFlag ) { answer_uu.plusProductSymmUpper(B, DB, dV); } else { answer_uu.plusProductUnsym(B, DB, dV); } //////////////////////////////////////////////////////////////////////// ku: DkuB.beProductOf(Dku, B); answer_ku.plusProductUnsym(Nk, DkuB, -dV); if ( dpmat->giveAveragingType() == 2 ) { double dl1, dl2, dl3; FloatMatrix LDB; FloatMatrix GkLDB, MGkLDB; FloatMatrix M22, M12; FloatMatrix dL1(1, 3), dL2(1, 3), dLdS; FloatArray Gk, n1, n2; dpmat->givePDGradMatrix_LD(dLdS, rMode, gp, tStep); this->computeNonlocalGradient(Gk, gp, tStep); dl1 = dLdS.at(3, 3); dl2 = dLdS.at(4, 4); dl3 = dLdS.at(5, 5); n1 = {dLdS.at(1, 1), dLdS.at(2, 1)}; n2 = {dLdS.at(1, 2), dLdS.at(2, 2)}; // first term Bk^T M22 G L1 D B // M22 = n2 \otimes n2 M22.plusDyadUnsym(n2, n2, 1.); // dL1 dL1.at(1, 1) = dl1 * n1.at(1) * n1.at(1) + dl2 * n2.at(1) * n2.at(1); dL1.at(1, 2) = dl1 * n1.at(2) * n1.at(2) + dl2 * n2.at(2) * n2.at(2); dL1.at(1, 3) = dl1 * n1.at(1) * n1.at(2) + dl2 * n2.at(1) * n2.at(2); LDB.beProductOf(dL1, DB); GkLDB.beProductOf(Gk, LDB); MGkLDB.beProductOf(M22, GkLDB); answer.plusProductUnsym(Bk, MGkLDB, dV); // M12 + M21 = n1 \otimes n2 + n2 \otimes n1 M12.plusDyadUnsym(n1, n2, 1.); M12.plusDyadUnsym(n2, n1, 1.); //dL2 dL2.at(1, 1) = dl3 * ( n1.at(1) * n2.at(1) + n1.at(1) * n2.at(1) ); dL2.at(1, 2) = dl3 * ( n1.at(2) * n2.at(2) + n1.at(2) * n2.at(2) ); dL2.at(1, 3) = dl3 * ( n1.at(2) * n2.at(1) + n1.at(1) * n2.at(2) ); // Bk * ((M12 * L2 + M22 * L1) * DB) LDB.beProductOf(dL2, DB); GkLDB.beProductOf(Gk, LDB); MGkLDB.beProductOf(M12, GkLDB); answer.plusProductUnsym(Bk, MGkLDB, dV); } //////////////////////////////////////////////////////////////////////// uk: SNk.beProductOf(gPSigma, Nk); answer_uk.plusProductUnsym(B, SNk, -dV); // uk /////////////////////////////////////////////////////////////////////// kk: answer_kk.plusProductUnsym(Nk, Nk, dV); if ( dpmat->giveAveragingType() == 0 || dpmat->giveAveragingType() == 1 ) { double l = lStiff.at(1, 1); answer_kk.plusProductUnsym(Bk, Bk, l * l * dV); } else if ( dpmat->giveAveragingType() == 2 ) { LBk.beProductOf(lStiff, Bk); answer_kk.plusProductUnsym(Bk, LBk, dV); } } if ( elem->domain->giveEngngModel()->giveFormulation() == AL ) { FloatMatrix initialStressMatrix; elem->computeInitialStressMatrix(initialStressMatrix, tStep); answer_uu.add(initialStressMatrix); } if ( matStiffSymmFlag ) { answer_uu.symmetrized(); } answer.resize(totalSize, totalSize); answer.zero(); answer.assemble(answer_uu, locU); answer.assemble(answer_uk, locU, locK); answer.assemble(answer_ku, locK, locU); answer.assemble(answer_kk,locK); }
void GradDpElement :: giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord) { NLStructuralElement *elem = this->giveNLStructuralElement(); StructuralCrossSection *cs = elem->giveStructuralCrossSection(); FloatArray answerU, answerK; double localCumulatedStrain = 0.; FloatMatrix stiffKappa, B; FloatArray Nk, aux, dKappa, stress; FloatMatrix lStiff; FloatMatrix Bk; FloatArray gKappa, L_gKappa; //set displacement and nonlocal location array this->setDisplacementLocationArray(); this->setNonlocalLocationArray(); this->computeNonlocalDegreesOfFreedom(dKappa, tStep); int nlGeo = elem->giveGeometryMode(); for ( auto &gp: *elem->giveIntegrationRule(0) ) { GradDpMaterialExtensionInterface *dpmat = dynamic_cast< GradDpMaterialExtensionInterface * >( cs->giveMaterialInterface(GradDpMaterialExtensionInterfaceType, gp) ); if ( !dpmat ) { OOFEM_ERROR("Material doesn't implement the required DpGrad interface!"); } double dV = elem->computeVolumeAround(gp); if ( nlGeo == 0 || elem->domain->giveEngngModel()->giveFormulation() == AL ) { elem->computeBmatrixAt(gp, B); } else if ( nlGeo == 1 ) { elem->computeBHmatrixAt(gp, B); } this->computeStressVectorAndLocalCumulatedStrain(stress, localCumulatedStrain, gp, tStep); answerU.plusProduct(B, stress, dV); // Gradient part: this->computeNkappaMatrixAt(gp, Nk); this->computeBkappaMatrixAt(gp, Bk); dpmat->givePDGradMatrix_kk(lStiff, TangentStiffness, gp, tStep); double kappa = Nk.dotProduct(dKappa); gKappa.beProductOf(Bk, dKappa); answerK.add(-dV * localCumulatedStrain, Nk); answerK.add(kappa * dV, Nk); if ( dpmat->giveAveragingType() == 0 || dpmat->giveAveragingType() == 1 ) { double l = lStiff.at(1, 1); answerK.plusProduct(Bk, gKappa, l * l * dV); } else if ( dpmat->giveAveragingType() == 2 ) { L_gKappa.beProductOf(lStiff, gKappa); answerK.plusProduct(Bk, L_gKappa, dV); } } //this->computeStiffnessMatrix_kk(stiffKappa, TangentStiffness, tStep); //answerK.beProductOf(stiffKappa, dKappa); answerK.add(aux); answer.resize(totalSize); answer.zero(); answer.assemble(answerU, locU); answer.assemble(answerK, locK); }
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."); } }