taking over from old branch

This commit is contained in:
Martin Diehl 2019-01-29 22:19:38 +01:00
parent 38d8e429ff
commit 73f39136c4
1 changed files with 14 additions and 23 deletions

View File

@ -1551,7 +1551,6 @@ subroutine integrateStateFPI()
homogenization_Ngrains homogenization_Ngrains
use constitutive, only: & use constitutive, only: &
constitutive_collectDotState, & constitutive_collectDotState, &
constitutive_microstructure, &
constitutive_plasticity_maxSizeDotState, & constitutive_plasticity_maxSizeDotState, &
constitutive_source_maxSizeDotState constitutive_source_maxSizeDotState
@ -1569,9 +1568,9 @@ subroutine integrateStateFPI()
real(pReal) :: & real(pReal) :: &
stateDamper stateDamper
real(pReal), dimension(constitutive_plasticity_maxSizeDotState) :: & real(pReal), dimension(constitutive_plasticity_maxSizeDotState) :: &
plasticStateResiduum residuum_plastic ! residuum for plastic state
real(pReal), dimension(constitutive_source_maxSizeDotState, maxval(phase_Nsources)) :: & real(pReal), dimension(constitutive_source_maxSizeDotState, maxval(phase_Nsources)) :: &
sourceStateResiduum residuum_source ! residuum for source state
logical :: & logical :: &
converged, & converged, &
doneWithIntegration doneWithIntegration
@ -1616,7 +1615,7 @@ subroutine integrateStateFPI()
!$OMP PARALLEL !$OMP PARALLEL
!$OMP DO PRIVATE(sizeDotState, & !$OMP DO PRIVATE(sizeDotState, &
!$OMP& plasticStateResiduum,sourceStateResiduum, & !$OMP& residuum_plastic,residuum_source, &
!$OMP& stateDamper, converged,p,c) !$OMP& stateDamper, converged,p,c)
do e = FEsolving_execElem(1),FEsolving_execElem(2) do e = FEsolving_execElem(1),FEsolving_execElem(2)
do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e)
@ -1629,21 +1628,20 @@ subroutine integrateStateFPI()
plasticState(p)%previousDotState2(:,c)) plasticState(p)%previousDotState2(:,c))
sizeDotState = plasticState(p)%sizeDotState sizeDotState = plasticState(p)%sizeDotState
plasticStateResiduum(1:sizeDotState) = plasticState(p)%state (1:sizeDotState,c) & residuum_plastic(1:SizeDotState) = plasticState(p)%state (1:sizeDotState,c) &
- plasticState(p)%subState0(1:sizeDotState,c) & - plasticState(p)%subState0(1:sizeDotState,c) &
- ( plasticState(p)%dotState (:,c) * stateDamper & - ( plasticState(p)%dotState (:,c) * stateDamper &
+ plasticState(p)%previousDotState(:,c) * (1.0_pReal-stateDamper) & + plasticState(p)%previousDotState(:,c) * (1.0_pReal-stateDamper) &
) * crystallite_subdt(g,i,e) ) * crystallite_subdt(g,i,e)
plasticState(p)%state(1:sizeDotState,c) = plasticState(p)%state(1:sizeDotState,c) & plasticState(p)%state(1:sizeDotState,c) = plasticState(p)%state(1:sizeDotState,c) &
- plasticStateResiduum(1:sizeDotState) - residuum_plastic(1:sizeDotState)
plasticState(p)%dotState(:,c) = plasticState(p)%dotState(:,c) * stateDamper & plasticState(p)%dotState(:,c) = plasticState(p)%dotState(:,c) * stateDamper &
+ plasticState(p)%previousDotState(:,c) * (1.0_pReal - stateDamper) + plasticState(p)%previousDotState(:,c) * (1.0_pReal - stateDamper)
converged = all( abs(plasticStateResiduum(1:sizeDotState)) < & converged = all( abs(residuum_plastic(1:sizeDotState)) < &
plasticState(p)%aTolState(1:sizeDotState) & plasticState(p)%aTolState(1:sizeDotState) &
.or. abs(plasticStateResiduum(1:sizeDotState)) < & .or. abs(residuum_plastic(1:sizeDotState)) < &
rTol_crystalliteState * abs( plasticState(p)%state(1:sizeDotState,c))) rTol_crystalliteState * abs( plasticState(p)%state(1:sizeDotState,c)))
@ -1652,26 +1650,21 @@ subroutine integrateStateFPI()
sourceState(p)%p(s)%previousDotState (:,c), & sourceState(p)%p(s)%previousDotState (:,c), &
sourceState(p)%p(s)%previousDotState2(:,c)) sourceState(p)%p(s)%previousDotState2(:,c))
sizeDotState = sourceState(p)%p(s)%sizeDotState sizeDotState = sourceState(p)%p(s)%sizeDotState
sourceStateResiduum(1:sizeDotState,s) = sourceState(p)%p(s)%state (1:sizeDotState,c) & residuum_source(1:sizeDotState,s) = sourceState(p)%p(s)%state (1:sizeDotState,c) &
- sourceState(p)%p(s)%subState0(1:sizeDotState,c) & - sourceState(p)%p(s)%subState0(1:sizeDotState,c) &
- ( sourceState(p)%p(s)%dotState (:,c) * stateDamper & - ( sourceState(p)%p(s)%dotState (:,c) * stateDamper &
+ sourceState(p)%p(s)%previousDotState(:,c) * (1.0_pReal - stateDamper) & + sourceState(p)%p(s)%previousDotState(:,c) * (1.0_pReal - stateDamper) &
) * crystallite_subdt(g,i,e) ) * crystallite_subdt(g,i,e)
! --- correct state with residuum --- sourceState(p)%p(s)%state(1:sizeDotState,c) = sourceState(p)%p(s)%state(1:sizeDotState,c) &
sourceState(p)%p(s)%state(1:sizeDotState,c) = & - residuum_source(1:sizeDotState,s)
sourceState(p)%p(s)%state(1:sizeDotState,c) & sourceState(p)%p(s)%dotState(:,c) = sourceState(p)%p(s)%dotState(:,c) * stateDamper &
- sourceStateResiduum(1:sizeDotState,s) ! need to copy to local variable, since we cant flush a pointer in openmp + sourceState(p)%p(s)%previousDotState(:,c)* (1.0_pReal - stateDamper)
sourceState(p)%p(s)%dotState(:,c) = &
sourceState(p)%p(s)%dotState(:,c) * stateDamper &
+ sourceState(p)%p(s)%previousDotState(:,c) &
* (1.0_pReal - stateDamper)
converged = converged .and. & converged = converged .and. &
all( abs(sourceStateResiduum(1:sizeDotState,s)) < & all( abs(residuum_source(1:sizeDotState,s)) < &
sourceState(p)%p(s)%aTolState(1:sizeDotState) & sourceState(p)%p(s)%aTolState(1:sizeDotState) &
.or. abs(sourceStateResiduum(1:sizeDotState,s)) < & .or. abs(residuum_source(1:sizeDotState,s)) < &
rTol_crystalliteState * abs(sourceState(p)%p(s)%state(1:sizeDotState,c))) rTol_crystalliteState * abs(sourceState(p)%p(s)%state(1:sizeDotState,c)))
enddo enddo
if (converged) crystallite_converged(g,i,e) = .true. ! ... converged per definition if (converged) crystallite_converged(g,i,e) = .true. ! ... converged per definition
@ -1771,8 +1764,6 @@ end subroutine integrateStateEuler
!> @brief integrate stress, state with 1st order Euler method with adaptive step size !> @brief integrate stress, state with 1st order Euler method with adaptive step size
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine integrateStateAdaptiveEuler() subroutine integrateStateAdaptiveEuler()
use, intrinsic :: &
IEEE_arithmetic
use numerics, only: & use numerics, only: &
rTol_crystalliteState rTol_crystalliteState
use mesh, only: & use mesh, only: &