diff --git a/src/constitutive.f90 b/src/constitutive.f90 index 16f3d3b59..16278957a 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -137,8 +137,8 @@ module constitutive end subroutine thermal_forward - module subroutine mech_restore(ip,el,includeL) - integer, intent(in) :: ip, el + module subroutine mech_restore(ce,includeL) + integer, intent(in) :: ce logical, intent(in) :: includeL end subroutine mech_restore @@ -497,26 +497,24 @@ end subroutine constitutive_allocateState !-------------------------------------------------------------------------------------------------- !> @brief Restore data after homog cutback. !-------------------------------------------------------------------------------------------------- -subroutine constitutive_restore(ip,el,includeL) +subroutine constitutive_restore(ce,includeL) logical, intent(in) :: includeL - integer, intent(in) :: & - ip, & !< integration point number - el !< element number + integer, intent(in) :: ce integer :: & co, & !< constituent number so - do co = 1,homogenization_Nconstituents(material_homogenizationAt(el)) - do so = 1, phase_Nsources(material_phaseAt(co,el)) - damageState(material_phaseAt(co,el))%p(so)%state( :,material_phasememberAt(co,ip,el)) = & - damageState(material_phaseAt(co,el))%p(so)%partitionedState0(:,material_phasememberAt(co,ip,el)) + do co = 1,homogenization_Nconstituents(material_homogenizationAt2(ce)) + do so = 1, phase_Nsources(material_phaseAt2(co,ce)) + damageState(material_phaseAt2(co,ce))%p(so)%state( :,material_phasememberAt2(co,ce)) = & + damageState(material_phaseAt2(co,ce))%p(so)%partitionedState0(:,material_phasememberAt2(co,ce)) enddo enddo - call mech_restore(ip,el,includeL) + call mech_restore(ce,includeL) end subroutine constitutive_restore diff --git a/src/constitutive_mech.f90 b/src/constitutive_mech.f90 index cd1dedb61..d54367ad6 100644 --- a/src/constitutive_mech.f90 +++ b/src/constitutive_mech.f90 @@ -1656,11 +1656,9 @@ end function crystallite_stress !-------------------------------------------------------------------------------------------------- !> @brief Restore data after homog cutback. !-------------------------------------------------------------------------------------------------- -module subroutine mech_restore(ip,el,includeL) +module subroutine mech_restore(ce,includeL) - integer, intent(in) :: & - ip, & !< integration point number - el !< element number + integer, intent(in) :: ce logical, intent(in) :: & includeL !< protect agains fake cutback @@ -1668,9 +1666,9 @@ module subroutine mech_restore(ip,el,includeL) co, ph, me - do co = 1,homogenization_Nconstituents(material_homogenizationAt(el)) - ph = material_phaseAt(co,el) - me = material_phaseMemberAt(co,ip,el) + do co = 1,homogenization_Nconstituents(material_homogenizationAt2(ce)) + ph = material_phaseAt2(co,ce) + me = material_phaseMemberAt2(co,ce) if (includeL) then constitutive_mech_Lp(ph)%data(1:3,1:3,me) = constitutive_mech_partitionedLp0(ph)%data(1:3,1:3,me) constitutive_mech_Li(ph)%data(1:3,1:3,me) = constitutive_mech_partitionedLi0(ph)%data(1:3,1:3,me) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index ed9b7fead..627c7c36e 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -190,9 +190,9 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE ho = material_homogenizationAt(el) myNgrains = homogenization_Nconstituents(ho) do ip = FEsolving_execIP(1),FEsolving_execIP(2) - me = material_homogenizationMemberAt(ip,el) -!-------------------------------------------------------------------------------------------------- -! initialize restoration points + ce = (el-1)*discretization_nIPs + ip + me = material_homogenizationMemberAt2(ce) + call constitutive_initializeRestorationPoints(ip,el) subFrac = 0.0_pReal @@ -226,7 +226,7 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE else ! cutback makes sense subStep = num%subStepSizeHomog * subStep ! crystallite had severe trouble, so do a significant cutback - call constitutive_restore(ip,el,subStep < 1.0_pReal) + call constitutive_restore(ce,subStep < 1.0_pReal) if(homogState(ho)%sizeState > 0) homogState(ho)%State(:,me) = homogState(ho)%subState0(:,me) if(damageState_h(ho)%sizeState > 0) damageState_h(ho)%State(:,me) = damageState_h(ho)%subState0(:,me) @@ -243,7 +243,6 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE ! deformation partitioning if (.not. doneAndHappy(1)) then - ce = (el-1)*discretization_nIPs + ip call mech_partition( homogenization_F0(1:3,1:3,ce) & + (homogenization_F(1:3,1:3,ce)-homogenization_F0(1:3,1:3,ce))*(subStep+subFrac), & ip,el) @@ -255,7 +254,6 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE if (.not. converged) then doneAndHappy = [.true.,.false.] else - ce = (el-1)*discretization_nIPs + ip doneAndHappy = mech_updateState(dt*subStep, & homogenization_F0(1:3,1:3,ce) & + (homogenization_F(1:3,1:3,ce)-homogenization_F0(1:3,1:3,ce)) &