From 5602abe690b48c76b60c3c0d8d9fa841519e924c Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Sun, 12 Jul 2020 13:27:28 +0200 Subject: [PATCH] generic interfaces makes sense --- src/constitutive.f90 | 23 +++++++++++++++++------ src/constitutive_plastic.f90 | 8 ++++---- src/damage_local.f90 | 2 +- src/damage_nonlocal.f90 | 2 +- src/thermal_adiabatic.f90 | 2 +- src/thermal_conduction.f90 | 2 +- 6 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/constitutive.f90 b/src/constitutive.f90 index 62e9c661f..cb970957f 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -140,7 +140,7 @@ module constitutive el !< element end function plastic_dislotwin_homogenizedC - module subroutine constitutive_dependentState(F, Fp, ipc, ip, el) + module subroutine constitutive_plastic_dependentState(F, Fp, ipc, ip, el) integer, intent(in) :: & ipc, & !< component-ID of integration point @@ -149,9 +149,9 @@ module constitutive real(pReal), intent(in), dimension(3,3) :: & F, & !< elastic deformation gradient Fp !< plastic deformation gradient - end subroutine constitutive_dependentState + end subroutine constitutive_plastic_dependentState - module subroutine constitutive_LpAndItsTangents(Lp, dLp_dS, dLp_dFi, & + module subroutine constitutive_plastic_LpAndItsTangents(Lp, dLp_dS, dLp_dFi, & S, Fi, ipc, ip, el) integer, intent(in) :: & ipc, & !< component-ID of integration point @@ -166,7 +166,7 @@ module constitutive dLp_dS, & dLp_dFi !< derivative of Lp with respect to Fi - end subroutine constitutive_LpAndItsTangents + end subroutine constitutive_plastic_LpAndItsTangents pure module function kinematics_thermal_expansion_initialStrain(homog,phase,offset) result(initialStrain) @@ -351,6 +351,18 @@ module constitutive end interface + interface constitutive_LpAndItsTangents + module procedure :: constitutive_plastic_LpAndItsTangents + end interface constitutive_LpAndItsTangents + + interface constitutive_dependentState + module procedure :: constitutive_plastic_dependentState + end interface constitutive_dependentState + + interface constitutive_getRateAndItsTangents + module procedure :: constitutive_damage_getRateAndItsTangents , & + constitutive_thermal_getRateAndItsTangents + end interface constitutive_getRateAndItsTangents type :: tDebugOptions logical :: & @@ -376,8 +388,7 @@ module constitutive constitutive_collectDotState, & constitutive_deltaState, & plastic_nonlocal_updateCompatibility, & - constitutive_damage_getRateAndItsTangents, & - constitutive_thermal_getRateAndItsTangents, & + constitutive_getRateAndItsTangents, & constitutive_results contains diff --git a/src/constitutive_plastic.f90 b/src/constitutive_plastic.f90 index 7ede355e1..ad7e5a54b 100644 --- a/src/constitutive_plastic.f90 +++ b/src/constitutive_plastic.f90 @@ -171,7 +171,7 @@ end subroutine plastic_init !-------------------------------------------------------------------------------------------------- !> @brief calls microstructure function of the different constitutive models !-------------------------------------------------------------------------------------------------- -module procedure constitutive_dependentState +module procedure constitutive_plastic_dependentState integer :: & ho, & !< homogenization @@ -192,14 +192,14 @@ module procedure constitutive_dependentState call plastic_nonlocal_dependentState (F,Fp,instance,of,ip,el) end select plasticityType -end procedure constitutive_dependentState +end procedure constitutive_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 procedure constitutive_LpAndItsTangents +module procedure constitutive_plastic_LpAndItsTangents real(pReal), dimension(3,3,3,3) :: & dLp_dMp !< derivative of Lp with respect to Mandel stress @@ -250,7 +250,7 @@ module procedure constitutive_LpAndItsTangents 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 procedure constitutive_LpAndItsTangents +end procedure constitutive_plastic_LpAndItsTangents end submodule constitutive_plastic diff --git a/src/damage_local.f90 b/src/damage_local.f90 index 66b50064b..3d448f7a4 100644 --- a/src/damage_local.f90 +++ b/src/damage_local.f90 @@ -131,7 +131,7 @@ subroutine damage_local_getSourceAndItsTangent(phiDot, dPhiDot_dPhi, phi, ip, el phiDot = 0.0_pReal dPhiDot_dPhi = 0.0_pReal - call constitutive_damage_getRateAndItsTangents(phiDot, dPhiDot_dPhi, phi, ip, el) + call constitutive_getRateAndItsTangents(phiDot, dPhiDot_dPhi, phi, ip, el) phiDot = phiDot/real(homogenization_Ngrains(material_homogenizationAt(el)),pReal) dPhiDot_dPhi = dPhiDot_dPhi/real(homogenization_Ngrains(material_homogenizationAt(el)),pReal) diff --git a/src/damage_nonlocal.f90 b/src/damage_nonlocal.f90 index 914133de7..530a79899 100644 --- a/src/damage_nonlocal.f90 +++ b/src/damage_nonlocal.f90 @@ -100,7 +100,7 @@ subroutine damage_nonlocal_getSourceAndItsTangent(phiDot, dPhiDot_dPhi, phi, ip, phiDot = 0.0_pReal dPhiDot_dPhi = 0.0_pReal - call constitutive_damage_getRateAndItsTangents(phiDot, dPhiDot_dPhi, phi, ip, el) + call constitutive_getRateAndItsTangents(phiDot, dPhiDot_dPhi, phi, ip, el) phiDot = phiDot/real(homogenization_Ngrains(material_homogenizationAt(el)),pReal) dPhiDot_dPhi = dPhiDot_dPhi/real(homogenization_Ngrains(material_homogenizationAt(el)),pReal) diff --git a/src/thermal_adiabatic.f90 b/src/thermal_adiabatic.f90 index c52f0a3d0..9e4710a1e 100644 --- a/src/thermal_adiabatic.f90 +++ b/src/thermal_adiabatic.f90 @@ -131,7 +131,7 @@ subroutine thermal_adiabatic_getSourceAndItsTangent(Tdot, dTdot_dT, T, ip, el) dTdot_dT = 0.0_pReal homog = material_homogenizationAt(el) - call constitutive_thermal_getRateAndItsTangents(TDot, dTDot_dT, T, crystallite_S, crystallite_Lp, ip, el) + call constitutive_getRateAndItsTangents(TDot, dTDot_dT, T, crystallite_S, crystallite_Lp, ip, el) Tdot = Tdot/real(homogenization_Ngrains(homog),pReal) dTdot_dT = dTdot_dT/real(homogenization_Ngrains(homog),pReal) diff --git a/src/thermal_conduction.f90 b/src/thermal_conduction.f90 index 60766710d..2afe411f1 100644 --- a/src/thermal_conduction.f90 +++ b/src/thermal_conduction.f90 @@ -90,7 +90,7 @@ subroutine thermal_conduction_getSourceAndItsTangent(Tdot, dTdot_dT, T, ip, el) dTdot_dT = 0.0_pReal homog = material_homogenizationAt(el) - call constitutive_thermal_getRateAndItsTangents(TDot, dTDot_dT, T, crystallite_S,crystallite_Lp ,ip, el) + call constitutive_getRateAndItsTangents(TDot, dTDot_dT, T, crystallite_S,crystallite_Lp ,ip, el) Tdot = Tdot/real(homogenization_Ngrains(homog),pReal) dTdot_dT = dTdot_dT/real(homogenization_Ngrains(homog),pReal)