avoid conversions
This commit is contained in:
parent
038dd1fc40
commit
fa8218124a
|
@ -643,17 +643,17 @@ module function RGC_updateState(P,F,avgF,dt,dPdF,ce) result(doneAndHappy)
|
||||||
!-------------------------------------------------------------------------------------------------
|
!-------------------------------------------------------------------------------------------------
|
||||||
!> @brief compute the equivalent shear and bulk moduli from the elasticity tensor
|
!> @brief compute the equivalent shear and bulk moduli from the elasticity tensor
|
||||||
!-------------------------------------------------------------------------------------------------
|
!-------------------------------------------------------------------------------------------------
|
||||||
real(pReal) function equivalentMu(grainID,ce)
|
real(pReal) function equivalentMu(co,ce)
|
||||||
|
|
||||||
integer, intent(in) :: &
|
integer, intent(in) :: &
|
||||||
grainID,&
|
co,&
|
||||||
ce
|
ce
|
||||||
|
|
||||||
real(pReal), dimension(6,6) :: C
|
real(pReal), dimension(6,6) :: C
|
||||||
|
|
||||||
|
|
||||||
C = phase_homogenizedC66(material_phaseID(grainID,ce),material_phaseEntry(grainID,ce))
|
C = phase_homogenizedC66(material_phaseID(co,ce),material_phaseEntry(co,ce))
|
||||||
equivalentMu = lattice_equivalent_mu(C,'voigt')
|
equivalentMu = lattice_equivalent_mu(math_sym3333to66(math_Voigt66to3333(C)),'voigt') !ToDo: Bug, should be Voigt not sym
|
||||||
|
|
||||||
end function equivalentMu
|
end function equivalentMu
|
||||||
|
|
||||||
|
|
|
@ -234,10 +234,10 @@ module phase
|
||||||
integer, intent(in) :: ph, en
|
integer, intent(in) :: ph, en
|
||||||
real(pReal), dimension(6,6) :: C
|
real(pReal), dimension(6,6) :: C
|
||||||
end function phase_homogenizedC66
|
end function phase_homogenizedC66
|
||||||
module function phase_damage_C66(C66,ph,en)
|
module function phase_damage_C66(C66,ph,en) result(C66_degraded)
|
||||||
real(pReal), dimension(6,6), intent(in) :: C66
|
real(pReal), dimension(6,6), intent(in) :: C66
|
||||||
integer, intent(in) :: ph,en
|
integer, intent(in) :: ph,en
|
||||||
real(pReal), dimension(6,6) :: phase_damage_C66
|
real(pReal), dimension(6,6) :: C66_degraded
|
||||||
end function phase_damage_C66
|
end function phase_damage_C66
|
||||||
|
|
||||||
module function phase_f_phi(phi,co,ce) result(f)
|
module function phase_f_phi(phi,co,ce) result(f)
|
||||||
|
|
|
@ -151,18 +151,18 @@ end function phase_damage_constitutive
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief returns the degraded/modified elasticity matrix
|
!> @brief returns the degraded/modified elasticity matrix
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module function phase_damage_C66(C66,ph,en)
|
module function phase_damage_C66(C66,ph,en) result(C66_degraded)
|
||||||
|
|
||||||
real(pReal), dimension(6,6), intent(in) :: C66
|
real(pReal), dimension(6,6), intent(in) :: C66
|
||||||
integer, intent(in) :: ph,en
|
integer, intent(in) :: ph,en
|
||||||
real(pReal), dimension(6,6) :: phase_damage_C66
|
real(pReal), dimension(6,6) :: C66_degraded
|
||||||
|
|
||||||
|
|
||||||
damageType: select case (phase_damage(ph))
|
damageType: select case (phase_damage(ph))
|
||||||
case (DAMAGE_ISOBRITTLE_ID) damageType
|
case (DAMAGE_ISOBRITTLE_ID) damageType
|
||||||
phase_damage_C66 = C66 * damage_phi(ph,en)**2
|
C66_degraded = C66 * damage_phi(ph,en)**2
|
||||||
case default damageType
|
case default damageType
|
||||||
phase_damage_C66 = C66
|
C66_degraded = C66
|
||||||
end select damageType
|
end select damageType
|
||||||
|
|
||||||
end function phase_damage_C66
|
end function phase_damage_C66
|
||||||
|
|
|
@ -96,6 +96,7 @@ end function isobrittle_init
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief calculates derived quantities from state
|
!> @brief calculates derived quantities from state
|
||||||
|
! ToDo: Use Voigt directly
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
module subroutine isobrittle_deltaState(C, Fe, ph,en)
|
module subroutine isobrittle_deltaState(C, Fe, ph,en)
|
||||||
|
|
||||||
|
@ -109,13 +110,16 @@ module subroutine isobrittle_deltaState(C, Fe, ph,en)
|
||||||
epsilon
|
epsilon
|
||||||
real(pReal) :: &
|
real(pReal) :: &
|
||||||
r_W
|
r_W
|
||||||
|
real(pReal), dimension(6,6) :: &
|
||||||
|
C_sym
|
||||||
|
|
||||||
|
|
||||||
|
C_sym = math_sym3333to66(math_Voigt66to3333(C))
|
||||||
epsilon = 0.5_pReal*math_sym33to6(matmul(transpose(Fe),Fe)-math_I3)
|
epsilon = 0.5_pReal*math_sym33to6(matmul(transpose(Fe),Fe)-math_I3)
|
||||||
|
|
||||||
associate(prm => param(ph), stt => state(ph), dlt => deltaState(ph))
|
associate(prm => param(ph), stt => state(ph), dlt => deltaState(ph))
|
||||||
|
|
||||||
r_W = 2.0_pReal*dot_product(epsilon,matmul(C,epsilon))/prm%W_crit
|
r_W = 2.0_pReal*dot_product(epsilon,matmul(C_sym,epsilon))/prm%W_crit
|
||||||
dlt%r_W(en) = merge(r_W - stt%r_W(en), 0.0_pReal, r_W > stt%r_W(en))
|
dlt%r_W(en) = merge(r_W - stt%r_W(en), 0.0_pReal, r_W > stt%r_W(en))
|
||||||
|
|
||||||
end associate
|
end associate
|
||||||
|
|
|
@ -152,12 +152,12 @@ module subroutine phase_hooke_SandItsTangents(S, dS_dFe, dS_dFi, &
|
||||||
i, j
|
i, j
|
||||||
|
|
||||||
|
|
||||||
C = math_66toSym3333(phase_damage_C66(phase_homogenizedC66(ph,en),ph,en))
|
C = math_Voigt66to3333(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
|
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
|
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
|
||||||
|
|
||||||
do i =1, 3;do j=1,3
|
do i =1,3; do j=1,3
|
||||||
dS_dFe(i,j,1:3,1:3) = matmul(Fe,matmul(matmul(Fi,C(i,j,1:3,1:3)),transpose(Fi))) !< dS_ij/dFe_kl = C_ijmn * Fi_lm * Fi_on * Fe_ko
|
dS_dFe(i,j,1:3,1:3) = matmul(Fe,matmul(matmul(Fi,C(i,j,1:3,1:3)),transpose(Fi))) !< dS_ij/dFe_kl = C_ijmn * Fi_lm * Fi_on * Fe_ko
|
||||||
dS_dFi(i,j,1:3,1:3) = 2.0_pReal*matmul(matmul(E,Fi),C(i,j,1:3,1:3)) !< dS_ij/dFi_kl = C_ijln * E_km * Fe_mn
|
dS_dFi(i,j,1:3,1:3) = 2.0_pReal*matmul(matmul(E,Fi),C(i,j,1:3,1:3)) !< dS_ij/dFi_kl = C_ijln * E_km * Fe_mn
|
||||||
end do; end do
|
end do; end do
|
||||||
|
@ -176,9 +176,9 @@ module function phase_homogenizedC66(ph,en) result(C)
|
||||||
|
|
||||||
plasticType: select case (phase_plasticity(ph))
|
plasticType: select case (phase_plasticity(ph))
|
||||||
case (PLASTICITY_DISLOTWIN_ID) plasticType
|
case (PLASTICITY_DISLOTWIN_ID) plasticType
|
||||||
C = plastic_dislotwin_homogenizedC(ph,en)
|
C = math_3333toVoigt66(math_66toSym3333(plastic_dislotwin_homogenizedC(ph,en)))
|
||||||
case default plasticType
|
case default plasticType
|
||||||
C = math_sym3333to66(math_Voigt66to3333(elastic_C66(ph,en)))
|
C = elastic_C66(ph,en)
|
||||||
end select plasticType
|
end select plasticType
|
||||||
|
|
||||||
end function phase_homogenizedC66
|
end function phase_homogenizedC66
|
||||||
|
|
Loading…
Reference in New Issue