more favorable arguments

This commit is contained in:
Martin Diehl 2023-12-29 22:48:29 +01:00
parent 305c6e1b83
commit e042f0311a
No known key found for this signature in database
GPG Key ID: 1FD50837275A0A9B
2 changed files with 17 additions and 27 deletions

View File

@ -326,8 +326,8 @@ module phase
real(pREAL) :: f real(pREAL) :: f
end function phase_f_T end function phase_f_T
module subroutine plastic_nonlocal_updateCompatibility(orientation,ce) module subroutine plastic_nonlocal_updateCompatibility(orientation,ph,en)
integer, intent(in) :: ce integer, intent(in) :: ph, en
type(tRotationContainer), dimension(:), intent(in) :: orientation type(tRotationContainer), dimension(:), intent(in) :: orientation
end subroutine plastic_nonlocal_updateCompatibility end subroutine plastic_nonlocal_updateCompatibility
@ -576,7 +576,7 @@ subroutine crystallite_orientations(co,ce)
call phase_O(ph)%data(en)%fromMatrix(transpose(math_rotationalPart(mechanical_F_e(ph,en)))) call phase_O(ph)%data(en)%fromMatrix(transpose(math_rotationalPart(mechanical_F_e(ph,en))))
if (plasticState(material_ID_phase(1,ce))%nonlocal) call plastic_nonlocal_updateCompatibility(phase_O,ce) if (plasticState(ph)%nonlocal) call plastic_nonlocal_updateCompatibility(phase_O,ph,en)
end subroutine crystallite_orientations end subroutine crystallite_orientations

View File

@ -1275,64 +1275,54 @@ end function rhoDotFlux
! plane normals and signed cosine of the angle between the slip directions. Only the largest values ! 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. ! that sum up to a total of 1 are considered, all others are set to zero.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module subroutine plastic_nonlocal_updateCompatibility(orientation,ce) module subroutine plastic_nonlocal_updateCompatibility(orientation,ph,en)
type(tRotationContainer), dimension(:), intent(in) :: & type(tRotationContainer), dimension(:), intent(in) :: &
orientation ! crystal orientation orientation ! crystal orientation
integer, intent(in) :: & integer, intent(in) :: &
ce ph, en
integer :: & integer :: &
n, & ! neighbor index n, & ! neighbor index
ph, &
en, &
ip, &
el, &
el_nbr, & ! element index of my neighbor el_nbr, & ! element index of my neighbor
ip_nbr, & ! integration point index of my neighbor ip_nbr, & ! integration point index of my neighbor
ce_nbr, &
en_nbr, & en_nbr, &
ph_nbr, & ph_nbr, &
ns, & ! number of active slip systems ns, & ! number of active slip systems
s1, & ! slip system index (en) s1, & ! slip system index (en)
s2 ! slip system index (my neighbor) s2 ! slip system index (my neighbor)
real(pREAL), dimension(2,param(material_ID_phase(1,ce))%sum_N_sl,param(material_ID_phase(1,ce))%sum_N_sl,nCellNeighbors) :: & real(pREAL), dimension(2,param(ph)%sum_N_sl,param(ph)%sum_N_sl,nCellNeighbors) :: &
my_compatibility ! my_compatibility for current element and ip my_compatibility ! my_compatibility for current element and ip
real(pREAL) :: & real(pREAL) :: &
my_compatibilitySum, & my_compatibilitySum, &
thresholdValue, & thresholdValue, &
nThresholdValues nThresholdValues
logical, dimension(param(material_ID_phase(1,ce))%sum_N_sl) :: & logical, dimension(param(ph)%sum_N_sl) :: &
belowThreshold belowThreshold
type(tRotation) :: mis 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)) associate(prm => param(ph))
ns = prm%sum_N_sl ns = prm%sum_N_sl
en = material_entry_phase(1,(el-1)*discretization_nIPs + ip)
!*** start out fully compatible !*** start out fully compatible
my_compatibility = 0.0_pREAL my_compatibility = 0.0_pREAL
forall(s1 = 1:ns) my_compatibility(:,s1,s1,:) = 1.0_pREAL forall(s1 = 1:ns) my_compatibility(:,s1,s1,:) = 1.0_pREAL
neighbors: do n = 1,nCellNeighbors neighbors: do n = 1,nCellNeighbors
el_nbr = IPneighborhood(1,n,ip,el) el_nbr = geom(ph)%IPneighborhood(1,n,en)
ip_nbr = IPneighborhood(2,n,ip,el) ip_nbr = geom(ph)%IPneighborhood(2,n,en)
en_nbr = material_entry_phase(1,(el_nbr-1)*discretization_nIPs + ip_nbr) ce_nbr = (el_nbr-1)*discretization_nIPs + ip_nbr
ph_nbr = material_ID_phase(1,(el_nbr-1)*discretization_nIPs + ip_nbr) en_nbr = material_entry_phase(1,ce_nbr)
ph_nbr = material_ID_phase(1,ce_nbr)
if (el_nbr <= 0 .or. ip_nbr <= 0) then if (ce_nbr <= 0) then ! free surface
!* FREE SURFACE
forall(s1 = 1:ns) my_compatibility(:,s1,s1,n) = sqrt(prm%chi_surface) forall(s1 = 1:ns) my_compatibility(:,s1,s1,n) = sqrt(prm%chi_surface)
elseif (ph_nbr /= ph) then elseif (ph_nbr /= ph) then ! phase boundary
!* PHASE BOUNDARY
if (plasticState(ph_nbr)%nonlocal .and. plasticState(ph)%nonlocal) & if (plasticState(ph_nbr)%nonlocal .and. plasticState(ph)%nonlocal) &
forall(s1 = 1:ns) my_compatibility(:,s1,s1,n) = 0.0_pREAL forall(s1 = 1:ns) my_compatibility(:,s1,s1,n) = 0.0_pREAL
elseif (prm%chi_GB >= 0.0_pREAL) then elseif (prm%chi_GB >= 0.0_pREAL) then ! grain boundary
!* GRAIN BOUNDARY
if (any(dNeq(phase_O_0(ph)%data(en)%asQuaternion(), & if (any(dNeq(phase_O_0(ph)%data(en)%asQuaternion(), &
phase_O_0(ph_nbr)%data(en_nbr)%asQuaternion())) .and. & phase_O_0(ph_nbr)%data(en_nbr)%asQuaternion())) .and. &
plasticState(ph_nbr)%nonlocal) & plasticState(ph_nbr)%nonlocal) &
@ -1381,7 +1371,7 @@ module subroutine plastic_nonlocal_updateCompatibility(orientation,ce)
end do neighbors end do neighbors
dependentState(ph)%compatibility(:,:,:,:,material_entry_phase(1,(el-1)*discretization_nIPs + ip)) = my_compatibility dependentState(ph)%compatibility(:,:,:,:,en) = my_compatibility
end associate end associate