same logic

This commit is contained in:
Martin Diehl 2020-03-23 06:39:17 +01:00
parent 027818c942
commit e5743c7d27
1 changed files with 205 additions and 208 deletions

View File

@ -1020,7 +1020,7 @@ subroutine integrateStateFPI
residuum_source ! residuum for source state residuum_source ! residuum for source state
logical :: & logical :: &
doneWithIntegration, & doneWithIntegration, &
nonlocal_broken nonlocalBroken
! --+>> PREGUESS FOR STATE <<+-- ! --+>> PREGUESS FOR STATE <<+--
call update_dotState(1.0_pReal) call update_dotState(1.0_pReal)
@ -1028,8 +1028,8 @@ subroutine integrateStateFPI
NiterationState = 0 NiterationState = 0
doneWithIntegration = .false. doneWithIntegration = .false.
nonlocal_broken = .false. nonlocalBroken = .false.
crystalliteLooping: do while (.not. doneWithIntegration .and. NiterationState < num%nState) iteration: do while (.not. doneWithIntegration .and. NiterationState < num%nState)
NiterationState = NiterationState + 1 NiterationState = NiterationState + 1
#ifdef DEBUG #ifdef DEBUG
@ -1037,14 +1037,12 @@ subroutine integrateStateFPI
write(6,'(a,i6)') '<< CRYST stateFPI >> state iteration ',NiterationState write(6,'(a,i6)') '<< CRYST stateFPI >> state iteration ',NiterationState
#endif #endif
! store previousDotState and previousDotState2
!$OMP PARALLEL DO PRIVATE(p,c) !$OMP PARALLEL DO PRIVATE(p,c)
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))
if(crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e) .and. & if(crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e) .and. &
(.not. nonlocal_broken .or. crystallite_localPlasticity(g,i,e)) ) then (.not. nonlocalBroken .or. crystallite_localPlasticity(g,i,e)) ) then
p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e) p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e)
plasticState(p)%previousDotState2(:,c) = merge(plasticState(p)%previousDotState(:,c),& plasticState(p)%previousDotState2(:,c) = merge(plasticState(p)%previousDotState(:,c),&
@ -1062,15 +1060,14 @@ subroutine integrateStateFPI
g, i, e) g, i, e)
crystallite_todo(g,i,e) = integrateStress(g,i,e,1.0_pReal) crystallite_todo(g,i,e) = integrateStress(g,i,e,1.0_pReal)
if(.not. (crystallite_todo(g,i,e) .or. crystallite_localPlasticity(g,i,e))) & if(.not. (crystallite_todo(g,i,e) .or. crystallite_localPlasticity(g,i,e))) &
nonlocal_broken = .true. nonlocalBroken = .true.
endif endif
enddo enddo
enddo enddo
enddo enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
if(nonlocal_broken) & if(nonlocalBroken) where(.not. crystallite_localPlasticity) crystallite_todo = .false.
where(.not. crystallite_localPlasticity) crystallite_todo = .false.
call update_dotState(1.0_pReal) call update_dotState(1.0_pReal)
@ -1167,7 +1164,7 @@ subroutine integrateStateFPI
enddo; enddo enddo; enddo
enddo enddo
enddo crystalliteLooping enddo iteration
contains contains
@ -1595,27 +1592,27 @@ subroutine update_stress(timeFraction)
i, & !< integration point index in ip loop i, & !< integration point index in ip loop
g g
logical :: & logical :: &
nonlocal_broken nonlocalBroken
nonlocal_broken = .false. nonlocalBroken = .false.
!$OMP PARALLEL DO !$OMP PARALLEL DO
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))
if (crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e) .and. & if(crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e) .and. &
(.not. nonlocal_broken .or. crystallite_localPlasticity(g,i,e)) ) then (.not. nonlocalBroken .or. crystallite_localPlasticity(g,i,e)) ) then
crystallite_todo(g,i,e) = integrateStress(g,i,e,timeFraction) crystallite_todo(g,i,e) = integrateStress(g,i,e,timeFraction)
if (.not. (crystallite_todo(g,i,e) .or. crystallite_localPlasticity(g,i,e))) & if (.not. (crystallite_todo(g,i,e) .or. crystallite_localPlasticity(g,i,e))) &
nonlocal_broken = .true. nonlocalBroken = .true.
endif endif
enddo; enddo; enddo enddo; enddo; enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
if(nonlocal_broken) & if(nonlocalBroken) where(.not. crystallite_localPlasticity) crystallite_todo = .false.
where(.not. crystallite_localPlasticity) crystallite_todo = .false.
end subroutine update_stress end subroutine update_stress
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief tbd !> @brief tbd
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -1678,10 +1675,10 @@ subroutine update_state(timeFraction)
end subroutine update_state end subroutine update_state
!-------------------------------------------------------------------------------------------------- !---------------------------------------------------------------------------------------------------
!> @brief triggers calculation of all new rates !> @brief Trigger calculation of all new rates
!> if NaN occurs, crystallite_todo is set to FALSE. Any NaN in a nonlocal propagates to all others !> if NaN occurs, crystallite_todo is set to FALSE. Any NaN in a nonlocal propagates to all others
!-------------------------------------------------------------------------------------------------- !---------------------------------------------------------------------------------------------------
subroutine update_dotState(timeFraction) subroutine update_dotState(timeFraction)
real(pReal), intent(in) :: & real(pReal), intent(in) :: &
@ -1694,40 +1691,40 @@ subroutine update_dotState(timeFraction)
c, & c, &
s s
logical :: & logical :: &
NaN, & nonlocalBroken
nonlocalStop
nonlocalStop = .false. nonlocalBroken = .false.
!$OMP PARALLEL DO PRIVATE (p,c)
!$OMP PARALLEL DO PRIVATE (p,c,NaN)
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))
!$OMP FLUSH(nonlocalStop) if(crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e) .and. &
if ((crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e)) .and. .not. nonlocalStop) then (.not. nonlocalBroken .or. crystallite_localPlasticity(g,i,e)) ) then
call constitutive_collectDotState(crystallite_S(1:3,1:3,g,i,e), & call constitutive_collectDotState(crystallite_S(1:3,1:3,g,i,e), &
crystallite_partionedF0, & crystallite_partionedF0, &
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)*timeFraction, g,i,e) crystallite_subdt(g,i,e)*timeFraction, g,i,e)
p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e) p = material_phaseAt(g,e); c = material_phaseMemberAt(g,i,e)
NaN = any(IEEE_is_NaN(plasticState(p)%dotState(:,c))) crystallite_todo(g,i,e) = all(.not. IEEE_is_NaN(plasticState(p)%dotState(:,c)))
do s = 1, phase_Nsources(p) do s = 1, phase_Nsources(p)
NaN = NaN .or. any(IEEE_is_NaN(sourceState(p)%p(s)%dotState(:,c))) crystallite_todo(g,i,e) = crystallite_todo(g,i,e) .and. all(.not. IEEE_is_NaN(sourceState(p)%p(s)%dotState(:,c)))
enddo enddo
if (NaN) then if (.not. (crystallite_todo(g,i,e) .or. crystallite_localPlasticity(g,i,e))) &
crystallite_todo(g,i,e) = .false. ! this one done (and broken) nonlocalBroken = .true.
if (.not. crystallite_localPlasticity(g,i,e)) nonlocalStop = .True.
endif
endif endif
enddo; enddo; enddo enddo; enddo; enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
if (nonlocalStop) crystallite_todo = crystallite_todo .and. crystallite_localPlasticity if(nonlocalBroken) where(.not. crystallite_localPlasticity) crystallite_todo = .false.
end subroutine update_DotState end subroutine update_DotState
!---------------------------------------------------------------------------------------------------
!> @brief Trigger calculation of all new sudden state change
!> if NaN occurs, crystallite_todo is set to FALSE. Any NaN in a nonlocal propagates to all others
!---------------------------------------------------------------------------------------------------
subroutine update_deltaState subroutine update_deltaState
integer :: & integer :: &