From e940a0230441eb890871907b840eb7dba035ecc2 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 3 Feb 2022 13:47:57 +0100 Subject: [PATCH 01/19] [skip ci] updated version information after successful test of v3.0.0-alpha5-568-g2cb3b2cc4 --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index b4c8c4b3c..4e6d4db5e 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-556-g97f849c09 +v3.0.0-alpha5-568-g2cb3b2cc4 From a9a5c8fb7374d9235ceecefd907bbd39f4095321 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 3 Feb 2022 23:06:14 +0100 Subject: [PATCH 02/19] simplify acces with pointer naming will be adjusted once global deltaState is removed --- src/phase.f90 | 2 ++ src/phase_mechanical.f90 | 8 ++++---- src/phase_mechanical_plastic.f90 | 7 +++---- src/prec.f90 | 2 ++ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/phase.f90 b/src/phase.f90 index b7bace81a..098cdebe8 100644 --- a/src/phase.f90 +++ b/src/phase.f90 @@ -436,6 +436,8 @@ subroutine phase_allocateState(state, & allocate(state%dotState (sizeDotState,NEntries), source=0.0_pReal) allocate(state%deltaState (sizeDeltaState,NEntries), source=0.0_pReal) + state%deltaState2 => state%state(state%offsetDeltaState+1: & + state%offsetDeltaState+state%sizeDeltaState,:) end subroutine phase_allocateState diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index 04cc4b946..733219d56 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -81,13 +81,13 @@ submodule(phase) mechanical module function plastic_dotState(subdt,co,ip,el,ph,en) result(dotState) integer, intent(in) :: & - co, & !< component-ID of integration point - ip, & !< integration point - el, & !< element + co, & !< constituent + ip, & !< integration point + el, & !< element ph, & en real(pReal), intent(in) :: & - subdt !< timestep + subdt !< timestep real(pReal), dimension(plasticState(ph)%sizeDotState) :: & dotState end function plastic_dotState diff --git a/src/phase_mechanical_plastic.f90 b/src/phase_mechanical_plastic.f90 index 912aadc03..bb5a9819a 100644 --- a/src/phase_mechanical_plastic.f90 +++ b/src/phase_mechanical_plastic.f90 @@ -415,10 +415,9 @@ module function plastic_deltaState(ph, en) result(broken) broken = any(IEEE_is_NaN(plasticState(ph)%deltaState(:,en))) if (.not. broken) then - myOffset = plasticState(ph)%offsetDeltaState - mySize = plasticState(ph)%sizeDeltaState - plasticState(ph)%state(myOffset + 1:myOffset + mySize,en) = & - plasticState(ph)%state(myOffset + 1:myOffset + mySize,en) + plasticState(ph)%deltaState(1:mySize,en) + mySize = plasticState(ph)%sizeDeltaState + plasticState(ph)%deltaState2(1:mySize,en) = plasticState(ph)%deltaState2(1:mySize,en) & + + plasticState(ph)%deltaState(1:mySize,en) end if end select diff --git a/src/prec.f90 b/src/prec.f90 index 8de82fee8..61fa141ba 100644 --- a/src/prec.f90 +++ b/src/prec.f90 @@ -45,6 +45,8 @@ module prec state, & !< state dotState, & !< rate of state change deltaState !< increment of state change + real(pReal), pointer, dimension(:,:) :: & + deltaState2 end type type, extends(tState) :: tPlasticState From ce1eb4f59e4f0bd259edd3ec599ec8fa4cfd81cb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 3 Feb 2022 23:40:25 +0100 Subject: [PATCH 03/19] no need to store dot state saves memory and flow is easier to understand --- src/phase_mechanical_plastic.f90 | 39 ++++++----- ...phase_mechanical_plastic_dislotungsten.f90 | 57 +++++++++------ src/phase_mechanical_plastic_isotropic.f90 | 44 ++++++------ ...phase_mechanical_plastic_kinehardening.f90 | 56 +++++++++------ src/phase_mechanical_plastic_nonlocal.f90 | 4 +- ...phase_mechanical_plastic_phenopowerlaw.f90 | 70 +++++++++++-------- 6 files changed, 155 insertions(+), 115 deletions(-) diff --git a/src/phase_mechanical_plastic.f90 b/src/phase_mechanical_plastic.f90 index bb5a9819a..70181d724 100644 --- a/src/phase_mechanical_plastic.f90 +++ b/src/phase_mechanical_plastic.f90 @@ -110,29 +110,35 @@ submodule(phase:mechanical) plastic end subroutine nonlocal_LpAndItsTangent - module subroutine isotropic_dotState(Mp,ph,en) + module function isotropic_dotState(Mp,ph,en) result(dotState) real(pReal), dimension(3,3), intent(in) :: & Mp !< Mandel stress integer, intent(in) :: & ph, & en - end subroutine isotropic_dotState + real(pReal), dimension(plasticState(ph)%sizeDotState) :: & + dotState + end function isotropic_dotState - module subroutine phenopowerlaw_dotState(Mp,ph,en) + module function phenopowerlaw_dotState(Mp,ph,en) result(dotState) real(pReal), dimension(3,3), intent(in) :: & Mp !< Mandel stress integer, intent(in) :: & ph, & en - end subroutine phenopowerlaw_dotState + real(pReal), dimension(plasticState(ph)%sizeDotState) :: & + dotState + end function phenopowerlaw_dotState - module subroutine plastic_kinehardening_dotState(Mp,ph,en) + module function plastic_kinehardening_dotState(Mp,ph,en) result(dotState) real(pReal), dimension(3,3), intent(in) :: & Mp !< Mandel stress integer, intent(in) :: & ph, & en - end subroutine plastic_kinehardening_dotState + real(pReal), dimension(plasticState(ph)%sizeDotState) :: & + dotState + end function plastic_kinehardening_dotState module subroutine dislotwin_dotState(Mp,T,ph,en) real(pReal), dimension(3,3), intent(in) :: & @@ -144,15 +150,15 @@ submodule(phase:mechanical) plastic en end subroutine dislotwin_dotState - module subroutine dislotungsten_dotState(Mp,T,ph,en) + module function dislotungsten_dotState(Mp,ph,en) result(dotState) real(pReal), dimension(3,3), intent(in) :: & Mp !< Mandel stress - real(pReal), intent(in) :: & - T integer, intent(in) :: & ph, & en - end subroutine dislotungsten_dotState + real(pReal), dimension(plasticState(ph)%sizeDotState) :: & + dotState + end function dislotungsten_dotState module subroutine nonlocal_dotState(Mp,timestep,ph,en,ip,el) real(pReal), dimension(3,3), intent(in) :: & @@ -318,27 +324,28 @@ module function plastic_dotState(subdt,co,ip,el,ph,en) result(dotState) plasticType: select case (phase_plasticity(ph)) case (PLASTIC_ISOTROPIC_ID) plasticType - call isotropic_dotState(Mp,ph,en) + dotState = isotropic_dotState(Mp,ph,en) case (PLASTIC_PHENOPOWERLAW_ID) plasticType - call phenopowerlaw_dotState(Mp,ph,en) + dotState = phenopowerlaw_dotState(Mp,ph,en) case (PLASTIC_KINEHARDENING_ID) plasticType - call plastic_kinehardening_dotState(Mp,ph,en) + dotState = plastic_kinehardening_dotState(Mp,ph,en) case (PLASTIC_DISLOTWIN_ID) plasticType call dislotwin_dotState(Mp,thermal_T(ph,en),ph,en) + dotState = plasticState(ph)%dotState(:,en) case (PLASTIC_DISLOTUNGSTEN_ID) plasticType - call dislotungsten_dotState(Mp,thermal_T(ph,en),ph,en) + dotState = dislotungsten_dotState(Mp,ph,en) case (PLASTIC_NONLOCAL_ID) plasticType call nonlocal_dotState(Mp,subdt,ph,en,ip,el) + dotState = plasticState(ph)%dotState(:,en) + end select plasticType end if - dotState = plasticState(ph)%dotState(:,en) - end function plastic_dotState diff --git a/src/phase_mechanical_plastic_dislotungsten.f90 b/src/phase_mechanical_plastic_dislotungsten.f90 index 9f0465158..5a6ac8f5c 100644 --- a/src/phase_mechanical_plastic_dislotungsten.f90 +++ b/src/phase_mechanical_plastic_dislotungsten.f90 @@ -43,6 +43,13 @@ submodule(phase:plastic) dislotungsten systems_sl end type tParameters !< container type for internal constitutive parameters + type :: tIndexDotState + integer, dimension(2) :: & + rho_mob, & + rho_dip, & + gamma_sl + end type tIndexDotState + type :: tDislotungstenState real(pReal), dimension(:,:), pointer :: & rho_mob, & @@ -58,10 +65,9 @@ submodule(phase:plastic) dislotungsten !-------------------------------------------------------------------------------------------------- ! containers for parameters and state - type(tParameters), allocatable, dimension(:) :: param - type(tDisloTungstenState), allocatable, dimension(:) :: & - dotState, & - state + type(tParameters), allocatable, dimension(:) :: param + type(tIndexDotState), allocatable, dimension(:) :: indexDotState + type(tDisloTungstenState), allocatable, dimension(:) :: state type(tDisloTungstenDependentState), allocatable, dimension(:) :: dependentState contains @@ -103,18 +109,17 @@ module function plastic_dislotungsten_init() result(myPlasticity) print'(/,1x,a)', 'D. Cereceda et al., International Journal of Plasticity 78:242–256, 2016' print'( 1x,a)', 'https://doi.org/10.1016/j.ijplas.2015.09.002' - phases => config_material%get('phase') allocate(param(phases%length)) + allocate(indexDotState(phases%length)) allocate(state(phases%length)) - allocate(dotState(phases%length)) allocate(dependentState(phases%length)) - do ph = 1, phases%length if (.not. myPlasticity(ph)) cycle - associate(prm => param(ph), dot => dotState(ph), stt => state(ph), dst => dependentState(ph)) + associate(prm => param(ph), stt => state(ph), dst => dependentState(ph), & + idx_dot => indexDotState(ph)) phase => phases%get(ph) mech => phase%get('mechanical') @@ -214,28 +219,29 @@ module function plastic_dislotungsten_init() result(myPlasticity) sizeState = sizeDotState call phase_allocateState(plasticState(ph),Nmembers,sizeState,sizeDotState,0) + deallocate(plasticState(ph)%dotState) ! ToDo: remove dotState completely !-------------------------------------------------------------------------------------------------- ! state aliases and initialization startIndex = 1 endIndex = prm%sum_N_sl + idx_dot%rho_mob = [startIndex,endIndex] stt%rho_mob => plasticState(ph)%state(startIndex:endIndex,:) stt%rho_mob = spread(rho_mob_0,2,Nmembers) - dot%rho_mob => plasticState(ph)%dotState(startIndex:endIndex,:) plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_rho',defaultVal=1.0_pReal) if (any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_rho' startIndex = endIndex + 1 endIndex = endIndex + prm%sum_N_sl + idx_dot%rho_dip = [startIndex,endIndex] stt%rho_dip => plasticState(ph)%state(startIndex:endIndex,:) stt%rho_dip = spread(rho_dip_0,2,Nmembers) - dot%rho_dip => plasticState(ph)%dotState(startIndex:endIndex,:) plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_rho',defaultVal=1.0_pReal) startIndex = endIndex + 1 endIndex = endIndex + prm%sum_N_sl + idx_dot%gamma_sl = [startIndex,endIndex] stt%gamma_sl => plasticState(ph)%state(startIndex:endIndex,:) - dot%gamma_sl => plasticState(ph)%dotState(startIndex:endIndex,:) plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_gamma',defaultVal=1.0e-6_pReal) if (any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_gamma' @@ -300,15 +306,15 @@ end subroutine dislotungsten_LpAndItsTangent !-------------------------------------------------------------------------------------------------- !> @brief Calculate the rate of change of microstructure. !-------------------------------------------------------------------------------------------------- -module subroutine dislotungsten_dotState(Mp,T,ph,en) +module function dislotungsten_dotState(Mp,ph,en) result(dotState) real(pReal), dimension(3,3), intent(in) :: & Mp !< Mandel stress - real(pReal), intent(in) :: & - T !< temperature integer, intent(in) :: & ph, & en + real(pReal), dimension(plasticState(ph)%sizeDotState) :: & + dotState real(pReal), dimension(param(ph)%sum_N_sl) :: & dot_gamma_pos, dot_gamma_neg,& @@ -319,17 +325,22 @@ module subroutine dislotungsten_dotState(Mp,T,ph,en) dot_rho_dip_climb, & d_hat real(pReal) :: & - mu + mu, T - associate(prm => param(ph), stt => state(ph), dot => dotState(ph), dst => dependentState(ph)) + + associate(prm => param(ph), stt => state(ph), dst => dependentState(ph), & + dot_rho_mob => dotState(indexDotState(ph)%rho_mob(1):indexDotState(ph)%rho_mob(2)), & + dot_rho_dip => dotState(indexDotState(ph)%rho_dip(1):indexDotState(ph)%rho_dip(2)), & + dot_gamma_sl => dotState(indexDotState(ph)%gamma_sl(1):indexDotState(ph)%gamma_sl(2))) mu = elastic_mu(ph,en) + T = thermal_T(ph,en) call kinetics(Mp,T,ph,en,& dot_gamma_pos,dot_gamma_neg, & tau_pos_out = tau_pos,tau_neg_out = tau_neg) - dot%gamma_sl(:,en) = abs(dot_gamma_pos+dot_gamma_neg) + dot_gamma_sl = abs(dot_gamma_pos+dot_gamma_neg) where(dEq0((tau_pos+tau_neg)*0.5_pReal)) dot_rho_dip_formation = 0.0_pReal @@ -338,7 +349,7 @@ module subroutine dislotungsten_dotState(Mp,T,ph,en) d_hat = math_clip(3.0_pReal*mu*prm%b_sl/(16.0_pReal*PI*abs(tau_pos+tau_neg)*0.5_pReal), & prm%d_caron, & ! lower limit dst%Lambda_sl(:,en)) ! upper limit - dot_rho_dip_formation = merge(2.0_pReal*(d_hat-prm%d_caron)*stt%rho_mob(:,en)*dot%gamma_sl(:,en)/prm%b_sl, & + dot_rho_dip_formation = merge(2.0_pReal*(d_hat-prm%d_caron)*stt%rho_mob(:,en)*dot_gamma_sl/prm%b_sl, & 0.0_pReal, & prm%dipoleformation) v_cl = (3.0_pReal*mu*prm%D_0*exp(-prm%Q_cl/(K_B*T))*prm%f_at/(TAU*K_B*T)) & @@ -346,16 +357,16 @@ module subroutine dislotungsten_dotState(Mp,T,ph,en) dot_rho_dip_climb = (4.0_pReal*v_cl*stt%rho_dip(:,en))/(d_hat-prm%d_caron) ! ToDo: Discuss with Franz: Stress dependency? end where - dot%rho_mob(:,en) = dot%gamma_sl(:,en)/(prm%b_sl*dst%Lambda_sl(:,en)) & ! multiplication + dot_rho_mob = dot_gamma_sl/(prm%b_sl*dst%Lambda_sl(:,en)) & ! multiplication - dot_rho_dip_formation & - - (2.0_pReal*prm%d_caron)/prm%b_sl*stt%rho_mob(:,en)*dot%gamma_sl(:,en) ! Spontaneous annihilation of 2 edges - dot%rho_dip(:,en) = dot_rho_dip_formation & - - (2.0_pReal*prm%d_caron)/prm%b_sl*stt%rho_dip(:,en)*dot%gamma_sl(:,en) & ! Spontaneous annihilation of an edge with a dipole + - (2.0_pReal*prm%d_caron)/prm%b_sl*stt%rho_mob(:,en)*dot_gamma_sl ! Spontaneous annihilation of 2 edges + dot_rho_dip = dot_rho_dip_formation & + - (2.0_pReal*prm%d_caron)/prm%b_sl*stt%rho_dip(:,en)*dot_gamma_sl & ! Spontaneous annihilation of an edge with a dipole - dot_rho_dip_climb end associate -end subroutine dislotungsten_dotState +end function dislotungsten_dotState !-------------------------------------------------------------------------------------------------- diff --git a/src/phase_mechanical_plastic_isotropic.f90 b/src/phase_mechanical_plastic_isotropic.f90 index bea5339c7..49efc9fae 100644 --- a/src/phase_mechanical_plastic_isotropic.f90 +++ b/src/phase_mechanical_plastic_isotropic.f90 @@ -37,9 +37,7 @@ submodule(phase:plastic) isotropic !-------------------------------------------------------------------------------------------------- ! containers for parameters and state type(tParameters), allocatable, dimension(:) :: param - type(tIsotropicState), allocatable, dimension(:) :: & - dotState, & - state + type(tIsotropicState), allocatable, dimension(:) :: state contains @@ -77,16 +75,15 @@ module function plastic_isotropic_init() result(myPlasticity) phases => config_material%get('phase') allocate(param(phases%length)) allocate(state(phases%length)) - allocate(dotState(phases%length)) do ph = 1, phases%length if(.not. myPlasticity(ph)) cycle - associate(prm => param(ph), dot => dotState(ph), stt => state(ph)) + associate(prm => param(ph), stt => state(ph)) phase => phases%get(ph) - mech => phase%get('mechanical') - pl => mech%get('plastic') + mech => phase%get('mechanical') + pl => mech%get('plastic') #if defined (__GFORTRAN__) prm%output = output_as1dString(pl) @@ -125,12 +122,12 @@ module function plastic_isotropic_init() result(myPlasticity) sizeState = sizeDotState call phase_allocateState(plasticState(ph),Nmembers,sizeState,sizeDotState,0) + deallocate(plasticState(ph)%dotState) ! ToDo: remove dotState completely !-------------------------------------------------------------------------------------------------- ! state aliases and initialization - stt%xi => plasticState(ph)%state (1,:) - stt%xi = xi_0 - dot%xi => plasticState(ph)%dotState(1,:) + stt%xi => plasticState(ph)%state(1,:) + stt%xi = xi_0 plasticState(ph)%atol(1) = pl%get_asFloat('atol_xi',defaultVal=1.0_pReal) if (plasticState(ph)%atol(1) < 0.0_pReal) extmsg = trim(extmsg)//' atol_xi' @@ -178,7 +175,7 @@ module subroutine isotropic_LpAndItsTangent(Lp,dLp_dMp,Mp,ph,en) norm_Mp_dev = sqrt(squarenorm_Mp_dev) if (norm_Mp_dev > 0.0_pReal) then - dot_gamma = prm%dot_gamma_0 * (sqrt(1.5_pReal) * norm_Mp_dev/(prm%M*stt%xi(en))) **prm%n + dot_gamma = prm%dot_gamma_0 * (sqrt(1.5_pReal) * norm_Mp_dev/(prm%M*stt%xi(en)))**prm%n Lp = dot_gamma * Mp_dev/norm_Mp_dev forall (k=1:3,l=1:3,m=1:3,n=1:3) & @@ -242,27 +239,26 @@ module subroutine plastic_isotropic_LiAndItsTangent(Li,dLi_dMi,Mi,ph,en) !-------------------------------------------------------------------------------------------------- !> @brief Calculate the rate of change of microstructure. !-------------------------------------------------------------------------------------------------- -module subroutine isotropic_dotState(Mp,ph,en) +module function isotropic_dotState(Mp,ph,en) result(dotState) real(pReal), dimension(3,3), intent(in) :: & Mp !< Mandel stress integer, intent(in) :: & ph, & en + real(pReal), dimension(plasticState(ph)%sizeDotState) :: & + dotState real(pReal) :: & dot_gamma, & !< strainrate xi_inf_star, & !< saturation xi norm_Mp !< norm of the (deviatoric) Mandel stress - associate(prm => param(ph), stt => state(ph), & - dot => dotState(ph)) + associate(prm => param(ph), stt => state(ph), dot_xi => dotState(1)) - if (prm%dilatation) then - norm_Mp = sqrt(math_tensordot(Mp,Mp)) - else - norm_Mp = sqrt(math_tensordot(math_deviatoric33(Mp),math_deviatoric33(Mp))) - end if + norm_Mp = merge(sqrt(math_tensordot(Mp,Mp)), & + sqrt(math_tensordot(math_deviatoric33(Mp),math_deviatoric33(Mp))), & + prm%dilatation) dot_gamma = prm%dot_gamma_0 * (sqrt(1.5_pReal) * norm_Mp /(prm%M*stt%xi(en))) **prm%n @@ -274,16 +270,16 @@ module subroutine isotropic_dotState(Mp,ph,en) + asinh( (dot_gamma / prm%c_1)**(1.0_pReal / prm%c_2))**(1.0_pReal / prm%c_3) & / prm%c_4 * (dot_gamma / prm%dot_gamma_0)**(1.0_pReal / prm%n) end if - dot%xi(en) = dot_gamma & - * ( prm%h_0 + prm%h_ln * log(dot_gamma) ) & - * sign(abs(1.0_pReal - stt%xi(en)/xi_inf_star)**prm%a *prm%h, 1.0_pReal-stt%xi(en)/xi_inf_star) + dot_xi = dot_gamma & + * ( prm%h_0 + prm%h_ln * log(dot_gamma) ) & + * sign(abs(1.0_pReal - stt%xi(en)/xi_inf_star)**prm%a *prm%h, 1.0_pReal-stt%xi(en)/xi_inf_star) else - dot%xi(en) = 0.0_pReal + dot_xi = 0.0_pReal end if end associate -end subroutine isotropic_dotState +end function isotropic_dotState !-------------------------------------------------------------------------------------------------- diff --git a/src/phase_mechanical_plastic_kinehardening.f90 b/src/phase_mechanical_plastic_kinehardening.f90 index 03eb27f31..0f6bd53d4 100644 --- a/src/phase_mechanical_plastic_kinehardening.f90 +++ b/src/phase_mechanical_plastic_kinehardening.f90 @@ -34,6 +34,13 @@ submodule(phase:plastic) kinehardening systems_sl end type tParameters + type :: tIndexDotState + integer, dimension(2) :: & + xi, & + chi, & + gamma + end type tIndexDotState + type :: tKinehardeningState real(pReal), pointer, dimension(:,:) :: & xi, & !< resistance against plastic slip @@ -47,10 +54,8 @@ submodule(phase:plastic) kinehardening !-------------------------------------------------------------------------------------------------- ! containers for parameters and state type(tParameters), allocatable, dimension(:) :: param - type(tKinehardeningState), allocatable, dimension(:) :: & - dotState, & - deltaState, & - state + type(tIndexDotState), allocatable, dimension(:) :: indexDotState + type(tKinehardeningState), allocatable, dimension(:) :: state, deltaState contains @@ -91,19 +96,20 @@ module function plastic_kinehardening_init() result(myPlasticity) phases => config_material%get('phase') allocate(param(phases%length)) + allocate(indexDotState(phases%length)) allocate(state(phases%length)) - allocate(dotState(phases%length)) allocate(deltaState(phases%length)) do ph = 1, phases%length if (.not. myPlasticity(ph)) cycle - associate(prm => param(ph), dot => dotState(ph), dlt => deltaState(ph), stt => state(ph)) + associate(prm => param(ph), stt => state(ph), dlt => deltaState(ph), & + idx_dot => indexDotState(ph)) phase => phases%get(ph) - mech => phase%get('mechanical') - pl => mech%get('plastic') + mech => phase%get('mechanical') + pl => mech%get('plastic') #if defined (__GFORTRAN__) prm%output = output_as1dString(pl) @@ -173,27 +179,28 @@ module function plastic_kinehardening_init() result(myPlasticity) sizeState = sizeDotState + sizeDeltaState call phase_allocateState(plasticState(ph),Nmembers,sizeState,sizeDotState,sizeDeltaState) + deallocate(plasticState(ph)%dotState) ! ToDo: remove dotState completely !-------------------------------------------------------------------------------------------------- ! state aliases and initialization startIndex = 1 endIndex = prm%sum_N_sl - stt%xi => plasticState(ph)%state (startIndex:endIndex,:) + idx_dot%xi = [startIndex,endIndex] + stt%xi => plasticState(ph)%state(startIndex:endIndex,:) stt%xi = spread(xi_0, 2, Nmembers) - dot%xi => plasticState(ph)%dotState(startIndex:endIndex,:) plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_xi',defaultVal=1.0_pReal) if(any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_xi' startIndex = endIndex + 1 endIndex = endIndex + prm%sum_N_sl - stt%chi => plasticState(ph)%state (startIndex:endIndex,:) - dot%chi => plasticState(ph)%dotState(startIndex:endIndex,:) + idx_dot%chi = [startIndex,endIndex] + stt%chi => plasticState(ph)%state(startIndex:endIndex,:) plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_xi',defaultVal=1.0_pReal) startIndex = endIndex + 1 endIndex = endIndex + prm%sum_N_sl - stt%gamma => plasticState(ph)%state (startIndex:endIndex,:) - dot%gamma => plasticState(ph)%dotState(startIndex:endIndex,:) + idx_dot%gamma = [startIndex,endIndex] + stt%gamma => plasticState(ph)%state(startIndex:endIndex,:) plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_gamma',defaultVal=1.0e-6_pReal) if(any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_gamma' @@ -270,13 +277,15 @@ end subroutine kinehardening_LpAndItsTangent !-------------------------------------------------------------------------------------------------- !> @brief Calculate the rate of change of microstructure. !-------------------------------------------------------------------------------------------------- -module subroutine plastic_kinehardening_dotState(Mp,ph,en) +module function plastic_kinehardening_dotState(Mp,ph,en) result(dotState) real(pReal), dimension(3,3), intent(in) :: & Mp !< Mandel stress integer, intent(in) :: & ph, & en + real(pReal), dimension(plasticState(ph)%sizeDotState) :: & + dotState real(pReal) :: & sumGamma @@ -284,29 +293,32 @@ module subroutine plastic_kinehardening_dotState(Mp,ph,en) dot_gamma_pos,dot_gamma_neg - associate(prm => param(ph), stt => state(ph),dot => dotState(ph)) + associate(prm => param(ph), stt => state(ph), & + dot_xi => dotState(IndexDotState(ph)%xi(1):IndexDotState(ph)%xi(2)),& + dot_chi => dotState(IndexDotState(ph)%chi(1):IndexDotState(ph)%chi(2)),& + dot_gamma => dotState(IndexDotState(ph)%gamma(1):IndexDotState(ph)%gamma(2))) call kinetics(Mp,ph,en,dot_gamma_pos,dot_gamma_neg) - dot%gamma(:,en) = abs(dot_gamma_pos+dot_gamma_neg) + dot_gamma = abs(dot_gamma_pos+dot_gamma_neg) sumGamma = sum(stt%gamma(:,en)) - dot%xi(:,en) = matmul(prm%h_sl_sl,dot%gamma(:,en)) & + dot_xi = matmul(prm%h_sl_sl,dot_gamma) & * ( prm%h_inf_f & + (prm%h_0_f - prm%h_inf_f + prm%h_0_f*prm%h_inf_f*sumGamma/prm%xi_inf_f) & * exp(-sumGamma*prm%h_0_f/prm%xi_inf_f) & ) - dot%chi(:,en) = stt%sgn_gamma(:,en)*dot%gamma(:,en) * & - ( prm%h_inf_b + & - (prm%h_0_b - prm%h_inf_b & + dot_chi = stt%sgn_gamma(:,en)*dot_gamma & + * ( prm%h_inf_b & + + (prm%h_0_b - prm%h_inf_b & + prm%h_0_b*prm%h_inf_b/(prm%xi_inf_b+stt%chi_0(:,en))*(stt%gamma(:,en)-stt%gamma_0(:,en))& ) *exp(-(stt%gamma(:,en)-stt%gamma_0(:,en)) *prm%h_0_b/(prm%xi_inf_b+stt%chi_0(:,en))) & ) end associate -end subroutine plastic_kinehardening_dotState +end function plastic_kinehardening_dotState !-------------------------------------------------------------------------------------------------- diff --git a/src/phase_mechanical_plastic_nonlocal.f90 b/src/phase_mechanical_plastic_nonlocal.f90 index a8f56b5c5..d668e40fe 100644 --- a/src/phase_mechanical_plastic_nonlocal.f90 +++ b/src/phase_mechanical_plastic_nonlocal.f90 @@ -227,8 +227,8 @@ module function plastic_nonlocal_init() result(myPlasticity) st0 => state0(ph), del => deltaState(ph), dst => dependentState(ph)) phase => phases%get(ph) - mech => phase%get('mechanical') - pl => mech%get('plastic') + mech => phase%get('mechanical') + pl => mech%get('plastic') plasticState(ph)%nonlocal = pl%get_asBool('flux',defaultVal=.True.) #if defined (__GFORTRAN__) diff --git a/src/phase_mechanical_plastic_phenopowerlaw.f90 b/src/phase_mechanical_plastic_phenopowerlaw.f90 index 6e79968f3..0b018562c 100644 --- a/src/phase_mechanical_plastic_phenopowerlaw.f90 +++ b/src/phase_mechanical_plastic_phenopowerlaw.f90 @@ -47,6 +47,14 @@ submodule(phase:plastic) phenopowerlaw systems_tw end type tParameters + type :: tIndexDotState + integer, dimension(2) :: & + xi_sl, & + xi_tw, & + gamma_sl, & + gamma_tw + end type tIndexDotState + type :: tPhenopowerlawState real(pReal), pointer, dimension(:,:) :: & xi_sl, & @@ -56,11 +64,10 @@ submodule(phase:plastic) phenopowerlaw end type tPhenopowerlawState !-------------------------------------------------------------------------------------------------- -! containers for parameters and state +! containers for parameters, dot state index, and state type(tParameters), allocatable, dimension(:) :: param - type(tPhenopowerlawState), allocatable, dimension(:) :: & - dotState, & - state + type(tIndexDotState), allocatable, dimension(:) :: indexDotState + type(tPhenopowerlawState), allocatable, dimension(:) :: state contains @@ -101,17 +108,18 @@ module function plastic_phenopowerlaw_init() result(myPlasticity) phases => config_material%get('phase') allocate(param(phases%length)) + allocate(indexDotState(phases%length)) allocate(state(phases%length)) - allocate(dotState(phases%length)) do ph = 1, phases%length if (.not. myPlasticity(ph)) cycle - associate(prm => param(ph), dot => dotState(ph), stt => state(ph)) + associate(prm => param(ph), stt => state(ph), & + idx_dot => indexDotState(ph)) phase => phases%get(ph) - mech => phase%get('mechanical') - pl => mech%get('plastic') + mech => phase%get('mechanical') + pl => mech%get('plastic') !-------------------------------------------------------------------------------------------------- ! slip related parameters @@ -224,37 +232,37 @@ module function plastic_phenopowerlaw_init() result(myPlasticity) + size(['xi_tw ','gamma_tw']) * prm%sum_N_tw sizeState = sizeDotState - call phase_allocateState(plasticState(ph),Nmembers,sizeState,sizeDotState,0) + deallocate(plasticState(ph)%dotState) ! ToDo: remove dotState completely !-------------------------------------------------------------------------------------------------- ! state aliases and initialization startIndex = 1 endIndex = prm%sum_N_sl - stt%xi_sl => plasticState(ph)%state (startIndex:endIndex,:) + idx_dot%xi_sl = [startIndex,endIndex] + stt%xi_sl => plasticState(ph)%state(startIndex:endIndex,:) stt%xi_sl = spread(xi_0_sl, 2, Nmembers) - dot%xi_sl => plasticState(ph)%dotState(startIndex:endIndex,:) plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_xi',defaultVal=1.0_pReal) if(any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_xi' startIndex = endIndex + 1 endIndex = endIndex + prm%sum_N_tw - stt%xi_tw => plasticState(ph)%state (startIndex:endIndex,:) + idx_dot%xi_tw = [startIndex,endIndex] + stt%xi_tw => plasticState(ph)%state(startIndex:endIndex,:) stt%xi_tw = spread(xi_0_tw, 2, Nmembers) - dot%xi_tw => plasticState(ph)%dotState(startIndex:endIndex,:) plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_xi',defaultVal=1.0_pReal) startIndex = endIndex + 1 endIndex = endIndex + prm%sum_N_sl - stt%gamma_sl => plasticState(ph)%state (startIndex:endIndex,:) - dot%gamma_sl => plasticState(ph)%dotState(startIndex:endIndex,:) + idx_dot%gamma_sl = [startIndex,endIndex] + stt%gamma_sl => plasticState(ph)%state(startIndex:endIndex,:) plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_gamma',defaultVal=1.0e-6_pReal) if(any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_gamma' startIndex = endIndex + 1 endIndex = endIndex + prm%sum_N_tw - stt%gamma_tw => plasticState(ph)%state (startIndex:endIndex,:) - dot%gamma_tw => plasticState(ph)%dotState(startIndex:endIndex,:) + idx_dot%gamma_tw = [startIndex,endIndex] + stt%gamma_tw => plasticState(ph)%state(startIndex:endIndex,:) plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_gamma',defaultVal=1.0e-6_pReal) end associate @@ -324,13 +332,15 @@ end subroutine phenopowerlaw_LpAndItsTangent !-------------------------------------------------------------------------------------------------- !> @brief Calculate the rate of change of microstructure. !-------------------------------------------------------------------------------------------------- -module subroutine phenopowerlaw_dotState(Mp,ph,en) +module function phenopowerlaw_dotState(Mp,ph,en) result(dotState) real(pReal), dimension(3,3), intent(in) :: & Mp !< Mandel stress integer, intent(in) :: & ph, & en + real(pReal), dimension(plasticState(ph)%sizeDotState) :: & + dotState real(pReal) :: & xi_sl_sat_offset,& @@ -340,28 +350,32 @@ module subroutine phenopowerlaw_dotState(Mp,ph,en) right_SlipSlip - associate(prm => param(ph), stt => state(ph), dot => dotState(ph)) + associate(prm => param(ph), stt => state(ph), & + dot_xi_sl => dotState(indexDotState(ph)%xi_sl(1):indexDotState(ph)%xi_sl(2)), & + dot_xi_tw => dotState(indexDotState(ph)%xi_tw(1):indexDotState(ph)%xi_tw(2)), & + dot_gamma_sl => dotState(indexDotState(ph)%gamma_sl(1):indexDotState(ph)%gamma_sl(2)), & + dot_gamma_tw => dotState(indexDotState(ph)%gamma_tw(1):indexDotState(ph)%gamma_tw(2))) call kinetics_sl(Mp,ph,en,dot_gamma_sl_pos,dot_gamma_sl_neg) - dot%gamma_sl(:,en) = abs(dot_gamma_sl_pos+dot_gamma_sl_neg) - call kinetics_tw(Mp,ph,en,dot%gamma_tw(:,en)) + dot_gamma_sl = abs(dot_gamma_sl_pos+dot_gamma_sl_neg) + call kinetics_tw(Mp,ph,en,dot_gamma_tw) sumF = sum(stt%gamma_tw(:,en)/prm%gamma_char) xi_sl_sat_offset = prm%f_sat_sl_tw*sqrt(sumF) right_SlipSlip = sign(abs(1.0_pReal-stt%xi_sl(:,en) / (prm%xi_inf_sl+xi_sl_sat_offset))**prm%a_sl, & 1.0_pReal-stt%xi_sl(:,en) / (prm%xi_inf_sl+xi_sl_sat_offset)) - dot%xi_sl(:,en) = prm%h_0_sl_sl * (1.0_pReal + prm%c_1*sumF** prm%c_2) * (1.0_pReal + prm%h_int) & - * matmul(prm%h_sl_sl,dot%gamma_sl(:,en)*right_SlipSlip) & - + matmul(prm%h_sl_tw,dot%gamma_tw(:,en)) + dot_xi_sl = prm%h_0_sl_sl * (1.0_pReal + prm%c_1*sumF** prm%c_2) * (1.0_pReal + prm%h_int) & + * matmul(prm%h_sl_sl,dot_gamma_sl*right_SlipSlip) & + + matmul(prm%h_sl_tw,dot_gamma_tw) - dot%xi_tw(:,en) = prm%h_0_tw_sl * sum(stt%gamma_sl(:,en))**prm%c_3 & - * matmul(prm%h_tw_sl,dot%gamma_sl(:,en)) & - + prm%h_0_tw_tw * sumF**prm%c_4 * matmul(prm%h_tw_tw,dot%gamma_tw(:,en)) + dot_xi_tw = prm%h_0_tw_sl * sum(stt%gamma_sl(:,en))**prm%c_3 & + * matmul(prm%h_tw_sl,dot_gamma_sl) & + + prm%h_0_tw_tw * sumF**prm%c_4 * matmul(prm%h_tw_tw,dot_gamma_tw) end associate -end subroutine phenopowerlaw_dotState +end function phenopowerlaw_dotState !-------------------------------------------------------------------------------------------------- From c25c17d0b6fe2d3eaef9fb6c431bc7049623cb0f Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 5 Feb 2022 10:57:18 +0100 Subject: [PATCH 04/19] reading the gcc manual -mtune is implied by -march, -ffast-math is not recommended, and -mtune=native is save --- cmake/Compiler-GNU.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/Compiler-GNU.cmake b/cmake/Compiler-GNU.cmake index 5e2bf2ce6..a06db2c4e 100644 --- a/cmake/Compiler-GNU.cmake +++ b/cmake/Compiler-GNU.cmake @@ -12,9 +12,9 @@ endif () if (OPTIMIZATION STREQUAL "OFF") set (OPTIMIZATION_FLAGS "-O0") elseif (OPTIMIZATION STREQUAL "DEFENSIVE") - set (OPTIMIZATION_FLAGS "-O2 -mtune=generic -flto") + set (OPTIMIZATION_FLAGS "-O2 -mtune=native -flto") elseif (OPTIMIZATION STREQUAL "AGGRESSIVE") - set (OPTIMIZATION_FLAGS "-O3 -march=native -mtune=native -ffast-math -funroll-loops -ftree-vectorize -flto") + set (OPTIMIZATION_FLAGS "-O3 -march=native -funroll-loops -ftree-vectorize -flto") endif () set (STANDARD_CHECK "-std=f2018 -pedantic-errors" ) @@ -123,6 +123,9 @@ set (DEBUG_FLAGS "${DEBUG_FLAGS} -ffpe-trap=invalid,zero,overflow") set (DEBUG_FLAGS "${DEBUG_FLAGS} -g") # Generate symbolic debugging information in the object file +set (DEBUG_FLAGS "${DEBUG_FLAGS} -Og") +# Optimize debugging experience + set (DEBUG_FLAGS "${DEBUG_FLAGS} -fbacktrace") set (DEBUG_FLAGS "${DEBUG_FLAGS} -fdump-core") set (DEBUG_FLAGS "${DEBUG_FLAGS} -fcheck=all") From f36db86b3c2e4e2f6737e4083a019e8a536ed2d9 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 5 Feb 2022 18:24:24 +0100 Subject: [PATCH 05/19] better debug for gfortran, removing options not needed --- CMakeLists.txt | 2 +- cmake/Compiler-GNU.cmake | 12 +++++------- cmake/Compiler-Intel.cmake | 7 +++++-- cmake/Compiler-IntelLLVM.cmake | 5 ++++- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c7b129f0..b4c405319 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE) if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY") set(DEBUG_FLAGS "${DEBUG_FLAGS} -DDEBUG") set(PARALLEL "OFF") - set(OPTI "OFF") + set(OPTI "DEBUG") elseif(CMAKE_BUILD_TYPE STREQUAL "RELEASE") set(PARALLEL "ON") set(OPTI "DEFENSIVE") diff --git a/cmake/Compiler-GNU.cmake b/cmake/Compiler-GNU.cmake index a06db2c4e..c204d1af2 100644 --- a/cmake/Compiler-GNU.cmake +++ b/cmake/Compiler-GNU.cmake @@ -9,26 +9,24 @@ if (OPENMP) set (OPENMP_FLAGS "-fopenmp") endif () -if (OPTIMIZATION STREQUAL "OFF") +if (OPTIMIZATION STREQUAL "DEBUG") + set (OPTIMIZATION_FLAGS "-Og") +elseif (OPTIMIZATION STREQUAL "OFF") set (OPTIMIZATION_FLAGS "-O0") elseif (OPTIMIZATION STREQUAL "DEFENSIVE") - set (OPTIMIZATION_FLAGS "-O2 -mtune=native -flto") + set (OPTIMIZATION_FLAGS "-O2 -mtune=native") elseif (OPTIMIZATION STREQUAL "AGGRESSIVE") set (OPTIMIZATION_FLAGS "-O3 -march=native -funroll-loops -ftree-vectorize -flto") endif () set (STANDARD_CHECK "-std=f2018 -pedantic-errors" ) -set (LINKER_FLAGS "${LINKER_FLAGS} -Wl") -# options parsed directly to the linker -set (LINKER_FLAGS "${LINKER_FLAGS},-undefined,dynamic_lookup" ) -# ensure to link against dynamic libraries #------------------------------------------------------------------------------------------------ # Fine tuning compilation options set (COMPILE_FLAGS "${COMPILE_FLAGS} -cpp") # preprocessor -set (COMPILE_FLAGS "${COMPILE_FLAGS} -fPIC -fPIE") +set (COMPILE_FLAGS "${COMPILE_FLAGS} -fPIE") # position independent code set (COMPILE_FLAGS "${COMPILE_FLAGS} -ffree-line-length-132") diff --git a/cmake/Compiler-Intel.cmake b/cmake/Compiler-Intel.cmake index 3afffd2be..7f34e4a13 100644 --- a/cmake/Compiler-Intel.cmake +++ b/cmake/Compiler-Intel.cmake @@ -9,12 +9,12 @@ if (OPENMP) set (OPENMP_FLAGS "-qopenmp -parallel") endif () -if (OPTIMIZATION STREQUAL "OFF") +if (OPTIMIZATION STREQUAL "OFF" OR OPTIMIZATION STREQUAL "DEBUG") set (OPTIMIZATION_FLAGS "-O0 -no-ip") elseif (OPTIMIZATION STREQUAL "DEFENSIVE") set (OPTIMIZATION_FLAGS "-O2") elseif (OPTIMIZATION STREQUAL "AGGRESSIVE") - set (OPTIMIZATION_FLAGS "-ipo -O3 -no-prec-div -fp-model fast=2 -xHost") + set (OPTIMIZATION_FLAGS "-ipo -O3 -fp-model fast=2 -xHost") # -fast = -ipo, -O3, -no-prec-div, -static, -fp-model fast=2, and -xHost" endif () @@ -110,6 +110,9 @@ set (DEBUG_FLAGS "${DEBUG_FLAGS} -fpe-all=0") # generate debug information for parameters # Disabled due to ICE when compiling phase_damage.f90 (not understandable, there is no parameter in there) +set (DEBUG_FLAGS "${DEBUG_FLAGS} -debug all") +# generate complete debugging information + # Additional options # -heap-arrays: Should not be done for OpenMP, but set "ulimit -s unlimited" on shell. Probably it helps also to unlimit other limits # -check: Checks at runtime, where diff --git a/cmake/Compiler-IntelLLVM.cmake b/cmake/Compiler-IntelLLVM.cmake index 326cfe319..883873e1c 100644 --- a/cmake/Compiler-IntelLLVM.cmake +++ b/cmake/Compiler-IntelLLVM.cmake @@ -9,7 +9,7 @@ if (OPENMP) set (OPENMP_FLAGS "-qopenmp") endif () -if (OPTIMIZATION STREQUAL "OFF") +if (OPTIMIZATION STREQUAL "OFF" OR OPTIMIZATION STREQUAL "DEBUG") set (OPTIMIZATION_FLAGS "-O0") elseif (OPTIMIZATION STREQUAL "DEFENSIVE") set (OPTIMIZATION_FLAGS "-O2") @@ -109,6 +109,9 @@ set (DEBUG_FLAGS "${DEBUG_FLAGS} -fpe-all=0") set (DEBUG_FLAGS "${DEBUG_FLAGS} -debug-parameters all") # generate debug information for parameters +set (DEBUG_FLAGS "${DEBUG_FLAGS} -debug all") +# generate complete debugging information + # Additional options # -heap-arrays: Should not be done for OpenMP, but set "ulimit -s unlimited" on shell. Probably it helps also to unlimit other limits # -check: Checks at runtime, where From 12e7922fafa6a2b818d437456e14fbf591d6d112 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 5 Feb 2022 18:32:17 +0100 Subject: [PATCH 06/19] use modern Fortran interface not possible for HDF5... --- src/HDF5_utilities.f90 | 33 ++++++++++--------- ...hase_mechanical_eigen_thermalexpansion.f90 | 2 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/HDF5_utilities.f90 b/src/HDF5_utilities.f90 index d2076c2cc..9dc53ee17 100644 --- a/src/HDF5_utilities.f90 +++ b/src/HDF5_utilities.f90 @@ -10,8 +10,9 @@ module HDF5_utilities #include use PETScSys #if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>14) && !defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY) - use MPI + use MPI_f08 #endif + use MPI, only: MPI_INFO_NULL_F90 => MPI_INFO_NULL #endif use prec @@ -162,9 +163,9 @@ integer(HID_T) function HDF5_openFile(fileName,mode,parallel) character, intent(in), optional :: mode logical, intent(in), optional :: parallel - character :: m - integer(HID_T) :: plist_id - integer :: hdferr + character :: m + integer(HID_T) :: plist_id + integer :: hdferr if (present(mode)) then @@ -178,9 +179,9 @@ integer(HID_T) function HDF5_openFile(fileName,mode,parallel) #ifdef PETSC if (present(parallel)) then - if (parallel) call H5Pset_fapl_mpio_f(plist_id, PETSC_COMM_WORLD, MPI_INFO_NULL, hdferr) + if (parallel) call H5Pset_fapl_mpio_f(plist_id, PETSC_COMM_WORLD, MPI_INFO_NULL_F90, hdferr) else - call H5Pset_fapl_mpio_f(plist_id, PETSC_COMM_WORLD, MPI_INFO_NULL, hdferr) + call H5Pset_fapl_mpio_f(plist_id, PETSC_COMM_WORLD, MPI_INFO_NULL_F90, hdferr) end if if(hdferr < 0) error stop 'HDF5 error' #endif @@ -1860,7 +1861,7 @@ subroutine initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_ globalShape !< shape of the dataset (all processes) integer(HID_T), intent(out) :: dset_id, filespace_id, memspace_id, plist_id, aplist_id - integer, dimension(worldsize) :: & + integer(MPI_INTEGER_KIND), dimension(worldsize) :: & readSize !< contribution of all processes integer :: hdferr integer(MPI_INTEGER_KIND) :: err_MPI @@ -1871,13 +1872,13 @@ subroutine initialize_read(dset_id, filespace_id, memspace_id, plist_id, aplist_ if(hdferr < 0) error stop 'HDF5 error' !-------------------------------------------------------------------------------------------------- - readSize = 0 - readSize(worldrank+1) = int(localShape(ubound(localShape,1))) + readSize = 0_MPI_INTEGER_KIND + readSize(worldrank+1) = int(localShape(ubound(localShape,1)),MPI_INTEGER_KIND) #ifdef PETSC if (parallel) then call H5Pset_dxpl_mpio_f(plist_id, H5FD_MPIO_COLLECTIVE_F, hdferr) if(hdferr < 0) error stop 'HDF5 error' - call MPI_allreduce(MPI_IN_PLACE,readSize,worldsize,MPI_INTEGER,MPI_SUM,PETSC_COMM_WORLD,err_MPI) ! get total output size over each process + call MPI_Allreduce(MPI_IN_PLACE,readSize,worldsize,MPI_INTEGER,MPI_SUM,MPI_COMM_WORLD,err_MPI) ! get total output size over each process if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI error' end if #endif @@ -1954,8 +1955,8 @@ subroutine initialize_write(dset_id, filespace_id, memspace_id, plist_id, & totalShape !< shape of the dataset (all processes) integer(HID_T), intent(out) :: dset_id, filespace_id, memspace_id, plist_id - integer, dimension(worldsize) :: writeSize !< contribution of all processes - integer(HID_T) :: dcpl + integer(MPI_INTEGER_KIND), dimension(worldsize) :: writeSize !< contribution of all processes + integer(HID_T) :: dcpl integer :: hdferr integer(MPI_INTEGER_KIND) :: err_MPI integer(HSIZE_T), parameter :: chunkSize = 1024_HSIZE_T**2/8_HSIZE_T @@ -1974,11 +1975,11 @@ subroutine initialize_write(dset_id, filespace_id, memspace_id, plist_id, & !-------------------------------------------------------------------------------------------------- ! determine the global data layout among all processes - writeSize = 0 - writeSize(worldrank+1) = int(myShape(ubound(myShape,1))) + writeSize = 0_MPI_INTEGER_KIND + writeSize(worldrank+1) = int(myShape(ubound(myShape,1)),MPI_INTEGER_KIND) #ifdef PETSC if (parallel) then - call MPI_allreduce(MPI_IN_PLACE,writeSize,worldsize,MPI_INTEGER,MPI_SUM,PETSC_COMM_WORLD,err_MPI) ! get total output size over each process + call MPI_Allreduce(MPI_IN_PLACE,writeSize,worldsize,MPI_INTEGER,MPI_SUM,MPI_COMM_WORLD,err_MPI) ! get total output size over each process if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI error' end if #endif @@ -2009,7 +2010,7 @@ subroutine initialize_write(dset_id, filespace_id, memspace_id, plist_id, & if (hdferr < 0) error stop 'HDF5 error' end if end if - + !-------------------------------------------------------------------------------------------------- ! create dataspace in memory (local shape) and in file (global shape) call H5Screate_simple_f(size(myShape), myShape, memspace_id, hdferr, myShape) diff --git a/src/phase_mechanical_eigen_thermalexpansion.f90 b/src/phase_mechanical_eigen_thermalexpansion.f90 index a5d9868a8..3c422616b 100644 --- a/src/phase_mechanical_eigen_thermalexpansion.f90 +++ b/src/phase_mechanical_eigen_thermalexpansion.f90 @@ -27,7 +27,7 @@ module function thermalexpansion_init(kinematics_length) result(myKinematics) integer, intent(in) :: kinematics_length logical, dimension(:,:), allocatable :: myKinematics - integer :: Ninstances,p,i,k + integer :: Ninstances, p, k class(tNode), pointer :: & phases, & phase, & From 4ca0ea6af238bd1aaef9339d8039fdf06d71328b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 5 Feb 2022 18:32:53 +0100 Subject: [PATCH 07/19] avoid linking issues with gfortran+MPI most likely related to the fact that HDF5 uses the old Fortran inferface, not MPI_f08 as DAMASK --- src/grid/grid_mech_spectral_basic.f90 | 8 +++++++- src/grid/grid_mech_spectral_polarisation.f90 | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/grid/grid_mech_spectral_basic.f90 b/src/grid/grid_mech_spectral_basic.f90 index fa2e17bd9..2f2b73f01 100644 --- a/src/grid/grid_mech_spectral_basic.f90 +++ b/src/grid/grid_mech_spectral_basic.f90 @@ -79,6 +79,12 @@ module grid_mechanical_spectral_basic err_BC, & !< deviation from stress BC err_div !< RMS of div of P +#if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>14) && !defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY) + type(MPI_Status) :: status +#else + integer, dimension(MPI_STATUS_SIZE) :: status +#endif + integer :: & totalIter = 0 !< total iteration in current increment @@ -244,7 +250,7 @@ subroutine grid_mechanical_spectral_basic_init call MPI_File_open(MPI_COMM_WORLD, trim(getSolverJobName())//'.C_ref', & MPI_MODE_RDONLY,MPI_INFO_NULL,fileUnit,err_MPI) if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI error' - call MPI_File_read(fileUnit,C_minMaxAvg,81_MPI_INTEGER_KIND,MPI_DOUBLE,MPI_STATUS_IGNORE,err_MPI) + call MPI_File_read(fileUnit,C_minMaxAvg,81_MPI_INTEGER_KIND,MPI_DOUBLE,status,err_MPI) if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI error' call MPI_File_close(fileUnit,err_MPI) if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI error' diff --git a/src/grid/grid_mech_spectral_polarisation.f90 b/src/grid/grid_mech_spectral_polarisation.f90 index ee87c77a6..b72cc4232 100644 --- a/src/grid/grid_mech_spectral_polarisation.f90 +++ b/src/grid/grid_mech_spectral_polarisation.f90 @@ -90,6 +90,12 @@ module grid_mechanical_spectral_polarisation err_curl, & !< RMS of curl of F err_div !< RMS of div of P +#if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>14) && !defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY) + type(MPI_Status) :: status +#else + integer, dimension(MPI_STATUS_SIZE) :: status +#endif + integer :: & totalIter = 0 !< total iteration in current increment @@ -270,7 +276,7 @@ subroutine grid_mechanical_spectral_polarisation_init call MPI_File_open(MPI_COMM_WORLD, trim(getSolverJobName())//'.C_ref', & MPI_MODE_RDONLY,MPI_INFO_NULL,fileUnit,err_MPI) if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI error' - call MPI_File_read(fileUnit,C_minMaxAvg,81_MPI_INTEGER_KIND,MPI_DOUBLE,MPI_STATUS_IGNORE,err_MPI) + call MPI_File_read(fileUnit,C_minMaxAvg,81_MPI_INTEGER_KIND,MPI_DOUBLE,status,err_MPI) if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI error' call MPI_File_close(fileUnit,err_MPI) if (err_MPI /= 0_MPI_INTEGER_KIND) error stop 'MPI error' From dce0ad921101ec50447e836841a47a25560eb45a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 5 Feb 2022 18:40:10 +0100 Subject: [PATCH 08/19] new PETSc/openMPI version --- .gitlab-ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f3e74e030..8e3884851 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,21 +36,21 @@ variables: # Names of module files to load # =============================================================================================== # ++++++++++++ Compiler +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - COMPILER_GNU: "Compiler/GNU/10" + COMPILER_GNU: "Compiler/GNU/10" COMPILER_INTELLLVM: "Compiler/oneAPI/2022.0.1 Libraries/IMKL/2022.0.1" COMPILER_INTEL: "Compiler/Intel/2022.0.1 Libraries/IMKL/2022.0.1" # ++++++++++++ MPI ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - MPI_GNU: "MPI/GNU/10/OpenMPI/4.1.1" - MPI_INTELLLVM: "MPI/oneAPI/2022.0.1/IntelMPI/2021.5.0" - MPI_INTEL: "MPI/Intel/2022.0.1/IntelMPI/2021.5.0" + MPI_GNU: "MPI/GNU/10/OpenMPI/4.1.2" + MPI_INTELLLVM: "MPI/oneAPI/2022.0.1/IntelMPI/2021.5.0" + MPI_INTEL: "MPI/Intel/2022.0.1/IntelMPI/2021.5.0" # ++++++++++++ PETSc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - PETSC_GNU: "Libraries/PETSc/3.16.1/GNU-10-OpenMPI-4.1.1" + PETSC_GNU: "Libraries/PETSc/3.16.4/GNU-10-OpenMPI-4.1.2" PETSC_INTELLLVM: "Libraries/PETSc/3.16.3/oneAPI-2022.0.1-IntelMPI-2021.5.0" - PETSC_INTEL: "Libraries/PETSc/3.16.3/Intel-2022.0.1-IntelMPI-2021.5.0" + PETSC_INTEL: "Libraries/PETSc/3.16.4/Intel-2022.0.1-IntelMPI-2021.5.0" # ++++++++++++ MSC Marc +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - MSC: "FEM/MSC/2021.3.1" - IntelMarc: "Compiler/Intel/19.1.2 Libraries/IMKL/2020" - HDF5Marc: "HDF5/1.12.1/Intel-19.1.2" + MSC: "FEM/MSC/2021.3.1" + IntelMarc: "Compiler/Intel/19.1.2 Libraries/IMKL/2020" + HDF5Marc: "HDF5/1.12.1/Intel-19.1.2" ################################################################################################### From 519ca6f99044a566a671b2b732644c16ad9852ea Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 5 Feb 2022 20:00:55 +0100 Subject: [PATCH 09/19] ifort does not allow rename of already imported symbols --- src/HDF5_utilities.f90 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/HDF5_utilities.f90 b/src/HDF5_utilities.f90 index 9dc53ee17..93de4053b 100644 --- a/src/HDF5_utilities.f90 +++ b/src/HDF5_utilities.f90 @@ -11,8 +11,8 @@ module HDF5_utilities use PETScSys #if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>14) && !defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY) use MPI_f08 -#endif use MPI, only: MPI_INFO_NULL_F90 => MPI_INFO_NULL +#endif #endif use prec @@ -179,9 +179,15 @@ integer(HID_T) function HDF5_openFile(fileName,mode,parallel) #ifdef PETSC if (present(parallel)) then +#if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>14) && !defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY) if (parallel) call H5Pset_fapl_mpio_f(plist_id, PETSC_COMM_WORLD, MPI_INFO_NULL_F90, hdferr) else call H5Pset_fapl_mpio_f(plist_id, PETSC_COMM_WORLD, MPI_INFO_NULL_F90, hdferr) +#else + if (parallel) call H5Pset_fapl_mpio_f(plist_id, PETSC_COMM_WORLD, MPI_INFO_NULL, hdferr) + else + call H5Pset_fapl_mpio_f(plist_id, PETSC_COMM_WORLD, MPI_INFO_NULL, hdferr) +#endif end if if(hdferr < 0) error stop 'HDF5 error' #endif From 0cf01120295e3de772196cfd849eb7915d1d1979 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 6 Feb 2022 15:20:26 +0100 Subject: [PATCH 10/19] simplified --- src/system_routines.f90 | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/system_routines.f90 b/src/system_routines.f90 index 7a4e41a57..2eb0b7958 100644 --- a/src/system_routines.f90 +++ b/src/system_routines.f90 @@ -24,7 +24,7 @@ module system_routines function setCWD_C(cwd) bind(C) use, intrinsic :: ISO_C_Binding, only: C_INT, C_CHAR - + integer(C_INT) :: setCWD_C character(kind=C_CHAR), dimension(*), intent(in) :: cwd end function setCWD_C @@ -150,14 +150,14 @@ function getUserName() getUserName = c_f_string(getUserName_Cstring) else getUserName = 'n/a (Error!)' - endif + end if end function getUserName !-------------------------------------------------------------------------------------------------- -!> @brief convert C string to Fortran string -!> @details: C string is NULL terminated and, hence, longer by one than the Fortran string +!> @brief Convert C string to Fortran string. +!> @details: C string is NULL terminated and, hence, longer by one than the Fortran string. !-------------------------------------------------------------------------------------------------- pure function c_f_string(c_string) result(f_string) @@ -174,28 +174,23 @@ pure function c_f_string(c_string) result(f_string) else f_string = f_string(:i-1) exit - endif - enddo arrayToString + end if + end do arrayToString end function c_f_string !-------------------------------------------------------------------------------------------------- -!> @brief convert Fortran string to C string -!> @details: C string is NULL terminated and, hence, longer by one than the Fortran string +!> @brief Convert Fortran string to C string. +!> @details: C string is NULL terminated and, hence, longer by one than the Fortran string. !-------------------------------------------------------------------------------------------------- pure function f_c_string(f_string) result(c_string) character(len=*), intent(in) :: f_string character(kind=C_CHAR), dimension(len_trim(f_string)+1) :: c_string - integer :: i - - do i=1,len_trim(f_string) - c_string(i)=f_string(i:i) - enddo - c_string(len_trim(f_string)+1) = C_NULL_CHAR + c_string = transfer(trim(f_string)//C_NULL_CHAR,c_string,size=size(c_string)) end function f_c_string From a37438ca291dc28d8323b06368f4aba514f07823 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 6 Feb 2022 22:07:13 +0100 Subject: [PATCH 11/19] helpful information about the parallel environment --- src/parallelization.f90 | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/parallelization.f90 b/src/parallelization.f90 index 29deaf724..28ad70d94 100644 --- a/src/parallelization.f90 +++ b/src/parallelization.f90 @@ -52,13 +52,13 @@ contains !-------------------------------------------------------------------------------------------------- subroutine parallelization_init - integer(MPI_INTEGER_KIND) :: err_MPI, typeSize + integer(MPI_INTEGER_KIND) :: err_MPI, typeSize, version, subversion, devNull character(len=4) :: rank_str + character(len=MPI_MAX_LIBRARY_VERSION_STRING) :: MPI_library_version !$ integer :: got_env, threadLevel !$ integer(pI32) :: OMP_NUM_THREADS !$ character(len=6) NumThreadsString - PetscErrorCode :: err_PETSc #ifdef _OPENMP ! If openMP is enabled, check if the MPI libary supports it and initialize accordingly. @@ -86,12 +86,22 @@ subroutine parallelization_init if (err_MPI /= 0_MPI_INTEGER_KIND) & error stop 'Could not determine worldrank' - if (worldrank == 0) print'(/,1x,a)', '<<<+- parallelization init -+>>>' + if (worldrank == 0) then + print'(/,1x,a)', '<<<+- parallelization init -+>>>' + + call MPI_Get_library_version(MPI_library_version,devNull,err_MPI) + print'(/,1x,a)', trim(MPI_library_version) + call MPI_Get_version(version,subversion,err_MPI) + print'(1x,a,i0,a,i0)', 'MPI standard: ',version,'.',subversion +#ifdef _OPENMP + print'(1x,a,i0)', 'OpenMP version: ',openmp_version +#endif + end if call MPI_Comm_size(MPI_COMM_WORLD,worldsize,err_MPI) if (err_MPI /= 0_MPI_INTEGER_KIND) & error stop 'Could not determine worldsize' - if (worldrank == 0) print'(/,1x,a,i3)', 'MPI processes: ',worldsize + if (worldrank == 0) print'(/,1x,a,i0)', 'MPI processes: ',worldsize call MPI_Type_size(MPI_INTEGER,typeSize,err_MPI) if (err_MPI /= 0_MPI_INTEGER_KIND) & @@ -128,7 +138,7 @@ subroutine parallelization_init !$ OMP_NUM_THREADS = 4_pI32 !$ endif !$ endif -!$ print'(1x,a,1x,i2)', 'OMP_NUM_THREADS:',OMP_NUM_THREADS +!$ print'(1x,a,i0)', 'OMP_NUM_THREADS: ',OMP_NUM_THREADS !$ call omp_set_num_threads(OMP_NUM_THREADS) end subroutine parallelization_init From 2a59251b1d8a500865738e59f3f1a683ef27d2ce Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 6 Feb 2022 22:23:21 +0100 Subject: [PATCH 12/19] deprecated reporting crystallite does not exist anymore, information was discretization related --- src/CPFEM.f90 | 1 - src/CPFEM2.f90 | 1 - src/phase.f90 | 24 +++++------------------- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/CPFEM.f90 b/src/CPFEM.f90 index 0f7590782..c8b7e3cca 100644 --- a/src/CPFEM.f90 +++ b/src/CPFEM.f90 @@ -90,7 +90,6 @@ subroutine CPFEM_initAll call material_init(.false.) call phase_init call homogenization_init - call crystallite_init call CPFEM_init call config_deallocate diff --git a/src/CPFEM2.f90 b/src/CPFEM2.f90 index ed8fb611b..b24ba5480 100644 --- a/src/CPFEM2.f90 +++ b/src/CPFEM2.f90 @@ -68,7 +68,6 @@ subroutine CPFEM_initAll call material_init(restart=interface_restartInc>0) call phase_init call homogenization_init - call crystallite_init call CPFEM_init call config_deallocate diff --git a/src/phase.f90 b/src/phase.f90 index b7bace81a..e271e6366 100644 --- a/src/phase.f90 +++ b/src/phase.f90 @@ -323,7 +323,6 @@ module phase phase_restore, & plastic_nonlocal_updateCompatibility, & converged, & - crystallite_init, & phase_mechanical_constitutive, & phase_thermal_constitutive, & phase_damage_constitutive, & @@ -401,6 +400,8 @@ subroutine phase_init call damage_init call thermal_init(phases) + call crystallite_init() + end subroutine phase_init @@ -500,22 +501,13 @@ subroutine crystallite_init() ce, & co, & !< counter in integration point component loop ip, & !< counter in integration point loop - el, & !< counter in element loop - cMax, & !< maximum number of integration point components - iMax, & !< maximum number of integration points - eMax !< maximum number of elements + el !< counter in element loop class(tNode), pointer :: & num_crystallite, & phases - print'(/,1x,a)', '<<<+- crystallite init -+>>>' - - cMax = homogenization_maxNconstituents - iMax = discretization_nIPs - eMax = discretization_Nelems - num_crystallite => config_numerics%get('crystallite',defaultVal=emptyDict) num%subStepMinCryst = num_crystallite%get_asFloat ('subStepMin', defaultVal=1.0e-3_pReal) @@ -549,15 +541,9 @@ subroutine crystallite_init() phases => config_material%get('phase') - print'(/,a42,1x,i10)', ' # of elements: ', eMax - print'( a42,1x,i10)', ' # of integration points/element: ', iMax - print'( a42,1x,i10)', 'max # of constituents/integration point: ', cMax - flush(IO_STDOUT) - - !$OMP PARALLEL DO PRIVATE(ce) - do el = 1, eMax - do ip = 1, iMax + do el = 1, discretization_Nelems + do ip = 1, discretization_nIPs ce = (el-1)*discretization_nIPs + ip do co = 1,homogenization_Nconstituents(material_homogenizationID(ce)) call crystallite_orientations(co,ip,el) From 171193d0d74600b6ae09f5c87df27111f0a365a8 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 7 Feb 2022 00:44:17 +0100 Subject: [PATCH 13/19] [skip ci] updated version information after successful test of v3.0.0-alpha5-571-g1edc8442d --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 4e6d4db5e..3bee4feaa 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-568-g2cb3b2cc4 +v3.0.0-alpha5-571-g1edc8442d From e3a9adc7222a145c9b2fd1affa3f4bcb3e7f9e66 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 7 Feb 2022 07:20:15 +0100 Subject: [PATCH 14/19] not used --- src/IO.f90 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/IO.f90 b/src/IO.f90 index ec7cf9704..441a0bf3d 100644 --- a/src/IO.f90 +++ b/src/IO.f90 @@ -584,8 +584,6 @@ subroutine IO_warning(warning_ID,el,ip,g,ext_msg) character(len=pStringLen) :: formatString select case (warning_ID) - case (42) - msg = 'parameter has no effect' case (47) msg = 'no valid parameter for FFTW, using FFTW_PATIENT' case (207) @@ -594,8 +592,6 @@ subroutine IO_warning(warning_ID,el,ip,g,ext_msg) msg = 'crystallite responds elastically' case (601) msg = 'stiffness close to zero' - case (700) - msg = 'unknown crystal symmetry' case (709) msg = 'read only the first document' case default From 345659b0e81a7a75a3d9bb382536d6b38dcb7ce6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 7 Feb 2022 15:09:26 +0100 Subject: [PATCH 15/19] update sta file after each inc --- src/mesh/DAMASK_mesh.f90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesh/DAMASK_mesh.f90 b/src/mesh/DAMASK_mesh.f90 index aa156ec2d..065eca1cb 100644 --- a/src/mesh/DAMASK_mesh.f90 +++ b/src/mesh/DAMASK_mesh.f90 @@ -307,9 +307,11 @@ program DAMASK_mesh guess = .true. ! start guessing after first converged (sub)inc timeIncOld = timeinc end if - if (.not. cutBack .and. worldrank == 0) & + if (.not. cutBack .and. worldrank == 0) then write(statUnit,*) totalIncsCounter, time, cutBackLevel, & solres%converged, solres%iterationsNeeded ! write statistics about accepted solution + flush(statUnit) + endif end do subStepLooping cutBackLevel = max(0, cutBackLevel - 1) ! try half number of subincs next inc From 81c141e3d3c17b89071d5ca82bf7ab4c733a135a Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 8 Feb 2022 17:58:03 +0100 Subject: [PATCH 16/19] [skip ci] updated version information after successful test of v3.0.0-alpha5-574-g13783f87f --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 3bee4feaa..92adbd077 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-571-g1edc8442d +v3.0.0-alpha5-574-g13783f87f From bd657e6c62145f2fa47ee7aa83ae292f5bc511db Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 9 Feb 2022 12:29:55 +0100 Subject: [PATCH 17/19] fixed style and corrected copy and paste errors --- src/grid/DAMASK_grid.f90 | 2 +- src/grid/grid_mech_FEM.f90 | 2 +- src/math.f90 | 2 +- src/phase_mechanical.f90 | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/grid/DAMASK_grid.f90 b/src/grid/DAMASK_grid.f90 index f1834d16b..918f477b1 100644 --- a/src/grid/DAMASK_grid.f90 +++ b/src/grid/DAMASK_grid.f90 @@ -32,7 +32,7 @@ program DAMASK_grid implicit none type :: tLoadCase - type(tRotation) :: rot !< rotation of BC + type(tRotation) :: rot !< rotation of BC type(tBoundaryCondition) :: stress, & !< stress BC deformation !< deformation BC (dot_F, F, or L) real(pReal) :: t, & !< length of increment diff --git a/src/grid/grid_mech_FEM.f90 b/src/grid/grid_mech_FEM.f90 index 6ad035fc2..3c42c8c23 100644 --- a/src/grid/grid_mech_FEM.f90 +++ b/src/grid/grid_mech_FEM.f90 @@ -339,7 +339,7 @@ subroutine grid_mechanical_FEM_forward(cutBack,guess,Delta_t,Delta_t_old,t_remai type(tBoundaryCondition), intent(in) :: & stress_BC, & deformation_BC - type(tRotation), intent(in) :: & + type(tRotation), intent(in) :: & rotation_BC PetscErrorCode :: err_PETSc PetscScalar, pointer, dimension(:,:,:,:) :: & diff --git a/src/math.f90 b/src/math.f90 index 5c6b10fdd..dd4690672 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -898,7 +898,7 @@ end function math_33toVoigt6_stress !-------------------------------------------------------------------------------------------------- -!> @brief Convert 3x3 stress tensor into 6 Voigt vector. +!> @brief Convert 3x3 strain tensor into 6 Voigt vector. !-------------------------------------------------------------------------------------------------- pure function math_33toVoigt6_strain(epsilon) result(epsilon_tilde) diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index 04cc4b946..9a7d1ba62 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -879,10 +879,10 @@ function integrateStateRK(F_0,F,subFp0,subFi0,subState0,Delta_t,co,ip,el,A,B,C,D plasticState(ph)%state(1:sizeDotState,en) = subState0 & + dotState * Delta_t - broken = integrateStress(F_0 + (F - F_0) * Delta_t * C(stage),subFp0,subFi0,Delta_t * C(stage),co,ip,el) + broken = integrateStress(F_0 + (F-F_0) * Delta_t*C(stage),subFp0,subFi0,Delta_t*C(stage),co,ip,el) if(broken) exit - dotState = plastic_dotState(Delta_t, co,ip,el,ph,en) + dotState = plastic_dotState(Delta_t*C(stage), co,ip,el,ph,en) if (any(IEEE_is_NaN(dotState))) exit enddo From 97d17ea50c02a0bb2786ab9f0599f7d374f01296 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 9 Feb 2022 19:45:43 +0100 Subject: [PATCH 18/19] [skip ci] updated version information after successful test of v3.0.0-alpha5-603-ge0ed668ce --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 92adbd077..69974f6be 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-574-g13783f87f +v3.0.0-alpha5-603-ge0ed668ce From 5f7a18c32d56bd6935ccfd766c0c7a554bff0826 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 11 Feb 2022 01:09:25 +0100 Subject: [PATCH 19/19] [skip ci] updated version information after successful test of v3.0.0-alpha5-608-g3e8d1a60d --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 69974f6be..00113e2f3 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-603-ge0ed668ce +v3.0.0-alpha5-608-g3e8d1a60d