better readable

somehow on the cost of the nonlocal performance
This commit is contained in:
Martin Diehl 2020-09-29 12:56:12 +02:00
parent c46b4d90a6
commit f1e96489cc
1 changed files with 16 additions and 27 deletions

View File

@ -1147,16 +1147,15 @@ subroutine integrateStateFPI(todo)
plastic_dotState plastic_dotState
real(pReal), dimension(constitutive_source_maxSizeDotState,2,maxval(phase_Nsources)) :: source_dotState real(pReal), dimension(constitutive_source_maxSizeDotState,2,maxval(phase_Nsources)) :: source_dotState
logical :: & logical :: &
nonlocalBroken, broken broken
nonlocalBroken = .false.
!$OMP PARALLEL DO PRIVATE(size_pl,size_so,r,zeta,p,c,plastic_dotState,source_dotState,broken) !$OMP PARALLEL DO PRIVATE(size_pl,size_so,r,zeta,p,c,plastic_dotState,source_dotState,broken)
do e = FEsolving_execElem(1),FEsolving_execElem(2) do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2) do i = FEsolving_execIP(1),FEsolving_execIP(2)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
p = material_phaseAt(g,e) if(todo(g,i,e)) then
if(todo(g,i,e) .and. .not. (nonlocalBroken .and. plasticState(p)%nonlocal)) then p = material_phaseAt(g,e)
c = material_phaseMemberAt(g,i,e) c = material_phaseMemberAt(g,i,e)
broken = constitutive_collectDotState(crystallite_S(1:3,1:3,g,i,e), & broken = constitutive_collectDotState(crystallite_S(1:3,1:3,g,i,e), &
@ -1164,7 +1163,6 @@ subroutine integrateStateFPI(todo)
crystallite_Fi(1:3,1:3,g,i,e), & crystallite_Fi(1:3,1:3,g,i,e), &
crystallite_partionedFp0, & crystallite_partionedFp0, &
crystallite_subdt(g,i,e), g,i,e,p,c) crystallite_subdt(g,i,e), g,i,e,p,c)
if(broken .and. plasticState(p)%nonlocal) nonlocalBroken = .true.
if(broken) cycle if(broken) cycle
size_pl = plasticState(p)%sizeDotState size_pl = plasticState(p)%sizeDotState
@ -1236,7 +1234,6 @@ subroutine integrateStateFPI(todo)
endif endif
enddo iteration enddo iteration
if(broken .and. plasticState(p)%nonlocal) nonlocalBroken = .true.
endif endif
enddo; enddo; enddo enddo; enddo; enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
@ -1284,16 +1281,15 @@ subroutine integrateStateEuler(todo)
s, & s, &
sizeDotState sizeDotState
logical :: & logical :: &
nonlocalBroken, broken broken
nonlocalBroken = .false.
!$OMP PARALLEL DO PRIVATE (sizeDotState,p,c,broken) !$OMP PARALLEL DO PRIVATE (sizeDotState,p,c,broken)
do e = FEsolving_execElem(1),FEsolving_execElem(2) do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2) do i = FEsolving_execIP(1),FEsolving_execIP(2)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
p = material_phaseAt(g,e) if(todo(g,i,e)) then
if(todo(g,i,e) .and. .not. (nonlocalBroken .and. plasticState(p)%nonlocal)) then
p = material_phaseAt(g,e)
c = material_phaseMemberAt(g,i,e) c = material_phaseMemberAt(g,i,e)
broken = constitutive_collectDotState(crystallite_S(1:3,1:3,g,i,e), & broken = constitutive_collectDotState(crystallite_S(1:3,1:3,g,i,e), &
@ -1301,7 +1297,6 @@ subroutine integrateStateEuler(todo)
crystallite_Fi(1:3,1:3,g,i,e), & crystallite_Fi(1:3,1:3,g,i,e), &
crystallite_partionedFp0, & crystallite_partionedFp0, &
crystallite_subdt(g,i,e), g,i,e,p,c) crystallite_subdt(g,i,e), g,i,e,p,c)
if(broken .and. plasticState(p)%nonlocal) nonlocalBroken = .true.
if(broken) cycle if(broken) cycle
sizeDotState = plasticState(p)%sizeDotState sizeDotState = plasticState(p)%sizeDotState
@ -1318,11 +1313,9 @@ subroutine integrateStateEuler(todo)
broken = constitutive_deltaState(crystallite_S(1:3,1:3,g,i,e), & broken = constitutive_deltaState(crystallite_S(1:3,1:3,g,i,e), &
crystallite_Fe(1:3,1:3,g,i,e), & crystallite_Fe(1:3,1:3,g,i,e), &
crystallite_Fi(1:3,1:3,g,i,e),g,i,e,p,c) crystallite_Fi(1:3,1:3,g,i,e),g,i,e,p,c)
if(broken .and. plasticState(p)%nonlocal) nonlocalBroken = .true.
if(broken) cycle if(broken) cycle
broken = integrateStress(g,i,e) broken = integrateStress(g,i,e)
if(broken .and. plasticState(p)%nonlocal) nonlocalBroken = .true.
crystallite_converged(g,i,e) = .not. broken crystallite_converged(g,i,e) = .not. broken
endif endif
enddo; enddo; enddo enddo; enddo; enddo
@ -1349,20 +1342,19 @@ subroutine integrateStateAdaptiveEuler(todo)
s, & s, &
sizeDotState sizeDotState
logical :: & logical :: &
nonlocalBroken, broken broken
real(pReal), dimension(constitutive_plasticity_maxSizeDotState) :: residuum_plastic real(pReal), dimension(constitutive_plasticity_maxSizeDotState) :: residuum_plastic
real(pReal), dimension(constitutive_source_maxSizeDotState,maxval(phase_Nsources)) :: residuum_source real(pReal), dimension(constitutive_source_maxSizeDotState,maxval(phase_Nsources)) :: residuum_source
nonlocalBroken = .false.
!$OMP PARALLEL DO PRIVATE(sizeDotState,p,c,residuum_plastic,residuum_source,broken) !$OMP PARALLEL DO PRIVATE(sizeDotState,p,c,residuum_plastic,residuum_source,broken)
do e = FEsolving_execElem(1),FEsolving_execElem(2) do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2) do i = FEsolving_execIP(1),FEsolving_execIP(2)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
broken = .false. broken = .false.
p = material_phaseAt(g,e)
if(todo(g,i,e) .and. .not. (nonlocalBroken .and. plasticState(p)%nonlocal)) then
if(todo(g,i,e)) then
p = material_phaseAt(g,e)
c = material_phaseMemberAt(g,i,e) c = material_phaseMemberAt(g,i,e)
broken = constitutive_collectDotState(crystallite_S(1:3,1:3,g,i,e), & broken = constitutive_collectDotState(crystallite_S(1:3,1:3,g,i,e), &
@ -1418,7 +1410,6 @@ subroutine integrateStateAdaptiveEuler(todo)
enddo enddo
endif endif
if(broken .and. plasticState(p)%nonlocal) nonlocalBroken = .true.
enddo; enddo; enddo enddo; enddo; enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
@ -1503,19 +1494,18 @@ subroutine integrateStateRK(todo,A,B,CC,DB)
s, & s, &
sizeDotState sizeDotState
logical :: & logical :: &
nonlocalBroken, broken broken
real(pReal), dimension(constitutive_source_maxSizeDotState,size(B),maxval(phase_Nsources)) :: source_RKdotState real(pReal), dimension(constitutive_source_maxSizeDotState,size(B),maxval(phase_Nsources)) :: source_RKdotState
real(pReal), dimension(constitutive_plasticity_maxSizeDotState,size(B)) :: plastic_RKdotState real(pReal), dimension(constitutive_plasticity_maxSizeDotState,size(B)) :: plastic_RKdotState
nonlocalBroken = .false.
!$OMP PARALLEL DO PRIVATE(sizeDotState,p,c,plastic_RKdotState,source_RKdotState,broken) !$OMP PARALLEL DO PRIVATE(sizeDotState,p,c,plastic_RKdotState,source_RKdotState,broken)
do e = FEsolving_execElem(1),FEsolving_execElem(2) do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2) do i = FEsolving_execIP(1),FEsolving_execIP(2)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e)) do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
broken = .false. broken = .false.
p = material_phaseAt(g,e)
if(todo(g,i,e) .and. .not. (nonlocalBroken .and. plasticState(p)%nonlocal)) then
if(todo(g,i,e)) then
p = material_phaseAt(g,e)
c = material_phaseMemberAt(g,i,e) c = material_phaseMemberAt(g,i,e)
broken = constitutive_collectDotState(crystallite_S(1:3,1:3,g,i,e), & broken = constitutive_collectDotState(crystallite_S(1:3,1:3,g,i,e), &
@ -1608,7 +1598,6 @@ subroutine integrateStateRK(todo,A,B,CC,DB)
crystallite_converged(g,i,e) = .not. broken crystallite_converged(g,i,e) = .not. broken
endif endif
if(broken .and. plasticState(p)%nonlocal) nonlocalBroken = .true.
enddo; enddo; enddo enddo; enddo; enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
@ -1624,8 +1613,8 @@ end subroutine integrateStateRK
subroutine nonlocalConvergenceCheck subroutine nonlocalConvergenceCheck
integer :: e,i,p integer :: e,i,p
logical :: nonlocal_broken logical :: nonlocal_broken
nonlocal_broken = .false. nonlocal_broken = .false.
!$OMP PARALLEL DO PRIVATE(p) !$OMP PARALLEL DO PRIVATE(p)
do e = FEsolving_execElem(1),FEsolving_execElem(2) do e = FEsolving_execElem(1),FEsolving_execElem(2)
@ -1635,7 +1624,7 @@ subroutine nonlocalConvergenceCheck
enddo enddo
enddo enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
if(.not. nonlocal_broken) return if(.not. nonlocal_broken) return
!$OMP PARALLEL DO PRIVATE(p) !$OMP PARALLEL DO PRIVATE(p)
do e = FEsolving_execElem(1),FEsolving_execElem(2) do e = FEsolving_execElem(1),FEsolving_execElem(2)