From 871241e31bcc521775f922fede3fe22581290b54 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 24 Mar 2020 12:38:33 +0100 Subject: [PATCH 1/3] first round of loop removal --- src/crystallite.f90 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/crystallite.f90 b/src/crystallite.f90 index 3f5059f4d..f385ab769 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -1269,12 +1269,22 @@ subroutine integrateStateAdaptiveEuler sourceState(p)%p(s)%state(1:sizeDotState,c) = & sourceState(p)%p(s)%state(1:sizeDotState,c) + sourceState(p)%p(s)%dotstate(1:sizeDotState,c) * crystallite_subdt(g,i,e) !ToDo: state, partitioned state? enddo + + crystallite_todo(g,i,e) = stateJump(g,i,e) + if(.not. (crystallite_todo(g,i,e) .or. crystallite_localPlasticity(g,i,e))) & + nonlocalBroken = .true. + if(.not. crystallite_todo(g,i,e)) cycle + + call constitutive_dependentState(crystallite_Fe(1:3,1:3,g,i,e), & + crystallite_Fp(1:3,1:3,g,i,e), & + g, i, e) + endif enddo; enddo; enddo !$OMP END PARALLEL DO - call update_deltaState - call update_dependentState + if(nonlocalBroken) where(.not. crystallite_localPlasticity) crystallite_todo = .false. + call update_stress(1.0_pReal) call update_dotState(1.0_pReal) From 424fcabb902e040293059db409b1cdd8a3751aa7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 24 Mar 2020 12:54:31 +0100 Subject: [PATCH 2/3] move into the same loop --- src/crystallite.f90 | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/crystallite.f90 b/src/crystallite.f90 index f385ab769..a359f09b2 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -1279,15 +1279,31 @@ subroutine integrateStateAdaptiveEuler crystallite_Fp(1:3,1:3,g,i,e), & g, i, e) + crystallite_todo(g,i,e) = integrateStress(g,i,e) + if(.not. (crystallite_todo(g,i,e) .or. crystallite_localPlasticity(g,i,e))) & + nonlocalBroken = .true. + if(.not. crystallite_todo(g,i,e)) cycle + + call constitutive_collectDotState(crystallite_S(1:3,1:3,g,i,e), & + crystallite_partionedF0, & + crystallite_Fi(1:3,1:3,g,i,e), & + crystallite_partionedFp0, & + crystallite_subdt(g,i,e), g,i,e) + crystallite_todo(g,i,e) = all(.not. IEEE_is_NaN(plasticState(p)%dotState(:,c))) + do s = 1, phase_Nsources(p) + crystallite_todo(g,i,e) = crystallite_todo(g,i,e) .and. all(.not. IEEE_is_NaN(sourceState(p)%p(s)%dotState(:,c))) + enddo + if(.not. (crystallite_todo(g,i,e) .or. crystallite_localPlasticity(g,i,e))) & + nonlocalBroken = .true. + if(.not. crystallite_todo(g,i,e)) cycle + + endif enddo; enddo; enddo !$OMP END PARALLEL DO if(nonlocalBroken) where(.not. crystallite_localPlasticity) crystallite_todo = .false. - call update_stress(1.0_pReal) - call update_dotState(1.0_pReal) - !$OMP PARALLEL DO PRIVATE(sizeDotState,p,c) do e = FEsolving_execElem(1),FEsolving_execElem(2) do i = FEsolving_execIP(1),FEsolving_execIP(2) From fe8ee825d6731b66ad176fd8104b25b5f3f88b27 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 26 Mar 2020 10:52:10 +0100 Subject: [PATCH 3/3] bugfix: F, not Fp for explicit nonlocal --- src/crystallite.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crystallite.f90 b/src/crystallite.f90 index 0159daab5..e2a367e4e 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -1275,7 +1275,7 @@ subroutine integrateStateAdaptiveEuler nonlocalBroken = .true. if(.not. crystallite_todo(g,i,e)) cycle - call constitutive_dependentState(crystallite_Fe(1:3,1:3,g,i,e), & + call constitutive_dependentState(crystallite_partionedF(1:3,1:3,g,i,e), & crystallite_Fp(1:3,1:3,g,i,e), & g, i, e)