From 77e1c5a8a7b81d46c09c825a6f2b002366fbbaff Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 28 Dec 2023 19:15:26 +0100 Subject: [PATCH] standard indexing: ce(ll) instead of element and integration point --- src/phase.f90 | 9 +++------ src/phase_mechanical_plastic_nonlocal.f90 | 17 +++++++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/phase.f90 b/src/phase.f90 index ffa606cc2..148b028a7 100644 --- a/src/phase.f90 +++ b/src/phase.f90 @@ -326,11 +326,8 @@ module phase real(pREAL) :: f end function phase_f_T - module subroutine plastic_nonlocal_updateCompatibility(orientation,ph,ip,el) - integer, intent(in) :: & - ph, & - ip, & - el + module subroutine plastic_nonlocal_updateCompatibility(orientation,ce) + integer, intent(in) :: ce type(tRotationContainer), dimension(:), intent(in) :: orientation end subroutine plastic_nonlocal_updateCompatibility @@ -590,7 +587,7 @@ subroutine crystallite_orientations(co,ip,el) call phase_O(ph)%data(en)%fromMatrix(transpose(math_rotationalPart(mechanical_F_e(ph,en)))) if (plasticState(material_ID_phase(1,(el-1)*discretization_nIPs + ip))%nonlocal) & - call plastic_nonlocal_updateCompatibility(phase_O,material_ID_phase(1,(el-1)*discretization_nIPs + ip),ip,el) + call plastic_nonlocal_updateCompatibility(phase_O,(el-1)*discretization_nIPs + ip) end subroutine crystallite_orientations diff --git a/src/phase_mechanical_plastic_nonlocal.f90 b/src/phase_mechanical_plastic_nonlocal.f90 index 545dec4e6..166c30ea1 100644 --- a/src/phase_mechanical_plastic_nonlocal.f90 +++ b/src/phase_mechanical_plastic_nonlocal.f90 @@ -1331,18 +1331,19 @@ end function rhoDotFlux ! plane normals and signed cosine of the angle between the slip directions. Only the largest values ! that sum up to a total of 1 are considered, all others are set to zero. !-------------------------------------------------------------------------------------------------- -module subroutine plastic_nonlocal_updateCompatibility(orientation,ph,ip,el) +module subroutine plastic_nonlocal_updateCompatibility(orientation,ce) type(tRotationContainer), dimension(:), intent(in) :: & orientation ! crystal orientation integer, intent(in) :: & - ph, & - ip, & - el + ce integer :: & n, & ! neighbor index + ph, & en, & + ip, & + el, & neighbor_e, & ! element index of my neighbor neighbor_i, & ! integration point index of my neighbor neighbor_me, & @@ -1350,17 +1351,21 @@ module subroutine plastic_nonlocal_updateCompatibility(orientation,ph,ip,el) ns, & ! number of active slip systems s1, & ! slip system index (en) s2 ! slip system index (my neighbor) - real(pREAL), dimension(2,param(ph)%sum_N_sl,param(ph)%sum_N_sl,nIPneighbors) :: & + real(pREAL), dimension(2,param(material_ID_phase(1,ce))%sum_N_sl,param(material_ID_phase(1,ce))%sum_N_sl,nIPneighbors) :: & my_compatibility ! my_compatibility for current element and ip real(pREAL) :: & my_compatibilitySum, & thresholdValue, & nThresholdValues - logical, dimension(param(ph)%sum_N_sl) :: & + logical, dimension(param(material_ID_phase(1,ce))%sum_N_sl) :: & belowThreshold type(tRotation) :: mis + ph = material_ID_phase(1,ce) + el = (ce-1)/discretization_nIPs + 1 + ip = modulo(ce-1,discretization_nIPs) + 1 + associate(prm => param(ph)) ns = prm%sum_N_sl