more work on the new state

This commit is contained in:
Martin Diehl 2014-05-27 14:46:03 +00:00
parent f7e574d7ab
commit 164252213b
6 changed files with 788 additions and 348 deletions

View File

@ -33,7 +33,7 @@ module constitutive
constitutive_sizeDotState, & !< size of dotState array
constitutive_sizeState, & !< size of state array per grain
constitutive_sizePostResults !< size of postResults array per grain
integer(pInt), public :: &
integer(pInt), public, protected :: &
constitutive_maxSizeDotState, &
constitutive_maxSizePostResults
integer(pInt), private :: &
@ -41,8 +41,9 @@ module constitutive
#else
integer(pInt), public, dimension(:,:,:), allocatable :: &
constitutive_sizePostResults !< size of postResults array per grain
integer(pInt), public :: &
constitutive_maxSizePostResults
integer(pInt), public, protected :: &
constitutive_maxSizePostResults, &
constitutive_maxSizeDotState
#endif
public :: &
constitutive_init, &
@ -148,6 +149,7 @@ subroutine constitutive_init
eMax, & !< maximum number of elements
phase, &
s, &
p, &
instance,&
myNgrains
@ -508,6 +510,10 @@ subroutine constitutive_init
flush(6)
#else
constitutive_maxSizePostResults = maxval(constitutive_sizePostResults)
constitutive_maxSizeDotState = 0_pInt
do p = 1, size(plasticState)
constitutive_maxSizeDotState = max(constitutive_maxSizeDotState, plasticState(p)%sizeDotState)
enddo
#endif
end subroutine constitutive_init

View File

@ -312,7 +312,8 @@ subroutine constitutive_j2_init(fileUnit)
enddo outputsLoop
#ifdef NEWSTATE
sizeState = 1
plasticState(phase)%stateSize = sizeState
plasticState(phase)%sizeState = sizeState
plasticState(phase)%sizeDotState = sizeState
allocate(plasticState(phase)%state0 (sizeState,NofMyPhase),source=constitutive_j2_tau0(instance))
allocate(plasticState(phase)%partionedState0(sizeState,NofMyPhase),source=constitutive_j2_tau0(instance))
allocate(plasticState(phase)%subState0 (sizeState,NofMyPhase),source=0.0_pReal)

View File

@ -72,7 +72,7 @@ subroutine constitutive_none_init(fileUnit)
#ifdef NEWSTATE
initializeInstances: do phase = 1_pInt, size(phase_plasticity)
if (phase_plasticity(phase) == PLASTICITY_none_ID .and. count(material_phase==phase)/=0) &
plasticState(phase)%stateSize = 0_pInt
plasticState(phase)%sizeState = 0_pInt
enddo initializeInstances
#else
allocate(constitutive_none_sizeDotState(maxNinstance), source=1_pInt)

View File

@ -506,7 +506,8 @@ allocate(constitutive_phenopowerlaw_sizePostResults(maxNinstance),
2_pInt + &
constitutive_phenopowerlaw_totalNslip(instance)+ &
constitutive_phenopowerlaw_totalNtwin(instance) ! s_slip, s_twin, sum(gamma), sum(f), accshear_slip, accshear_twin
plasticState(phase)%stateSize = sizeState
plasticState(phase)%sizeState = sizeState
plasticState(phase)%sizeDotState = sizeState
allocate(plasticState(phase)%aTolState (sizeState), source=0.0_pReal)
allocate(plasticState(phase)%state0 (sizeState,NofMyPhase), source=0.0_pReal)
allocate(plasticState(phase)%partionedState0(sizeState,NofMyPhase), source=0.0_pReal)

File diff suppressed because it is too large Load Diff

View File

@ -60,7 +60,7 @@ module prec
#ifdef NEWSTATE
!http://stackoverflow.com/questions/3948210/can-i-have-a-pointer-to-an-item-in-an-allocatable-array
type, public :: tState
integer(pInt) :: stateSize
integer(pInt) :: sizeState,sizeDotState
real(pReal), pointer, dimension(:) :: atolState
real(pReal), pointer, dimension(:,:) :: state, & ! material points, state size
dotState, &