standard access pattern

This commit is contained in:
Martin Diehl 2023-12-28 19:51:22 +01:00
parent aae99156b4
commit 04fdac6556
No known key found for this signature in database
GPG Key ID: 1FD50837275A0A9B
2 changed files with 19 additions and 24 deletions

View File

@ -312,7 +312,7 @@ subroutine homogenization_mechanical_response2(Delta_t,FEsolving_execIP,FEsolvin
ce = (el-1)*discretization_nIPs + ip ce = (el-1)*discretization_nIPs + ip
ho = material_ID_homogenization(ce) ho = material_ID_homogenization(ce)
do co = 1, homogenization_Nconstituents(ho) do co = 1, homogenization_Nconstituents(ho)
call crystallite_orientations(co,ip,el) call crystallite_orientations(co,ce)
end do end do
call mechanical_homogenize(Delta_t,ce) call mechanical_homogenize(Delta_t,ce)
end do IpLooping3 end do IpLooping3

View File

@ -541,21 +541,16 @@ subroutine crystallite_init()
integer :: & integer :: &
ce, & ce, &
co, & !< counter in integration point component loop co, & !< counter in integration point component loop
ip, & !< counter in integration point loop
el, & !< counter in element loop
en, ph en, ph
!$OMP PARALLEL DO PRIVATE(ce,ph,en) !$OMP PARALLEL DO PRIVATE(ph,en)
do el = 1, discretization_Nelems do ce = 1, size(material_ID_homogenization)
do ip = 1, discretization_nIPs do co = 1,homogenization_Nconstituents(material_ID_homogenization(ce))
ce = (el-1)*discretization_nIPs + ip ph = material_ID_phase(co,ce)
do co = 1,homogenization_Nconstituents(material_ID_homogenization(ce)) en = material_entry_phase(co,ce)
en = material_entry_phase(co,ce) call crystallite_orientations(co,ce)
ph = material_ID_phase(co,ce) call plastic_dependentState(ph,en) ! update dependent state variables to be consistent with basic states
call crystallite_orientations(co,ip,el)
call plastic_dependentState(ph,en) ! update dependent state variables to be consistent with basic states
end do
end do end do
end do end do
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
@ -565,32 +560,30 @@ end subroutine crystallite_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief calculates orientations !> @brief Update orientations and, if needed, compatibility.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine crystallite_orientations(co,ip,el) subroutine crystallite_orientations(co,ce)
integer, intent(in) :: & integer, intent(in) :: &
co, & !< counter in integration point component loop co, &
ip, & !< counter in integration point loop ce
el !< counter in element loop
integer :: ph, en integer :: ph, en
ph = material_ID_phase(co,(el-1)*discretization_nIPs + ip) ph = material_ID_phase(co,ce)
en = material_entry_phase(co,(el-1)*discretization_nIPs + ip) en = material_entry_phase(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,(el-1)*discretization_nIPs + ip))%nonlocal) & if (plasticState(material_ID_phase(1,ce))%nonlocal) call plastic_nonlocal_updateCompatibility(phase_O,ce)
call plastic_nonlocal_updateCompatibility(phase_O,(el-1)*discretization_nIPs + ip)
end subroutine crystallite_orientations end subroutine crystallite_orientations
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Map 2nd order tensor to reference config !> @brief Map 2nd order tensor to reference configuration.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
function crystallite_push33ToRef(co,ce, tensor33) function crystallite_push33ToRef(co,ce, tensor33)
@ -618,11 +611,13 @@ end function crystallite_push33ToRef
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
logical pure function converged(residuum,state,atol) logical pure function converged(residuum,state,atol)
real(pREAL), intent(in), dimension(:) ::& real(pREAL), intent(in), dimension(:) :: &
residuum, state, atol residuum, state, atol
real(pREAL) :: & real(pREAL) :: &
rTol rTol
rTol = num%rTol_crystalliteState rTol = num%rTol_crystalliteState
converged = all(abs(residuum) <= max(atol, rtol*abs(state))) converged = all(abs(residuum) <= max(atol, rtol*abs(state)))