void IDGMaterial :: giveRealStressVectorGrad(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &totalStrain, double nonlocalCumulatedStrain, TimeStep *tStep) // // returns real stress vector in 3d stress space of receiver according to // previous level of stress and current // strain increment, the only way, how to correctly update gp records // { IDGMaterialStatus *status = static_cast< IDGMaterialStatus * >( this->giveStatus(gp) ); LinearElasticMaterial *lmat = this->giveLinearElasticMaterial(); FloatArray reducedTotalStrainVector, strain; FloatMatrix de; double f, equivStrain, tempKappa = 0.0, omega = 0.0; this->initTempStatus(gp); // subtract stress independent part // note: eigenStrains (temperature) is not contained in mechanical strain stored in gp // therefore it is necessary to subtract always the total eigen strain value this->giveStressDependentPartOfStrainVector(reducedTotalStrainVector, gp, totalStrain, tStep, VM_Total); // compute equivalent strain this->computeEquivalentStrain(equivStrain, reducedTotalStrainVector, gp, tStep); if ( llcriteria == idm_strainLevelCR ) { // compute value of loading function if strainLevel crit apply f = nonlocalCumulatedStrain - status->giveKappa(); if ( f <= 0.0 ) { // damage does not grow tempKappa = status->giveKappa(); omega = status->giveDamage(); } else { // damage grow this->initDamaged(tempKappa, reducedTotalStrainVector, gp); // evaluate damage parameter this->computeDamageParam(omega, nonlocalCumulatedStrain, reducedTotalStrainVector, gp); } } else if ( llcriteria == idm_damageLevelCR ) { // evaluate damage parameter first tempKappa = nonlocalCumulatedStrain; this->initDamaged(tempKappa, strain, gp); this->computeDamageParam(omega, tempKappa, reducedTotalStrainVector, gp); if ( omega < status->giveDamage() ) { // unloading takes place omega = status->giveDamage(); //printf ("."); } } else { OOFEM_ERROR("unsupported loading/uloading criteria"); } lmat->giveStiffnessMatrix(de, SecantStiffness, gp, tStep); de.times(1.0 - omega); answer1.beProductOf(de, strain); answer2 = equivStrain; // update gp status->letTempStrainVectorBe(totalStrain); status->letTempStressVectorBe(answer1); status->setNonlocalCumulatedStrain(nonlocalCumulatedStrain); status->setTempKappa(tempKappa); status->setTempDamage(omega); }