consistent access via (ph)ase and phase(me)mber

This commit is contained in:
Martin Diehl 2021-01-19 10:14:34 +01:00
parent d2ae859b1c
commit 494ed244a0
5 changed files with 32 additions and 38 deletions

View File

@ -229,8 +229,8 @@ module constitutive
logical :: converged_
end function crystallite_stress
module function constitutive_homogenizedC(co,ip,el) result(C)
integer, intent(in) :: co, ip, el
module function constitutive_homogenizedC(ph,me) result(C)
integer, intent(in) :: ph, me
real(pReal), dimension(6,6) :: C
end function constitutive_homogenizedC

View File

@ -436,7 +436,8 @@ function constitutive_damage_deltaState(Fe, co, ip, el, ph, of) result(broken)
sourceType: select case (phase_source(so,ph))
case (DAMAGE_ISOBRITTLE_ID) sourceType
call source_damage_isoBrittle_deltaState (constitutive_homogenizedC(co,ip,el), Fe, &
call source_damage_isoBrittle_deltaState (constitutive_homogenizedC(material_phaseAt(co,el), &
material_phaseMemberAt(co,ip,el)), Fe, &
co, ip, el)
broken = any(IEEE_is_NaN(damageState(ph)%p(so)%deltaState(:,of)))
if(.not. broken) then

View File

@ -307,13 +307,9 @@ submodule(constitutive) constitutive_mech
character(len=*), intent(in) :: group
end subroutine plastic_nonlocal_results
module function plastic_dislotwin_homogenizedC(co,ip,el) result(homogenizedC)
real(pReal), dimension(6,6) :: &
homogenizedC
integer, intent(in) :: &
co, & !< component-ID of integration point
ip, & !< integration point
el !< element
module function plastic_dislotwin_homogenizedC(ph,me) result(homogenizedC)
real(pReal), dimension(6,6) :: homogenizedC
integer, intent(in) :: ph,me
end function plastic_dislotwin_homogenizedC
@ -559,16 +555,16 @@ subroutine constitutive_hooke_SandItsTangents(S, dS_dFe, dS_dFi, &
real(pReal), intent(out), dimension(3,3,3,3) :: &
dS_dFe, & !< derivative of 2nd P-K stress with respect to elastic deformation gradient
dS_dFi !< derivative of 2nd P-K stress with respect to intermediate deformation gradient
real(pReal), dimension(3,3) :: E
real(pReal), dimension(3,3,3,3) :: C
integer :: &
ho, & !< homogenization
d !< counter in degradation loop
integer :: &
i, j
d, & !< counter in degradation loop
i, j, ph, me
ho = material_homogenizationAt(el)
C = math_66toSym3333(constitutive_homogenizedC(co,ip,el))
C = math_66toSym3333(constitutive_homogenizedC(material_phaseAt(co,el),material_phaseMemberAt(co,ip,el)))
DegradationLoop: do d = 1, phase_NstiffnessDegradations(material_phaseAt(co,el))
degradationType: select case(phase_stiffnessDegradation(d,material_phaseAt(co,el)))
@ -1535,19 +1531,16 @@ end subroutine mech_forward
!> @brief returns the homogenize elasticity matrix
!> ToDo: homogenizedC66 would be more consistent
!--------------------------------------------------------------------------------------------------
module function constitutive_homogenizedC(co,ip,el) result(C)
module function constitutive_homogenizedC(ph,me) result(C)
real(pReal), dimension(6,6) :: C
integer, intent(in) :: &
co, & !< component-ID of integration point
ip, & !< integration point
el !< element
integer, intent(in) :: ph, me
plasticityType: select case (phase_plasticity(material_phaseAt(co,el)))
plasticityType: select case (phase_plasticity(ph))
case (PLASTICITY_DISLOTWIN_ID) plasticityType
C = plastic_dislotwin_homogenizedC(co,ip,el)
C = plastic_dislotwin_homogenizedC(ph,me)
case default plasticityType
C = lattice_C66(1:6,1:6,material_phaseAt(co,el))
C = lattice_C66(1:6,1:6,ph)
end select plasticityType
end function constitutive_homogenizedC

View File

@ -485,35 +485,32 @@ end function plastic_dislotwin_init
!--------------------------------------------------------------------------------------------------
!> @brief Return the homogenized elasticity matrix.
!--------------------------------------------------------------------------------------------------
module function plastic_dislotwin_homogenizedC(co,ip,el) result(homogenizedC)
module function plastic_dislotwin_homogenizedC(ph,me) result(homogenizedC)
integer, intent(in) :: &
ph, me
real(pReal), dimension(6,6) :: &
homogenizedC
integer, intent(in) :: &
co, & !< component-ID of integration point
ip, & !< integration point
el !< element
integer :: i, &
of
integer :: i
real(pReal) :: f_unrotated
of = material_phasememberAt(co,ip,el)
associate(prm => param(phase_plasticityInstance(material_phaseAt(co,el))),&
stt => state(phase_plasticityInstance(material_phaseAT(co,el))))
associate(prm => param(phase_plasticityInstance(ph)),&
stt => state(phase_plasticityInstance(ph)))
f_unrotated = 1.0_pReal &
- sum(stt%f_tw(1:prm%sum_N_tw,of)) &
- sum(stt%f_tr(1:prm%sum_N_tr,of))
- sum(stt%f_tw(1:prm%sum_N_tw,me)) &
- sum(stt%f_tr(1:prm%sum_N_tr,me))
homogenizedC = f_unrotated * prm%C66
do i=1,prm%sum_N_tw
homogenizedC = homogenizedC &
+ stt%f_tw(i,of)*prm%C66_tw(1:6,1:6,i)
+ stt%f_tw(i,me)*prm%C66_tw(1:6,1:6,i)
enddo
do i=1,prm%sum_N_tr
homogenizedC = homogenizedC &
+ stt%f_tr(i,of)*prm%C66_tr(1:6,1:6,i)
+ stt%f_tr(i,me)*prm%C66_tr(1:6,1:6,i)
enddo
end associate

View File

@ -656,8 +656,11 @@ module function mech_RGC_updateState(P,F,avgF,dt,dPdF,ip,el) result(doneAndHappy
ip, & !< integration point number
el !< element number
real(pReal), dimension(6,6) :: C
equivalentMu = lattice_equivalent_mu(constitutive_homogenizedC(grainID,ip,el),'voigt')
C = constitutive_homogenizedC(material_phaseAt(grainID,el),material_phaseMemberAt(grainID,ip,el))
equivalentMu = lattice_equivalent_mu(C,'voigt')
end function equivalentMu