Merge branch '5-flexible-dot-delta-state-relation' into 'development'
added offsetDeltaState to type-definition and respect this when applying deltaState Closes #5 See merge request !15
This commit is contained in:
commit
05bb3c109c
|
@ -3084,35 +3084,49 @@ logical function crystallite_stateJump(ipc,ip,el)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer(pInt), intent(in):: &
|
integer(pInt), intent(in):: &
|
||||||
el, & ! element index
|
el, & ! element index
|
||||||
ip, & ! integration point index
|
ip, & ! integration point index
|
||||||
ipc ! grain index
|
ipc ! grain index
|
||||||
|
|
||||||
integer(pInt) :: &
|
integer(pInt) :: &
|
||||||
c, &
|
c, &
|
||||||
p, &
|
p, &
|
||||||
mySource, &
|
mySource, &
|
||||||
|
myOffsetPlasticDeltaState, &
|
||||||
|
myOffsetSourceDeltaState, &
|
||||||
mySizePlasticDeltaState, &
|
mySizePlasticDeltaState, &
|
||||||
mySizeSourceDeltaState
|
mySizeSourceDeltaState
|
||||||
|
|
||||||
c= phasememberAt(ipc,ip,el)
|
c = phasememberAt(ipc,ip,el)
|
||||||
p = phaseAt(ipc,ip,el)
|
p = phaseAt(ipc,ip,el)
|
||||||
|
|
||||||
call constitutive_collectDeltaState(crystallite_Tstar_v(1:6,ipc,ip,el), crystallite_Fe(1:3,1:3,ipc,ip,el), ipc,ip,el)
|
call constitutive_collectDeltaState(crystallite_Tstar_v(1:6,ipc,ip,el), crystallite_Fe(1:3,1:3,ipc,ip,el), ipc,ip,el)
|
||||||
mySizePlasticDeltaState = plasticState(p)%sizeDeltaState
|
|
||||||
if( any(IEEE_is_NaN(plasticState(p)%deltaState(:,c)))) then ! NaN occured in deltaState
|
myOffsetPlasticDeltaState = plasticState(p)%offsetDeltaState
|
||||||
|
mySizePlasticDeltaState = plasticState(p)%sizeDeltaState
|
||||||
|
|
||||||
|
if( any(IEEE_is_NaN(plasticState(p)%deltaState(1:mySizePlasticDeltaState,c)))) then ! NaN occured in deltaState
|
||||||
crystallite_stateJump = .false.
|
crystallite_stateJump = .false.
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
plasticState(p)%state(1:mySizePlasticDeltaState,c) = plasticState(p)%state(1:mySizePlasticDeltaState,c) + &
|
|
||||||
plasticState(p)%deltaState(1:mySizePlasticDeltaState,c)
|
plasticState(p)%state(myOffsetPlasticDeltaState + 1_pInt : &
|
||||||
|
myOffsetPlasticDeltaState + mySizePlasticDeltaState,c) = &
|
||||||
|
plasticState(p)%state(myOffsetPlasticDeltaState + 1_pInt : &
|
||||||
|
myOffsetPlasticDeltaState + mySizePlasticDeltaState,c) + &
|
||||||
|
plasticState(p)%deltaState(1:mySizePlasticDeltaState,c)
|
||||||
|
|
||||||
do mySource = 1_pInt, phase_Nsources(p)
|
do mySource = 1_pInt, phase_Nsources(p)
|
||||||
mySizeSourceDeltaState = sourceState(p)%p(mySource)%sizeDeltaState
|
myOffsetSourceDeltaState = sourceState(p)%p(mySource)%offsetDeltaState
|
||||||
if( any(IEEE_is_NaN(sourceState(p)%p(mySource)%deltaState(:,c)))) then ! NaN occured in deltaState
|
mySizeSourceDeltaState = sourceState(p)%p(mySource)%sizeDeltaState
|
||||||
|
if (any(IEEE_is_NaN(sourceState(p)%p(mySource)%deltaState(1:mySizeSourceDeltaState,c)))) then ! NaN occured in deltaState
|
||||||
crystallite_stateJump = .false.
|
crystallite_stateJump = .false.
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
sourceState(p)%p(mySource)%state(1:mySizeSourceDeltaState,c) = &
|
sourceState(p)%p(mySource)%state(myOffsetSourceDeltaState + 1_pInt : &
|
||||||
sourceState(p)%p(mySource)%state(1:mySizeSourceDeltaState,c) + &
|
myOffsetSourceDeltaState + mySizeSourceDeltaState,c) = &
|
||||||
|
sourceState(p)%p(mySource)%state(myOffsetSourceDeltaState + 1_pInt : &
|
||||||
|
myOffsetSourceDeltaState + mySizeSourceDeltaState,c) + &
|
||||||
sourceState(p)%p(mySource)%deltaState(1:mySizeSourceDeltaState,c)
|
sourceState(p)%p(mySource)%deltaState(1:mySizeSourceDeltaState,c)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
@ -3123,7 +3137,9 @@ logical function crystallite_stateJump(ipc,ip,el)
|
||||||
.or. .not. iand(debug_level(debug_crystallite), debug_levelSelective) /= 0_pInt)) then
|
.or. .not. iand(debug_level(debug_crystallite), debug_levelSelective) /= 0_pInt)) then
|
||||||
write(6,'(a,i8,1x,i2,1x,i3, /)') '<< CRYST >> update state at el ip ipc ',el,ip,ipc
|
write(6,'(a,i8,1x,i2,1x,i3, /)') '<< CRYST >> update state at el ip ipc ',el,ip,ipc
|
||||||
write(6,'(a,/,(12x,12(e12.5,1x)),/)') '<< CRYST >> deltaState', plasticState(p)%deltaState(1:mySizePlasticDeltaState,c)
|
write(6,'(a,/,(12x,12(e12.5,1x)),/)') '<< CRYST >> deltaState', plasticState(p)%deltaState(1:mySizePlasticDeltaState,c)
|
||||||
write(6,'(a,/,(12x,12(e12.5,1x)),/)') '<< CRYST >> new state', plasticState(p)%state (1:mySizePlasticDeltaState,c)
|
write(6,'(a,/,(12x,12(e12.5,1x)),/)') '<< CRYST >> new state', &
|
||||||
|
plasticState(p)%state(myOffsetSourceDeltaState + 1_pInt : &
|
||||||
|
myOffsetSourceDeltaState + mySizeSourceDeltaState,c)
|
||||||
endif
|
endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
15
src/prec.f90
15
src/prec.f90
|
@ -39,20 +39,21 @@ module prec
|
||||||
!http://stackoverflow.com/questions/3948210/can-i-have-a-pointer-to-an-item-in-an-allocatable-array
|
!http://stackoverflow.com/questions/3948210/can-i-have-a-pointer-to-an-item-in-an-allocatable-array
|
||||||
type, public :: tState
|
type, public :: tState
|
||||||
integer(pInt) :: &
|
integer(pInt) :: &
|
||||||
sizeState = 0_pInt , & !< size of state
|
sizeState = 0_pInt, & !< size of state
|
||||||
sizeDotState = 0_pInt, & !< size of dot state, i.e. parts of the state that are integrated
|
sizeDotState = 0_pInt, & !< size of dot state, i.e. state(1:sizeDot) follows time evolution by dotState rates
|
||||||
sizeDeltaState = 0_pInt, & !< size of delta state, i.e. parts of the state that have discontinuous rates
|
offsetDeltaState = 0_pInt, & !< offset of delta state
|
||||||
sizePostResults = 0_pInt !< size of output data
|
sizeDeltaState = 0_pInt, & !< size of delta state, i.e. state(offset+1:offset+sizeDot) follows time evolution by deltaState increments
|
||||||
|
sizePostResults = 0_pInt !< size of output data
|
||||||
real(pReal), pointer, dimension(:), contiguous :: &
|
real(pReal), pointer, dimension(:), contiguous :: &
|
||||||
atolState
|
atolState
|
||||||
real(pReal), pointer, dimension(:,:), contiguous :: & ! a pointer is needed here because we might point to state/doState. However, they will never point to something, but are rather allocated and, hence, contiguous
|
real(pReal), pointer, dimension(:,:), contiguous :: & ! a pointer is needed here because we might point to state/doState. However, they will never point to something, but are rather allocated and, hence, contiguous
|
||||||
|
state0, &
|
||||||
state, & !< state
|
state, & !< state
|
||||||
dotState, & !< state rate
|
dotState, & !< rate of state change
|
||||||
state0
|
deltaState !< increment of state change
|
||||||
real(pReal), allocatable, dimension(:,:) :: &
|
real(pReal), allocatable, dimension(:,:) :: &
|
||||||
partionedState0, &
|
partionedState0, &
|
||||||
subState0, &
|
subState0, &
|
||||||
deltaState, &
|
|
||||||
previousDotState, & !< state rate of previous xxxx
|
previousDotState, & !< state rate of previous xxxx
|
||||||
previousDotState2, & !< state rate two xxxx ago
|
previousDotState2, & !< state rate two xxxx ago
|
||||||
RK4dotState
|
RK4dotState
|
||||||
|
|
Loading…
Reference in New Issue