simplify acces with pointer

naming will be adjusted once global deltaState is removed
This commit is contained in:
Martin Diehl 2022-02-03 23:06:14 +01:00
parent 85ca3a3f24
commit a9a5c8fb73
4 changed files with 11 additions and 8 deletions

View File

@ -436,6 +436,8 @@ subroutine phase_allocateState(state, &
allocate(state%dotState (sizeDotState,NEntries), source=0.0_pReal) allocate(state%dotState (sizeDotState,NEntries), source=0.0_pReal)
allocate(state%deltaState (sizeDeltaState,NEntries), source=0.0_pReal) allocate(state%deltaState (sizeDeltaState,NEntries), source=0.0_pReal)
state%deltaState2 => state%state(state%offsetDeltaState+1: &
state%offsetDeltaState+state%sizeDeltaState,:)
end subroutine phase_allocateState end subroutine phase_allocateState

View File

@ -81,13 +81,13 @@ submodule(phase) mechanical
module function plastic_dotState(subdt,co,ip,el,ph,en) result(dotState) module function plastic_dotState(subdt,co,ip,el,ph,en) result(dotState)
integer, intent(in) :: & integer, intent(in) :: &
co, & !< component-ID of integration point co, & !< constituent
ip, & !< integration point ip, & !< integration point
el, & !< element el, & !< element
ph, & ph, &
en en
real(pReal), intent(in) :: & real(pReal), intent(in) :: &
subdt !< timestep subdt !< timestep
real(pReal), dimension(plasticState(ph)%sizeDotState) :: & real(pReal), dimension(plasticState(ph)%sizeDotState) :: &
dotState dotState
end function plastic_dotState end function plastic_dotState

View File

@ -415,10 +415,9 @@ module function plastic_deltaState(ph, en) result(broken)
broken = any(IEEE_is_NaN(plasticState(ph)%deltaState(:,en))) broken = any(IEEE_is_NaN(plasticState(ph)%deltaState(:,en)))
if (.not. broken) then if (.not. broken) then
myOffset = plasticState(ph)%offsetDeltaState mySize = plasticState(ph)%sizeDeltaState
mySize = plasticState(ph)%sizeDeltaState plasticState(ph)%deltaState2(1:mySize,en) = plasticState(ph)%deltaState2(1:mySize,en) &
plasticState(ph)%state(myOffset + 1:myOffset + mySize,en) = & + plasticState(ph)%deltaState(1:mySize,en)
plasticState(ph)%state(myOffset + 1:myOffset + mySize,en) + plasticState(ph)%deltaState(1:mySize,en)
end if end if
end select end select

View File

@ -45,6 +45,8 @@ module prec
state, & !< state state, & !< state
dotState, & !< rate of state change dotState, & !< rate of state change
deltaState !< increment of state change deltaState !< increment of state change
real(pReal), pointer, dimension(:,:) :: &
deltaState2
end type end type
type, extends(tState) :: tPlasticState type, extends(tState) :: tPlasticState