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
logical :: &
doneWithIntegration, &
nonlocal_broken
nonlocalBroken
! --+>> PREGUESS FOR STATE <<+--
call update_dotState(1.0_pReal)
@ -1028,8 +1028,8 @@ subroutine integrateStateFPI
NiterationState = 0
doneWithIntegration = .false.
nonlocal_broken = .false.
crystalliteLooping: do while (.not. doneWithIntegration .and. NiterationState < num%nState)
nonlocalBroken = .false.
iteration: do while (.not. doneWithIntegration .and. NiterationState < num%nState)
NiterationState = NiterationState + 1
#ifdef DEBUG
@ -1037,14 +1037,12 @@ subroutine integrateStateFPI
write(6,'(a,i6)') '<< CRYST stateFPI >> state iteration ',NiterationState
#endif
! store previousDotState and previousDotState2
!$OMP PARALLEL DO PRIVATE(p,c)
do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
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)
plasticState(p)%previousDotState2(:,c) = merge(plasticState(p)%previousDotState(:,c),&
@ -1062,15 +1060,14 @@ subroutine integrateStateFPI
g, i, e)
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))) &
nonlocal_broken = .true.
nonlocalBroken = .true.
endif
enddo
enddo
enddo
!$OMP END PARALLEL DO
if(nonlocal_broken) &
where(.not. crystallite_localPlasticity) crystallite_todo = .false.
if(nonlocalBroken) where(.not. crystallite_localPlasticity) crystallite_todo = .false.
call update_dotState(1.0_pReal)
@ -1167,7 +1164,7 @@ subroutine integrateStateFPI
enddo; enddo
enddo
enddo crystalliteLooping
enddo iteration
contains
@ -1595,27 +1592,27 @@ subroutine update_stress(timeFraction)
i, & !< integration point index in ip loop
g
logical :: &
nonlocal_broken
nonlocalBroken
nonlocal_broken = .false.
nonlocalBroken = .false.
!$OMP PARALLEL DO
do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
do g = 1,homogenization_Ngrains(material_homogenizationAt(e))
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)
if (.not. (crystallite_todo(g,i,e) .or. crystallite_localPlasticity(g,i,e))) &
nonlocal_broken = .true.
nonlocalBroken = .true.
endif
enddo; enddo; enddo
!$OMP END PARALLEL DO
if(nonlocal_broken) &
where(.not. crystallite_localPlasticity) crystallite_todo = .false.
if(nonlocalBroken) where(.not. crystallite_localPlasticity) crystallite_todo = .false.
end subroutine update_stress
!--------------------------------------------------------------------------------------------------
!> @brief tbd
!--------------------------------------------------------------------------------------------------
@ -1678,10 +1675,10 @@ subroutine update_state(timeFraction)
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
!--------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------
subroutine update_dotState(timeFraction)
real(pReal), intent(in) :: &
@ -1694,40 +1691,40 @@ subroutine update_dotState(timeFraction)
c, &
s
logical :: &
NaN, &
nonlocalStop
nonlocalBroken
nonlocalStop = .false.
!$OMP PARALLEL DO PRIVATE (p,c,NaN)
nonlocalBroken = .false.
!$OMP PARALLEL DO PRIVATE (p,c)
do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1),FEsolving_execIP(2)
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. .not. nonlocalStop) then
if(crystallite_todo(g,i,e) .and. .not. crystallite_converged(g,i,e) .and. &
(.not. nonlocalBroken .or. crystallite_localPlasticity(g,i,e)) ) then
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)*timeFraction, 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)
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
if (NaN) then
crystallite_todo(g,i,e) = .false. ! this one done (and broken)
if (.not. crystallite_localPlasticity(g,i,e)) nonlocalStop = .True.
endif
if (.not. (crystallite_todo(g,i,e) .or. crystallite_localPlasticity(g,i,e))) &
nonlocalBroken = .true.
endif
enddo; enddo; enddo
!$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
!---------------------------------------------------------------------------------------------------
!> @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
integer :: &