From 983b59fe1efaf03395a5a0cf338fc9b340f3a341 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 24 Jan 2021 11:19:10 +0100 Subject: [PATCH] simpler access pattern --- src/constitutive.f90 | 14 +++----------- src/constitutive_mech.f90 | 6 ++++-- src/kinematics_thermal_expansion.f90 | 20 +++++++------------- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/constitutive.f90 b/src/constitutive.f90 index 16278957a..e05336cc2 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -245,9 +245,6 @@ module constitutive end function constitutive_homogenizedC - - - module subroutine constitutive_damage_getRateAndItsTangents(phiDot, dPhiDot_dPhi, phi, ip, el) integer, intent(in) :: & ip, & !< integration point number @@ -317,11 +314,9 @@ module constitutive dLd_dTstar !< derivative of Ld with respect to Tstar (4th-order tensor) end subroutine kinematics_slipplane_opening_LiAndItsTangent - module subroutine kinematics_thermal_expansion_LiAndItsTangent(Li, dLi_dTstar, co, ip, el) - integer, intent(in) :: & - co, & !< grain number - ip, & !< integration point number - el !< element number + module subroutine kinematics_thermal_expansion_LiAndItsTangent(Li, dLi_dTstar, ph,me) + integer, intent(in) :: ph, me + !< element number real(pReal), intent(out), dimension(3,3) :: & Li !< thermal velocity gradient real(pReal), intent(out), dimension(3,3,3,3) :: & @@ -764,9 +759,6 @@ function crystallite_push33ToRef(co,ip,el, tensor33) end function crystallite_push33ToRef - - - !-------------------------------------------------------------------------------------------------- !> @brief determines whether a point is converged !-------------------------------------------------------------------------------------------------- diff --git a/src/constitutive_mech.f90 b/src/constitutive_mech.f90 index d54367ad6..fe07d2328 100644 --- a/src/constitutive_mech.f90 +++ b/src/constitutive_mech.f90 @@ -1959,7 +1959,7 @@ subroutine constitutive_LiAndItsTangents(Li, dLi_dS, dLi_dFi, & detFi integer :: & k, i, j, & - instance, of + instance, of, me, ph Li = 0.0_pReal dLi_dS = 0.0_pReal @@ -1985,7 +1985,9 @@ subroutine constitutive_LiAndItsTangents(Li, dLi_dS, dLi_dFi, & case (KINEMATICS_slipplane_opening_ID) kinematicsType call kinematics_slipplane_opening_LiAndItsTangent(my_Li, my_dLi_dS, S, co, ip, el) case (KINEMATICS_thermal_expansion_ID) kinematicsType - call kinematics_thermal_expansion_LiAndItsTangent(my_Li, my_dLi_dS, co, ip, el) + me = material_phaseMemberAt(co,ip,el) + ph = material_phaseAt(co,el) + call kinematics_thermal_expansion_LiAndItsTangent(my_Li, my_dLi_dS, ph,me) case default kinematicsType my_Li = 0.0_pReal my_dLi_dS = 0.0_pReal diff --git a/src/kinematics_thermal_expansion.f90 b/src/kinematics_thermal_expansion.f90 index 6d4a39632..6e4fa8263 100644 --- a/src/kinematics_thermal_expansion.f90 +++ b/src/kinematics_thermal_expansion.f90 @@ -84,12 +84,9 @@ end function kinematics_thermal_expansion_init !-------------------------------------------------------------------------------------------------- !> @brief constitutive equation for calculating the velocity gradient !-------------------------------------------------------------------------------------------------- -module subroutine kinematics_thermal_expansion_LiAndItsTangent(Li, dLi_dTstar, co, ip, el) +module subroutine kinematics_thermal_expansion_LiAndItsTangent(Li, dLi_dTstar, ph,me) - integer, intent(in) :: & - co, & !< grain number - ip, & !< integration point number - el !< element number + integer, intent(in) :: ph, me real(pReal), intent(out), dimension(3,3) :: & Li !< thermal velocity gradient real(pReal), intent(out), dimension(3,3,3,3) :: & @@ -98,16 +95,13 @@ module subroutine kinematics_thermal_expansion_LiAndItsTangent(Li, dLi_dTstar, c integer :: & phase, & homog - real(pReal) :: & - T, TDot + real(pReal) :: T, dot_T - phase = material_phaseAt(co,el) - homog = material_homogenizationAt(el) - T = temperature(homog)%p(material_homogenizationMemberAt(ip,el)) - TDot = temperatureRate(homog)%p(material_homogenizationMemberAt(ip,el)) + T = current(ph)%T(me) + dot_T = current(ph)%dot_T(me) - associate(prm => param(kinematics_thermal_expansion_instance(phase))) - Li = TDot * ( & + associate(prm => param(kinematics_thermal_expansion_instance(ph))) + Li = dot_T * ( & prm%A(1:3,1:3,1)*(T - prm%T_ref)**0 & ! constant coefficient + prm%A(1:3,1:3,2)*(T - prm%T_ref)**1 & ! linear coefficient + prm%A(1:3,1:3,3)*(T - prm%T_ref)**2 & ! quadratic coefficient