From 3a0596a274f673a3bf93b308c6b4cf2b41c4835f Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 4 Feb 2022 08:49:00 +0100 Subject: [PATCH] use en/ph access --- src/phase.f90 | 15 ++++++++------- src/phase_mechanical.f90 | 2 +- src/phase_mechanical_plastic.f90 | 14 +++----------- src/phase_mechanical_plastic_nonlocal.f90 | 4 ++-- 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/phase.f90 b/src/phase.f90 index 82bc44bfd..4d180d439 100644 --- a/src/phase.f90 +++ b/src/phase.f90 @@ -272,14 +272,12 @@ module phase type(tRotationContainer), dimension(:), intent(in) :: orientation end subroutine plastic_nonlocal_updateCompatibility - module subroutine plastic_dependentState(co,ip,el) + module subroutine plastic_dependentState(en,ph) integer, intent(in) :: & - co, & !< component-ID of integration point - ip, & !< integration point - el !< element + en, & + ph end subroutine plastic_dependentState - module subroutine damage_anisobrittle_LiAndItsTangent(Ld, dLd_dTstar, S, ph,en) integer, intent(in) :: ph, en real(pReal), intent(in), dimension(3,3) :: & @@ -503,7 +501,8 @@ subroutine crystallite_init() el, & !< counter in element loop cMax, & !< maximum number of integration point components iMax, & !< maximum number of integration points - eMax !< maximum number of elements + eMax, & !< maximum number of elements + en, ph class(tNode), pointer :: & num_crystallite, & @@ -560,8 +559,10 @@ subroutine crystallite_init() do ip = 1, iMax ce = (el-1)*discretization_nIPs + ip do co = 1,homogenization_Nconstituents(material_homogenizationID(ce)) + en = material_phaseEntry(co,ce) + ph = material_phaseID(co,ce) call crystallite_orientations(co,ip,el) - call plastic_dependentState(co,ip,el) ! update dependent state variables to be consistent with basic states + call plastic_dependentState(en,ph) ! update dependent state variables to be consistent with basic states end do end do end do diff --git a/src/phase_mechanical.f90 b/src/phase_mechanical.f90 index 04cc4b946..c97e4a13b 100644 --- a/src/phase_mechanical.f90 +++ b/src/phase_mechanical.f90 @@ -431,7 +431,7 @@ function integrateStress(F,subFp0,subFi0,Delta_t,co,ip,el) result(broken) ph = material_phaseID(co,(el-1)*discretization_nIPs + ip) en = material_phaseEntry(co,(el-1)*discretization_nIPs + ip) - call plastic_dependentState(co,ip,el) + call plastic_dependentState(en,ph) Lpguess = phase_mechanical_Lp(ph)%data(1:3,1:3,en) ! take as first guess Liguess = phase_mechanical_Li(ph)%data(1:3,1:3,en) ! take as first guess diff --git a/src/phase_mechanical_plastic.f90 b/src/phase_mechanical_plastic.f90 index 9378edfdc..a5f40a2df 100644 --- a/src/phase_mechanical_plastic.f90 +++ b/src/phase_mechanical_plastic.f90 @@ -341,20 +341,12 @@ end function plastic_dotState !-------------------------------------------------------------------------------------------------- !> @brief calls microstructure function of the different plasticity constitutive models !-------------------------------------------------------------------------------------------------- -module subroutine plastic_dependentState(co, ip, el) +module subroutine plastic_dependentState(en,ph) integer, intent(in) :: & - co, & !< component-ID of integration point - ip, & !< integration point - el !< element + en, & + ph - integer :: & - ph, & - en - - - ph = material_phaseID(co,(el-1)*discretization_nIPs + ip) - en = material_phaseEntry(co,(el-1)*discretization_nIPs + ip) plasticType: select case (phase_plasticity(ph)) diff --git a/src/phase_mechanical_plastic_nonlocal.f90 b/src/phase_mechanical_plastic_nonlocal.f90 index 9c901f6b0..dec7ea8e7 100644 --- a/src/phase_mechanical_plastic_nonlocal.f90 +++ b/src/phase_mechanical_plastic_nonlocal.f90 @@ -672,8 +672,8 @@ module subroutine nonlocal_dependentState(ph, en) neighbor_rhoTotal(1,:,n) = sum(abs(rho_neighbor0(:,edg)),2) neighbor_rhoTotal(2,:,n) = sum(abs(rho_neighbor0(:,scr)),2) - connection_latticeConf(1:3,n) = matmul(invFe, geom(ph)%IPcoordinates(1:3,en) & - - geom(ph)%IPcoordinates(1:3,en-1)) ! ToDo: broken for different materials + connection_latticeConf(1:3,n) = matmul(invFe, geom(ph)%IPcoordinates(1:3,no) & + - geom(ph)%IPcoordinates(1:3,en)) normal_latticeConf = matmul(transpose(invFp), geom(ph)%IPareaNormal(1:3,n,en)) if (math_inner(normal_latticeConf,connection_latticeConf(1:3,n)) < 0.0_pReal) & ! neighboring connection points in opposite direction to face normal: must be periodic image connection_latticeConf(1:3,n) = normal_latticeConf * geom(ph)%V_0(en)/geom(ph)%IParea(n,en) ! instead take the surface normal scaled with the diameter of the cell