From f7a42bdc1ac176339714c035aa9e8401c461d489 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 18 Nov 2021 16:56:36 +0100 Subject: [PATCH] avoid conversion to 3333 --- src/phase.f90 | 10 +++++----- src/phase_damage.f90 | 16 +++++++++------- src/phase_mechanical_elastic.f90 | 5 ++--- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/phase.f90 b/src/phase.f90 index 9c4212c71..2159dba00 100644 --- a/src/phase.f90 +++ b/src/phase.f90 @@ -234,11 +234,11 @@ module phase integer, intent(in) :: ph, en real(pReal), dimension(6,6) :: C end function phase_homogenizedC66 - module function phase_damage_C(C_homogenized,ph,en) result(C) - real(pReal), dimension(3,3,3,3), intent(in) :: C_homogenized - integer, intent(in) :: ph,en - real(pReal), dimension(3,3,3,3) :: C - end function phase_damage_C + module function phase_damage_C66(C66_homogenized,ph,en) result(C66) + real(pReal), dimension(6,6), intent(in) :: C66_homogenized + integer, intent(in) :: ph,en + real(pReal), dimension(6,6) :: C66 + end function phase_damage_C66 module function phase_f_phi(phi,co,ce) result(f) integer, intent(in) :: ce,co diff --git a/src/phase_damage.f90 b/src/phase_damage.f90 index 8e4b66ae1..78322d7f4 100644 --- a/src/phase_damage.f90 +++ b/src/phase_damage.f90 @@ -139,6 +139,7 @@ module function phase_damage_constitutive(Delta_t,co,ip,el) result(converged_) integer :: & ph, en + ph = material_phaseID(co,(el-1)*discretization_nIPs + ip) en = material_phaseEntry(co,(el-1)*discretization_nIPs + ip) @@ -150,20 +151,21 @@ end function phase_damage_constitutive !-------------------------------------------------------------------------------------------------- !> @brief returns the degraded/modified elasticity matrix !-------------------------------------------------------------------------------------------------- -module function phase_damage_C(C_homogenized,ph,en) result(C) +module function phase_damage_C66(C66_homogenized,ph,en) result(C66) + + real(pReal), dimension(6,6), intent(in) :: C66_homogenized + integer, intent(in) :: ph,en + real(pReal), dimension(6,6) :: C66 - real(pReal), dimension(3,3,3,3), intent(in) :: C_homogenized - integer, intent(in) :: ph,en - real(pReal), dimension(3,3,3,3) :: C damageType: select case (phase_damage(ph)) case (DAMAGE_ISOBRITTLE_ID) damageType - C = C_homogenized * damage_phi(ph,en)**2 + C66 = C66_homogenized * damage_phi(ph,en)**2 case default damageType - C = C_homogenized + C66 = C66_homogenized end select damageType -end function phase_damage_C +end function phase_damage_C66 !-------------------------------------------------------------------------------------------------- diff --git a/src/phase_mechanical_elastic.f90 b/src/phase_mechanical_elastic.f90 index c9e5b6490..d7b8d5d1c 100644 --- a/src/phase_mechanical_elastic.f90 +++ b/src/phase_mechanical_elastic.f90 @@ -100,7 +100,7 @@ module function elastic_C66(ph,en) result(C66) integer, intent(in) :: & ph, & en - + real(pReal), dimension(6,6) :: C66 C66 = math_sym3333to66(math_Voigt66to3333(get_C66(ph,en))) ! Literature data is in Voigt notation @@ -166,8 +166,7 @@ module subroutine phase_hooke_SandItsTangents(S, dS_dFe, dS_dFi, & i, j - C = math_66toSym3333(phase_homogenizedC66(ph,en)) - C = phase_damage_C(C,ph,en) + C = math_66toSym3333(phase_damage_C66(phase_homogenizedC66(ph,en),ph,en)) E = 0.5_pReal*(matmul(transpose(Fe),Fe)-math_I3) !< Green-Lagrange strain in unloaded configuration S = math_mul3333xx33(C,matmul(matmul(transpose(Fi),E),Fi)) !< 2PK stress in lattice configuration in work conjugate with GL strain pulled back to lattice configuration