From 957c51fb0783094f34d48e412ecf72ae31fd7ba1 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Fri, 10 Jul 2020 15:13:56 +0200 Subject: [PATCH] cleaner --- src/constitutive_damage.f90 | 33 +++---------------- src/constitutive_plastic.f90 | 61 ++++++------------------------------ src/constitutive_thermal.f90 | 40 ++++------------------- 3 files changed, 19 insertions(+), 115 deletions(-) diff --git a/src/constitutive_damage.f90 b/src/constitutive_damage.f90 index a6264d57d..86ac47aab 100644 --- a/src/constitutive_damage.f90 +++ b/src/constitutive_damage.f90 @@ -137,24 +137,8 @@ end subroutine damage_init !-------------------------------------------------------------------------------------------------- !> @brief contains the constitutive equation for calculating the rate of change of microstructure !-------------------------------------------------------------------------------------------------- -module function damage_dotState(S, FArray, Fi, FpArray, subdt, ipc, ip, el,phase,of) result(broken_damage) +module procedure damage_dotState - integer, intent(in) :: & - ipc, & !< component-ID of integration point - ip, & !< integration point - el, & !< element - phase, & - of - real(pReal), intent(in) :: & - subdt !< timestep - real(pReal), intent(in), dimension(3,3,homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: & - FArray, & !< elastic deformation gradient - FpArray !< plastic deformation gradient - real(pReal), intent(in), dimension(3,3) :: & - Fi !< intermediate deformation gradient - real(pReal), intent(in), dimension(3,3) :: & - S !< 2nd Piola Kirchhoff stress (vector notation) - logical :: broken_damage integer :: i SourceLoop: do i = 1, phase_Nsources(phase) @@ -176,19 +160,10 @@ module function damage_dotState(S, FArray, Fi, FpArray, subdt, ipc, ip, el,phase broken_damage = any(IEEE_is_NaN(sourceState(phase)%p(i)%dotState(:,of))) -end function damage_dotState +end procedure damage_dotState -module subroutine damage_source_getRateAndItsTangents(phiDot, dPhiDot_dPhi, phi, ip, el) - - integer, intent(in) :: & - ip, & !< integration point number - el !< element number - real(pReal), intent(in) :: & - phi - real(pReal), intent(inout) :: & - phiDot, & - dPhiDot_dPhi +module procedure damage_source_getRateAndItsTangents real(pReal) :: & localphiDot, & @@ -229,6 +204,6 @@ module subroutine damage_source_getRateAndItsTangents(phiDot, dPhiDot_dPhi, phi, enddo enddo -end subroutine damage_source_getRateAndItsTangents +end procedure damage_source_getRateAndItsTangents end submodule diff --git a/src/constitutive_plastic.f90 b/src/constitutive_plastic.f90 index 5d190758a..f33e7b32f 100644 --- a/src/constitutive_plastic.f90 +++ b/src/constitutive_plastic.f90 @@ -239,32 +239,14 @@ end subroutine plastic_init !-------------------------------------------------------------------------------------------------- !> @brief contains the constitutive equation for calculating the rate of change of microstructure !-------------------------------------------------------------------------------------------------- -module function plastic_dotState(S, FArray, Fi, FpArray, subdt, ipc, ip, el,phase,of) result(broken_plastic) +module procedure plastic_dotState - integer, intent(in) :: & - ipc, & !< component-ID of integration point - ip, & !< integration point - el, & !< element - phase, & - of - real(pReal), intent(in) :: & - subdt !< timestep - real(pReal), intent(in), dimension(3,3,homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: & - FArray, & !< elastic deformation gradient - FpArray !< plastic deformation gradient - real(pReal), intent(in), dimension(3,3) :: & - Fi !< intermediate deformation gradient - real(pReal), intent(in), dimension(3,3) :: & - S !< 2nd Piola Kirchhoff stress (vector notation) real(pReal), dimension(3,3) :: & Mp integer :: & ho, & !< homogenization tme, & !< thermal member position - i, & !< counter in source loop instance - logical :: broken_plastic - ho = material_homogenizationAt(el) tme = thermalMapping(ho)%p(ip,el) @@ -295,20 +277,14 @@ module function plastic_dotState(S, FArray, Fi, FpArray, subdt, ipc, ip, el,phas end select plasticityType broken_plastic = any(IEEE_is_NaN(plasticState(phase)%dotState(:,of))) -end function plastic_dotState +end procedure plastic_dotState !-------------------------------------------------------------------------------------------------- !> @brief returns the homogenize elasticity matrix !> ToDo: homogenizedC66 would be more consistent !-------------------------------------------------------------------------------------------------- -module function plastic_homogenizedC(ipc,ip,el) result(homogenizedC) - - real(pReal), dimension(6,6) :: homogenizedC - integer, intent(in) :: & - ipc, & !< component-ID of integration point - ip, & !< integration point - el !< element +module procedure plastic_homogenizedC plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el))) case (PLASTICITY_DISLOTWIN_ID) plasticityType @@ -317,21 +293,14 @@ module function plastic_homogenizedC(ipc,ip,el) result(homogenizedC) homogenizedC = lattice_C66(1:6,1:6,material_phaseAt(ipc,el)) end select plasticityType -end function plastic_homogenizedC +end procedure plastic_homogenizedC !-------------------------------------------------------------------------------------------------- !> @brief calls microstructure function of the different constitutive models !-------------------------------------------------------------------------------------------------- -module subroutine plastic_dependentState(F, Fp, ipc, ip, el) +module procedure plastic_dependentState - integer, intent(in) :: & - ipc, & !< component-ID of integration point - ip, & !< integration point - el !< element - real(pReal), intent(in), dimension(3,3) :: & - F, & !< elastic deformation gradient - Fp !< plastic deformation gradient integer :: & ho, & !< homogenization tme, & !< thermal member position @@ -351,27 +320,15 @@ module subroutine plastic_dependentState(F, Fp, ipc, ip, el) call plastic_nonlocal_dependentState (F,Fp,instance,of,ip,el) end select plasticityType -end subroutine plastic_dependentState +end procedure plastic_dependentState !-------------------------------------------------------------------------------------------------- !> @brief contains the constitutive equation for calculating the velocity gradient ! ToDo: Discuss whether it makes sense if crystallite handles the configuration conversion, i.e. ! Mp in, dLp_dMp out !-------------------------------------------------------------------------------------------------- -module subroutine plastic_LpAndItsTangents(Lp, dLp_dS, dLp_dFi, & - S, Fi, ipc, ip, el) - integer, intent(in) :: & - ipc, & !< component-ID of integration point - ip, & !< integration point - el !< element - real(pReal), intent(in), dimension(3,3) :: & - S, & !< 2nd Piola-Kirchhoff stress - Fi !< intermediate deformation gradient - real(pReal), intent(out), dimension(3,3) :: & - Lp !< plastic velocity gradient - real(pReal), intent(out), dimension(3,3,3,3) :: & - dLp_dS, & - dLp_dFi !< derivative of Lp with respect to Fi +module procedure plastic_LpAndItsTangents + real(pReal), dimension(3,3,3,3) :: & dLp_dMp !< derivative of Lp with respect to Mandel stress real(pReal), dimension(3,3) :: & @@ -421,7 +378,7 @@ module subroutine plastic_LpAndItsTangents(Lp, dLp_dS, dLp_dFi, & dLp_dS(i,j,1:3,1:3) = matmul(matmul(transpose(Fi),Fi),dLp_dMp(i,j,1:3,1:3)) ! ToDo: @PS: why not: dLp_dMp:(FiT Fi) enddo; enddo -end subroutine plastic_LpAndItsTangents +end procedure plastic_LpAndItsTangents end submodule constitutive_plastic diff --git a/src/constitutive_thermal.f90 b/src/constitutive_thermal.f90 index 7891ebba4..4a34ac224 100644 --- a/src/constitutive_thermal.f90 +++ b/src/constitutive_thermal.f90 @@ -64,24 +64,8 @@ end subroutine thermal_init !-------------------------------------------------------------------------------------------------- !> @brief contains the constitutive equation for calculating the rate of change of microstructure !-------------------------------------------------------------------------------------------------- -module function thermal_dotState(S, FArray, Fi, FpArray, subdt, ipc, ip, el,phase,of) result(broken_thermal) +module procedure thermal_dotState - integer, intent(in) :: & - ipc, & !< component-ID of integration point - ip, & !< integration point - el, & !< element - phase, & - of - real(pReal), intent(in) :: & - subdt !< timestep - real(pReal), intent(in), dimension(3,3,homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: & - FArray, & !< elastic deformation gradient - FpArray !< plastic deformation gradient - real(pReal), intent(in), dimension(3,3) :: & - Fi !< intermediate deformation gradient - real(pReal), intent(in), dimension(3,3) :: & - S !< 2nd Piola Kirchhoff stress (vector notation) - logical :: broken_thermal integer :: i SourceLoop: do i = 1, phase_Nsources(phase) @@ -93,26 +77,14 @@ module function thermal_dotState(S, FArray, Fi, FpArray, subdt, ipc, ip, el,phas end select sourceType - broken_thermal = any(IEEE_is_NaN(sourceState(phase)%p(i)%dotState(:,of))) - enddo sourceLoop -end function thermal_dotState + broken_thermal = any(IEEE_is_NaN(sourceState(phase)%p(i)%dotState(:,of))) + +end procedure thermal_dotState -module subroutine thermal_source_getRateAndItsTangents(Tdot, dTdot_dT, T, Tstar, Lp, ip, el) - - integer, intent(in) :: & - ip, & !< integration point number - el !< element number - real(pReal), intent(in) :: & - T - real(pReal), intent(in), dimension(:,:,:,:,:) :: & - Tstar, & - Lp - real(pReal), intent(inout) :: & - Tdot, & - dTdot_dT +module procedure thermal_source_getRateAndItsTangents real(pReal) :: & my_Tdot, & @@ -152,6 +124,6 @@ module subroutine thermal_source_getRateAndItsTangents(Tdot, dTdot_dT, T, Tstar, enddo enddo -end subroutine thermal_source_getRateAndItsTangents +end procedure thermal_source_getRateAndItsTangents end submodule