diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 87b15c43e..3d0a4bb7a 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -219,7 +219,7 @@ subroutine homogenization_init() call thermal_init() call damage_init() - if (any(damage_type == DAMAGE_nonlocal_ID)) call damage_nonlocal_init + call damage_nonlocal_init end subroutine homogenization_init @@ -255,6 +255,7 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE if(homogState(ho)%sizeState > 0) homogState(ho)%State(:,me) = homogState(ho)%State0(:,me) if(damageState_h(ho)%sizeState > 0) damageState_h(ho)%State(:,me) = damageState_h(ho)%State0(:,me) + call damage_partition(ce) doneAndHappy = [.false.,.true.] @@ -375,7 +376,8 @@ subroutine homogenization_forward do ho = 1, size(material_name_homogenization) homogState (ho)%state0 = homogState (ho)%state - damageState_h(ho)%state0 = damageState_h(ho)%state + if(damageState_h(ho)%sizeState > 0) & + damageState_h(ho)%state0 = damageState_h(ho)%state enddo end subroutine homogenization_forward diff --git a/src/homogenization_damage.f90 b/src/homogenization_damage.f90 index 4f23af3be..502174309 100644 --- a/src/homogenization_damage.f90 +++ b/src/homogenization_damage.f90 @@ -72,7 +72,8 @@ module subroutine damage_partition(ce) integer :: co - phi = current(material_homogenizationAt2(ce))%phi(material_homogenizationMemberAt2(ce)) + if(damageState_h(material_homogenizationAt2(ce))%sizeState < 1) return + phi = damagestate_h(material_homogenizationAt2(ce))%state(1,material_homogenizationMemberAt2(ce)) do co = 1, homogenization_Nconstituents(material_homogenizationAt2(ce)) call phase_damage_set_phi(phi,co,ce) enddo diff --git a/src/material.f90 b/src/material.f90 index 3689cd0b0..b76b2b296 100644 --- a/src/material.f90 +++ b/src/material.f90 @@ -100,7 +100,7 @@ subroutine material_init(restart) allocate(homogState (size(material_name_homogenization))) - allocate(damageState_h (size(material_name_homogenization))) + allocate(damageState_h (size(material_name_homogenization))) if (.not. restart) then call results_openJobFile diff --git a/src/phase_damage_anisobrittle.f90 b/src/phase_damage_anisobrittle.f90 index b328dfed7..699e9508b 100644 --- a/src/phase_damage_anisobrittle.f90 +++ b/src/phase_damage_anisobrittle.f90 @@ -152,7 +152,7 @@ module subroutine anisobrittle_dotState(S, co, ip, el) traction_t = math_tensordot(S,prm%cleavage_systems(1:3,1:3,2,i)) traction_n = math_tensordot(S,prm%cleavage_systems(1:3,1:3,3,i)) - traction_crit = prm%g_crit(i)*damagestate_h(homog)%state(1,damageOffset)**2.0_pReal + traction_crit = prm%g_crit(i)*phase_damage_get_phi(co,ip,el)**2.0_pReal damageState(ph)%p(sourceOffset)%dotState(1,me) & = damageState(ph)%p(sourceOffset)%dotState(1,me) & diff --git a/src/phase_damage_anisoductile.f90 b/src/phase_damage_anisoductile.f90 index 18c29fdfc..b22f5b3d6 100644 --- a/src/phase_damage_anisoductile.f90 +++ b/src/phase_damage_anisoductile.f90 @@ -129,7 +129,7 @@ module subroutine anisoductile_dotState(co, ip, el) associate(prm => param(source_damage_anisoDuctile_instance(ph))) damageState(ph)%p(sourceOffset)%dotState(1,me) & - = sum(plasticState(ph)%slipRate(:,me)/(damagestate_h(homog)%state(1,damageOffset)**prm%q)/prm%gamma_crit) + = sum(plasticState(ph)%slipRate(:,me)/(phase_damage_get_phi(co,ip,el)**prm%q)/prm%gamma_crit) end associate end subroutine anisoductile_dotState diff --git a/src/phase_damage_isoductile.f90 b/src/phase_damage_isoductile.f90 index 9dac17cd8..e9aec1944 100644 --- a/src/phase_damage_isoductile.f90 +++ b/src/phase_damage_isoductile.f90 @@ -120,7 +120,7 @@ module subroutine isoductile_dotState(co, ip, el) associate(prm => param(source_damage_isoDuctile_instance(ph))) damageState(ph)%p(sourceOffset)%dotState(1,me) = & - sum(plasticState(ph)%slipRate(:,me))/(damagestate_h(homog)%state(1,damageOffset)**prm%q)/prm%gamma_crit + sum(plasticState(ph)%slipRate(:,me))/(phase_damage_get_phi(co,ip,el)**prm%q)/prm%gamma_crit end associate end subroutine isoductile_dotState diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index f2f3333d3..61151d33b 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -381,7 +381,7 @@ subroutine phase_hooke_SandItsTangents(S, dS_dFe, dS_dFi, & DegradationLoop: do d = 1, phase_NstiffnessDegradations(material_phaseAt(co,el)) degradationType: select case(phase_stiffnessDegradation(d,material_phaseAt(co,el))) case (STIFFNESS_DEGRADATION_damage_ID) degradationType - C = C * damagestate_h(ho)%state(1,material_homogenizationMemberAt(ip,el))**2 + C = C * phase_damage_get_phi(co,ip,el)**2 end select degradationType enddo DegradationLoop diff --git a/src/phase_mechanical_eigen_cleavageopening.f90 b/src/phase_mechanical_eigen_cleavageopening.f90 index b41cb1e9c..55102e196 100644 --- a/src/phase_mechanical_eigen_cleavageopening.f90 +++ b/src/phase_mechanical_eigen_cleavageopening.f90 @@ -126,7 +126,7 @@ module subroutine kinematics_cleavage_opening_LiAndItsTangent(Ld, dLd_dTstar, S, dLd_dTstar = 0.0_pReal associate(prm => param(kinematics_cleavage_opening_instance(material_phaseAt(co,el)))) do i = 1,prm%sum_N_cl - traction_crit = prm%g_crit(i)*damagestate_h(homog)%state(1,damageOffset)**2.0_pReal + traction_crit = prm%g_crit(i)*phase_damage_get_phi(co,ip,el)**2.0_pReal traction_d = math_tensordot(S,prm%cleavage_systems(1:3,1:3,1,i)) if (abs(traction_d) > traction_crit + tol_math_check) then diff --git a/src/phase_mechanical_eigen_slipplaneopening.f90 b/src/phase_mechanical_eigen_slipplaneopening.f90 index 682f0b825..cf5e918b3 100644 --- a/src/phase_mechanical_eigen_slipplaneopening.f90 +++ b/src/phase_mechanical_eigen_slipplaneopening.f90 @@ -152,7 +152,7 @@ module subroutine kinematics_slipplane_opening_LiAndItsTangent(Ld, dLd_dTstar, S traction_t = math_tensordot(S,prm%P_t(1:3,1:3,i)) traction_n = math_tensordot(S,prm%P_n(1:3,1:3,i)) - traction_crit = prm%g_crit(i)* damagestate_h(homog)%state(1,damageOffset) ! degrading critical load carrying capacity by damage + traction_crit = prm%g_crit(i)* phase_damage_get_phi(co,ip,el) ! degrading critical load carrying capacity by damage udotd = sign(1.0_pReal,traction_d)* prm%dot_o* ( abs(traction_d)/traction_crit & - abs(traction_d)/prm%g_crit(i))**prm%q