diff --git a/src/constitutive.f90 b/src/constitutive.f90 index 149d09a49..630756ec4 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -115,12 +115,6 @@ module constitutive integer, intent(in) :: ph end subroutine damage_results - - module subroutine mech_initializeRestorationPoints(ph,me) - integer, intent(in) :: ph, me - end subroutine mech_initializeRestorationPoints - - module subroutine mech_windForward(ph,me) integer, intent(in) :: ph, me end subroutine mech_windForward @@ -359,7 +353,6 @@ module constitutive constitutive_mech_getP, & constitutive_mech_setF, & constitutive_mech_getF, & - constitutive_initializeRestorationPoints, & constitutive_windForward, & KINEMATICS_UNDEFINED_ID ,& KINEMATICS_CLEAVAGE_OPENING_ID, & @@ -404,11 +397,9 @@ subroutine constitutive_init PhaseLoop2:do ph = 1,phases%length !-------------------------------------------------------------------------------------------------- ! partition and initialize state - plasticState(ph)%partitionedState0 = plasticState(ph)%state0 - plasticState(ph)%state = plasticState(ph)%partitionedState0 + plasticState(ph)%state = plasticState(ph)%state0 forall(so = 1:phase_Nsources(ph)) - damageState(ph)%p(so)%partitionedState0 = damageState(ph)%p(so)%state0 - damageState(ph)%p(so)%state = damageState(ph)%p(so)%partitionedState0 + damageState(ph)%p(so)%state = damageState(ph)%p(so)%state0 end forall constitutive_source_maxSizeDotState = max(constitutive_source_maxSizeDotState, & @@ -473,7 +464,6 @@ subroutine constitutive_allocateState(state, & allocate(state%atol (sizeState), source=0.0_pReal) allocate(state%state0 (sizeState,Nconstituents), source=0.0_pReal) - allocate(state%partitionedState0(sizeState,Nconstituents), source=0.0_pReal) allocate(state%state (sizeState,Nconstituents), source=0.0_pReal) allocate(state%dotState (sizeDotState,Nconstituents), source=0.0_pReal) @@ -500,7 +490,7 @@ subroutine constitutive_restore(ce,includeL) 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)) + damageState(material_phaseAt2(co,ce))%p(so)%state0(:,material_phasememberAt2(co,ce)) enddo enddo @@ -651,33 +641,6 @@ subroutine crystallite_init() end subroutine crystallite_init -!-------------------------------------------------------------------------------------------------- -!> @brief Backup data for homog cutback. -!-------------------------------------------------------------------------------------------------- -subroutine constitutive_initializeRestorationPoints(ip,el) - - integer, intent(in) :: & - ip, & !< integration point number - el !< element number - integer :: & - co, & !< constituent number - so,ph, me - - do co = 1,homogenization_Nconstituents(material_homogenizationAt(el)) - ph = material_phaseAt(co,el) - me = material_phaseMemberAt(co,ip,el) - - call mech_initializeRestorationPoints(ph,me) - - do so = 1, size(damageState(ph)%p) - damageState(ph)%p(so)%partitionedState0(:,me) = damageState(ph)%p(so)%state0(:,me) - enddo - - enddo - -end subroutine constitutive_initializeRestorationPoints - - !-------------------------------------------------------------------------------------------------- !> @brief Wind homog inc forward. !-------------------------------------------------------------------------------------------------- @@ -699,7 +662,7 @@ subroutine constitutive_windForward(ip,el) call mech_windForward(ph,me) do so = 1, phase_Nsources(material_phaseAt(co,el)) - damageState(ph)%p(so)%partitionedState0(:,me) = damageState(ph)%p(so)%state(:,me) + damageState(ph)%p(so)%state0(:,me) = damageState(ph)%p(so)%state(:,me) enddo enddo diff --git a/src/constitutive_mech.f90 b/src/constitutive_mech.f90 index 56e03ac6f..be933ef4f 100644 --- a/src/constitutive_mech.f90 +++ b/src/constitutive_mech.f90 @@ -39,16 +39,7 @@ submodule(constitutive) constitutive_mech constitutive_mech_F0, & constitutive_mech_Li0, & constitutive_mech_Lp0, & - constitutive_mech_S0, & - ! converged value at end of last homogenization increment (RGC only) - constitutive_mech_partitionedFi0, & - constitutive_mech_partitionedFp0, & - constitutive_mech_partitionedF0, & - constitutive_mech_partitionedLi0, & - constitutive_mech_partitionedLp0, & - constitutive_mech_partitionedS0 - - + constitutive_mech_S0 integer(kind(PLASTICITY_undefined_ID)), dimension(:), allocatable :: & @@ -361,23 +352,17 @@ module subroutine mech_init(phases) allocate(constitutive_mech_Fe(phases%length)) allocate(constitutive_mech_Fi(phases%length)) allocate(constitutive_mech_Fi0(phases%length)) - allocate(constitutive_mech_partitionedFi0(phases%length)) allocate(constitutive_mech_Fp(phases%length)) allocate(constitutive_mech_Fp0(phases%length)) - allocate(constitutive_mech_partitionedFp0(phases%length)) allocate(constitutive_mech_F(phases%length)) allocate(constitutive_mech_F0(phases%length)) - allocate(constitutive_mech_partitionedF0(phases%length)) allocate(constitutive_mech_Li(phases%length)) allocate(constitutive_mech_Li0(phases%length)) - allocate(constitutive_mech_partitionedLi0(phases%length)) - allocate(constitutive_mech_partitionedLp0(phases%length)) allocate(constitutive_mech_Lp0(phases%length)) allocate(constitutive_mech_Lp(phases%length)) allocate(constitutive_mech_S(phases%length)) allocate(constitutive_mech_P(phases%length)) allocate(constitutive_mech_S0(phases%length)) - allocate(constitutive_mech_partitionedS0(phases%length)) do ph = 1, phases%length Nconstituents = count(material_phaseAt == ph) * discretization_nIPs @@ -385,23 +370,17 @@ module subroutine mech_init(phases) allocate(constitutive_mech_Fi(ph)%data(3,3,Nconstituents)) allocate(constitutive_mech_Fe(ph)%data(3,3,Nconstituents)) allocate(constitutive_mech_Fi0(ph)%data(3,3,Nconstituents)) - allocate(constitutive_mech_partitionedFi0(ph)%data(3,3,Nconstituents)) allocate(constitutive_mech_Fp(ph)%data(3,3,Nconstituents)) allocate(constitutive_mech_Fp0(ph)%data(3,3,Nconstituents)) - allocate(constitutive_mech_partitionedFp0(ph)%data(3,3,Nconstituents)) allocate(constitutive_mech_Li(ph)%data(3,3,Nconstituents)) allocate(constitutive_mech_Li0(ph)%data(3,3,Nconstituents)) - allocate(constitutive_mech_partitionedLi0(ph)%data(3,3,Nconstituents)) - allocate(constitutive_mech_partitionedLp0(ph)%data(3,3,Nconstituents)) allocate(constitutive_mech_Lp0(ph)%data(3,3,Nconstituents)) allocate(constitutive_mech_Lp(ph)%data(3,3,Nconstituents)) allocate(constitutive_mech_S(ph)%data(3,3,Nconstituents),source=0.0_pReal) allocate(constitutive_mech_P(ph)%data(3,3,Nconstituents),source=0.0_pReal) allocate(constitutive_mech_S0(ph)%data(3,3,Nconstituents),source=0.0_pReal) - allocate(constitutive_mech_partitionedS0(ph)%data(3,3,Nconstituents),source=0.0_pReal) allocate(constitutive_mech_F(ph)%data(3,3,Nconstituents)) allocate(constitutive_mech_F0(ph)%data(3,3,Nconstituents)) - allocate(constitutive_mech_partitionedF0(ph)%data(3,3,Nconstituents)) phase => phases%get(ph) mech => phase%get('mechanics') @@ -454,10 +433,6 @@ module subroutine mech_init(phases) constitutive_mech_Fi(ph)%data(1:3,1:3,me) = constitutive_mech_Fi0(ph)%data(1:3,1:3,me) constitutive_mech_F(ph)%data(1:3,1:3,me) = constitutive_mech_F0(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedFi0(ph)%data(1:3,1:3,me) = constitutive_mech_Fi0(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedFp0(ph)%data(1:3,1:3,me) = constitutive_mech_Fp0(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedF0(ph)%data(1:3,1:3,me) = constitutive_mech_F0(ph)%data(1:3,1:3,me) - enddo enddo; enddo !$OMP END PARALLEL DO @@ -1464,26 +1439,6 @@ subroutine crystallite_results(group,ph) end subroutine crystallite_results -!-------------------------------------------------------------------------------------------------- -!> @brief Backup data for homog cutback. -!-------------------------------------------------------------------------------------------------- -module subroutine mech_initializeRestorationPoints(ph,me) - - integer, intent(in) :: ph, me - - - constitutive_mech_partitionedFi0(ph)%data(1:3,1:3,me) = constitutive_mech_Fi0(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedFp0(ph)%data(1:3,1:3,me) = constitutive_mech_Fp0(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedF0(ph)%data(1:3,1:3,me) = constitutive_mech_F0(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedLi0(ph)%data(1:3,1:3,me) = constitutive_mech_Li0(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedLp0(ph)%data(1:3,1:3,me) = constitutive_mech_Lp0(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedS0(ph)%data(1:3,1:3,me) = constitutive_mech_S0(ph)%data(1:3,1:3,me) - - plasticState(ph)%partitionedState0(:,me) = plasticState(ph)%state0(:,me) - -end subroutine mech_initializeRestorationPoints - - !-------------------------------------------------------------------------------------------------- !> @brief Wind homog inc forward. !-------------------------------------------------------------------------------------------------- @@ -1492,14 +1447,14 @@ module subroutine mech_windForward(ph,me) integer, intent(in) :: ph, me - constitutive_mech_partitionedFp0(ph)%data(1:3,1:3,me) = constitutive_mech_Fp(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedFi0(ph)%data(1:3,1:3,me) = constitutive_mech_Fi(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedF0(ph)%data(1:3,1:3,me) = constitutive_mech_F(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedLi0(ph)%data(1:3,1:3,me) = constitutive_mech_Li(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedLp0(ph)%data(1:3,1:3,me) = constitutive_mech_Lp(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedS0(ph)%data(1:3,1:3,me) = constitutive_mech_S(ph)%data(1:3,1:3,me) + constitutive_mech_Fp0(ph)%data(1:3,1:3,me) = constitutive_mech_Fp(ph)%data(1:3,1:3,me) + constitutive_mech_Fi0(ph)%data(1:3,1:3,me) = constitutive_mech_Fi(ph)%data(1:3,1:3,me) + constitutive_mech_F0(ph)%data(1:3,1:3,me) = constitutive_mech_F(ph)%data(1:3,1:3,me) + constitutive_mech_Li0(ph)%data(1:3,1:3,me) = constitutive_mech_Li(ph)%data(1:3,1:3,me) + constitutive_mech_Lp0(ph)%data(1:3,1:3,me) = constitutive_mech_Lp(ph)%data(1:3,1:3,me) + constitutive_mech_S0(ph)%data(1:3,1:3,me) = constitutive_mech_S(ph)%data(1:3,1:3,me) - plasticState(ph)%partitionedState0(:,me) = plasticState(ph)%state(:,me) + plasticState(ph)%State0(:,me) = plasticState(ph)%state(:,me) end subroutine mech_windForward @@ -1578,17 +1533,17 @@ module function crystallite_stress(dt,co,ip,el) result(converged_) me = material_phaseMemberAt(co,ip,el) sizeDotState = plasticState(ph)%sizeDotState - subLi0 = constitutive_mech_partitionedLi0(ph)%data(1:3,1:3,me) - subLp0 = constitutive_mech_partitionedLp0(ph)%data(1:3,1:3,me) - subState0 = plasticState(ph)%partitionedState0(:,me) + subLi0 = constitutive_mech_Li0(ph)%data(1:3,1:3,me) + subLp0 = constitutive_mech_Lp0(ph)%data(1:3,1:3,me) + subState0 = plasticState(ph)%State0(:,me) do so = 1, phase_Nsources(ph) - damageState(ph)%p(so)%subState0(:,me) = damageState(ph)%p(so)%partitionedState0(:,me) + damageState(ph)%p(so)%subState0(:,me) = damageState(ph)%p(so)%state0(:,me) enddo - subFp0 = constitutive_mech_partitionedFp0(ph)%data(1:3,1:3,me) - subFi0 = constitutive_mech_partitionedFi0(ph)%data(1:3,1:3,me) - subF0 = constitutive_mech_partitionedF0(ph)%data(1:3,1:3,me) + subFp0 = constitutive_mech_Fp0(ph)%data(1:3,1:3,me) + subFi0 = constitutive_mech_Fi0(ph)%data(1:3,1:3,me) + subF0 = constitutive_mech_F0(ph)%data(1:3,1:3,me) subFrac = 0.0_pReal subStep = 1.0_pReal/num%subStepSizeCryst todo = .true. @@ -1638,7 +1593,7 @@ module function crystallite_stress(dt,co,ip,el) result(converged_) ! prepare for integration if (todo) then subF = subF0 & - + subStep * (constitutive_mech_F(ph)%data(1:3,1:3,me) - constitutive_mech_partitionedF0(ph)%data(1:3,1:3,me)) + + subStep * (constitutive_mech_F(ph)%data(1:3,1:3,me) - constitutive_mech_F0(ph)%data(1:3,1:3,me)) constitutive_mech_Fe(ph)%data(1:3,1:3,me) = matmul(subF,math_inv33(matmul(constitutive_mech_Fi(ph)%data(1:3,1:3,me), & constitutive_mech_Fp(ph)%data(1:3,1:3,me)))) converged_ = .not. integrateState(subF0,subF,subFp0,subFi0,subState0(1:sizeDotState),subStep * dt,co,ip,el) @@ -1667,15 +1622,15 @@ module subroutine mech_restore(ce,includeL) 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) + constitutive_mech_Lp(ph)%data(1:3,1:3,me) = constitutive_mech_Lp0(ph)%data(1:3,1:3,me) + constitutive_mech_Li(ph)%data(1:3,1:3,me) = constitutive_mech_Li0(ph)%data(1:3,1:3,me) endif ! maybe protecting everything from overwriting makes more sense - constitutive_mech_Fp(ph)%data(1:3,1:3,me) = constitutive_mech_partitionedFp0(ph)%data(1:3,1:3,me) - constitutive_mech_Fi(ph)%data(1:3,1:3,me) = constitutive_mech_partitionedFi0(ph)%data(1:3,1:3,me) - constitutive_mech_S(ph)%data(1:3,1:3,me) = constitutive_mech_partitionedS0(ph)%data(1:3,1:3,me) + constitutive_mech_Fp(ph)%data(1:3,1:3,me) = constitutive_mech_Fp0(ph)%data(1:3,1:3,me) + constitutive_mech_Fi(ph)%data(1:3,1:3,me) = constitutive_mech_Fi0(ph)%data(1:3,1:3,me) + constitutive_mech_S(ph)%data(1:3,1:3,me) = constitutive_mech_S0(ph)%data(1:3,1:3,me) - plasticState(ph)%state(:,me) = plasticState(ph)%partitionedState0(:,me) + plasticState(ph)%state(:,me) = plasticState(ph)%State0(:,me) enddo end subroutine mech_restore @@ -1727,8 +1682,8 @@ module function constitutive_mech_dPdF(dt,co,ip,el) result(dPdF) invFp = math_inv33(constitutive_mech_Fp(ph)%data(1:3,1:3,me)) invFi = math_inv33(constitutive_mech_Fi(ph)%data(1:3,1:3,me)) - invSubFp0 = math_inv33(constitutive_mech_partitionedFp0(ph)%data(1:3,1:3,me)) - invSubFi0 = math_inv33(constitutive_mech_partitionedFi0(ph)%data(1:3,1:3,me)) + invSubFp0 = math_inv33(constitutive_mech_Fp0(ph)%data(1:3,1:3,me)) + invSubFi0 = math_inv33(constitutive_mech_Fi0(ph)%data(1:3,1:3,me)) if (sum(abs(dLidS)) < tol_math_check) then dFidS = 0.0_pReal diff --git a/src/constitutive_thermal.f90 b/src/constitutive_thermal.f90 index 57b8a3117..831fd236d 100644 --- a/src/constitutive_thermal.f90 +++ b/src/constitutive_thermal.f90 @@ -116,12 +116,11 @@ module subroutine thermal_init(phases) PhaseLoop2:do ph = 1,phases%length do so = 1,thermal_Nsources(ph) - deallocate(thermalState(ph)%p(so)%partitionedState0) - thermalState(ph)%p(so)%state = thermalState(ph)%p(so)%state0 + thermalState(ph)%p(so)%state = thermalState(ph)%p(so)%state0 enddo - thermal_source_maxSizeDotState = max(thermal_source_maxSizeDotState, & - maxval(thermalState(ph)%p%sizeDotState)) + thermal_source_maxSizeDotState = max(thermal_source_maxSizeDotState, & + maxval(thermalState(ph)%p%sizeDotState)) enddo PhaseLoop2 !-------------------------------------------------------------------------------------------------- diff --git a/src/damage_none.f90 b/src/damage_none.f90 index 078d42af7..680110d55 100644 --- a/src/damage_none.f90 +++ b/src/damage_none.f90 @@ -27,7 +27,6 @@ subroutine damage_none_init Nmaterialpoints = count(material_homogenizationAt == h) damageState_h(h)%sizeState = 0 allocate(damageState_h(h)%state0 (0,Nmaterialpoints)) - allocate(damageState_h(h)%subState0(0,Nmaterialpoints)) allocate(damageState_h(h)%state (0,Nmaterialpoints)) allocate (damage(h)%p(Nmaterialpoints), source=1.0_pReal) diff --git a/src/damage_nonlocal.f90 b/src/damage_nonlocal.f90 index fe11b0db7..6e46d8799 100644 --- a/src/damage_nonlocal.f90 +++ b/src/damage_nonlocal.f90 @@ -76,7 +76,6 @@ subroutine damage_nonlocal_init Nmaterialpoints = count(material_homogenizationAt == h) damageState_h(h)%sizeState = 1 allocate(damageState_h(h)%state0 (1,Nmaterialpoints), source=1.0_pReal) - allocate(damageState_h(h)%subState0(1,Nmaterialpoints), source=1.0_pReal) allocate(damageState_h(h)%state (1,Nmaterialpoints), source=1.0_pReal) damage(h)%p => damageState_h(h)%state(1,:) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 977bd4078..5523f38ac 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -233,9 +233,6 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE ip, & !< integration point number el, & !< element number myNgrains, co, ce, ho, me, ph - real(pReal) :: & - subFrac, & - subStep logical :: & converged logical, dimension(2) :: & @@ -250,8 +247,6 @@ subroutine materialpoint_stressAndItsTangent(dt,FEsolving_execIP,FEsolving_execE ce = (el-1)*discretization_nIPs + ip me = material_homogenizationMemberAt2(ce) - call constitutive_initializeRestorationPoints(ip,el) - call constitutive_restore(ce,.false.) ! wrong name (is more a forward function) if(homogState(ho)%sizeState > 0) homogState(ho)%State(:,me) = homogState(ho)%State0(:,me) diff --git a/src/homogenization_mech_RGC.f90 b/src/homogenization_mech_RGC.f90 index 24d14e059..2c7a5a8cb 100644 --- a/src/homogenization_mech_RGC.f90 +++ b/src/homogenization_mech_RGC.f90 @@ -171,7 +171,6 @@ module subroutine mech_RGC_init(num_homogMech) homogState(h)%sizeState = sizeState allocate(homogState(h)%state0 (sizeState,Nmaterialpoints), source=0.0_pReal) - allocate(homogState(h)%subState0(sizeState,Nmaterialpoints), source=0.0_pReal) allocate(homogState(h)%state (sizeState,Nmaterialpoints), source=0.0_pReal) stt%relaxationVector => homogState(h)%state(1:nIntFaceTot,:) diff --git a/src/homogenization_mech_isostrain.f90 b/src/homogenization_mech_isostrain.f90 index a56104647..df8f5fc9d 100644 --- a/src/homogenization_mech_isostrain.f90 +++ b/src/homogenization_mech_isostrain.f90 @@ -64,7 +64,6 @@ module subroutine mech_isostrain_init Nmaterialpoints = count(material_homogenizationAt == h) homogState(h)%sizeState = 0 allocate(homogState(h)%state0 (0,Nmaterialpoints)) - allocate(homogState(h)%subState0(0,Nmaterialpoints)) allocate(homogState(h)%state (0,Nmaterialpoints)) end associate diff --git a/src/homogenization_mech_none.f90 b/src/homogenization_mech_none.f90 index d434d1ca0..767dbf557 100644 --- a/src/homogenization_mech_none.f90 +++ b/src/homogenization_mech_none.f90 @@ -32,7 +32,6 @@ module subroutine mech_none_init Nmaterialpoints = count(material_homogenizationAt == h) homogState(h)%sizeState = 0 allocate(homogState(h)%state0 (0,Nmaterialpoints)) - allocate(homogState(h)%subState0(0,Nmaterialpoints)) allocate(homogState(h)%state (0,Nmaterialpoints)) enddo diff --git a/src/prec.f90 b/src/prec.f90 index 4d73462c4..eabeecaf4 100644 --- a/src/prec.f90 +++ b/src/prec.f90 @@ -47,7 +47,6 @@ module prec dotState, & !< rate of state change deltaState !< increment of state change real(pReal), allocatable, dimension(:,:) :: & - partitionedState0, & subState0 end type