renamed instance consistently to "instance" as a preparation for new structure / elastic matrix handling

This commit is contained in:
Martin Diehl 2014-02-28 10:18:40 +00:00
parent f146359c04
commit 650b71ffa9
6 changed files with 1219 additions and 1156 deletions

View File

@ -138,9 +138,9 @@ subroutine constitutive_init
cMax, & !< maximum number of grains cMax, & !< maximum number of grains
iMax, & !< maximum number of integration points iMax, & !< maximum number of integration points
eMax, & !< maximum number of elements eMax, & !< maximum number of elements
p, & phase, &
s, & s, &
matID,& instance,&
myNgrains myNgrains
integer(pInt), dimension(:,:), pointer :: thisSize integer(pInt), dimension(:,:), pointer :: thisSize
character(len=64), dimension(:,:), pointer :: thisOutput character(len=64), dimension(:,:), pointer :: thisOutput
@ -170,10 +170,10 @@ subroutine constitutive_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! write description file for constitutive phase output ! write description file for constitutive phase output
call IO_write_jobFile(FILEUNIT,'outputConstitutive') call IO_write_jobFile(FILEUNIT,'outputConstitutive')
do p = 1_pInt,material_Nphase do phase = 1_pInt,material_Nphase
i = phase_plasticityInstance(p) ! which instance of a plasticity is present phase instance = phase_plasticityInstance(phase) ! which instance of a plasticity is present phase
knownPlasticity = .true. ! assume valid knownPlasticity = .true. ! assume valid
select case(phase_plasticity(p)) ! split per constititution select case(phase_plasticity(phase)) ! split per constititution
case (PLASTICITY_NONE_ID) case (PLASTICITY_NONE_ID)
outputName = PLASTICITY_NONE_label outputName = PLASTICITY_NONE_label
thisOutput => NULL() ! constitutive_none_output thisOutput => NULL() ! constitutive_none_output
@ -201,11 +201,11 @@ subroutine constitutive_init
case default case default
knownPlasticity = .false. knownPlasticity = .false.
end select end select
write(FILEUNIT,'(/,a,/)') '['//trim(phase_name(p))//']' write(FILEUNIT,'(/,a,/)') '['//trim(phase_name(phase))//']'
if (knownPlasticity) then if (knownPlasticity) then
write(FILEUNIT,'(a)') '(plasticity)'//char(9)//trim(outputName) write(FILEUNIT,'(a)') '(plasticity)'//char(9)//trim(outputName)
do e = 1_pInt,phase_Noutput(p) do e = 1_pInt,phase_Noutput(instance)
write(FILEUNIT,'(a,i4)') trim(thisOutput(e,i))//char(9),thisSize(e,i) write(FILEUNIT,'(a,i4)') trim(thisOutput(e,instance))//char(9),thisSize(e,instance)
enddo enddo
endif endif
enddo enddo
@ -247,28 +247,28 @@ subroutine constitutive_init
select case(phase_elasticity(material_phase(g,i,e))) select case(phase_elasticity(material_phase(g,i,e)))
case default ! so far no output for elasticity case default ! so far no output for elasticity
end select end select
matID = phase_plasticityInstance(material_phase(g,i,e)) instance = phase_plasticityInstance(material_phase(g,i,e))
select case(phase_plasticity(material_phase(g,i,e))) select case(phase_plasticity(material_phase(g,i,e)))
case (PLASTICITY_NONE_ID) case (PLASTICITY_NONE_ID)
allocate(constitutive_state0(g,i,e)%p(constitutive_none_sizeState(matID))) allocate(constitutive_state0(g,i,e)%p(constitutive_none_sizeState(instance)))
allocate(constitutive_partionedState0(g,i,e)%p(constitutive_none_sizeState(matID))) allocate(constitutive_partionedState0(g,i,e)%p(constitutive_none_sizeState(instance)))
allocate(constitutive_subState0(g,i,e)%p(constitutive_none_sizeState(matID))) allocate(constitutive_subState0(g,i,e)%p(constitutive_none_sizeState(instance)))
allocate(constitutive_state(g,i,e)%p(constitutive_none_sizeState(matID))) allocate(constitutive_state(g,i,e)%p(constitutive_none_sizeState(instance)))
allocate(constitutive_state_backup(g,i,e)%p(constitutive_none_sizeState(matID))) allocate(constitutive_state_backup(g,i,e)%p(constitutive_none_sizeState(instance)))
allocate(constitutive_aTolState(g,i,e)%p(constitutive_none_sizeState(matID))) allocate(constitutive_aTolState(g,i,e)%p(constitutive_none_sizeState(instance)))
allocate(constitutive_dotState(g,i,e)%p(constitutive_none_sizeDotState(matID))) allocate(constitutive_dotState(g,i,e)%p(constitutive_none_sizeDotState(instance)))
allocate(constitutive_deltaState(g,i,e)%p(constitutive_none_sizeDotState(matID))) allocate(constitutive_deltaState(g,i,e)%p(constitutive_none_sizeDotState(instance)))
allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_none_sizeDotState(matID))) allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_none_sizeDotState(instance)))
if (any(numerics_integrator == 1_pInt)) then if (any(numerics_integrator == 1_pInt)) then
allocate(constitutive_previousDotState(g,i,e)%p(constitutive_none_sizeDotState(matID))) allocate(constitutive_previousDotState(g,i,e)%p(constitutive_none_sizeDotState(instance)))
allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_none_sizeDotState(matID))) allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_none_sizeDotState(instance)))
endif endif
if (any(numerics_integrator == 4_pInt)) then if (any(numerics_integrator == 4_pInt)) then
allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_none_sizeDotState(matID))) allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_none_sizeDotState(instance)))
endif endif
if (any(numerics_integrator == 5_pInt)) then if (any(numerics_integrator == 5_pInt)) then
do s = 1_pInt,6_pInt do s = 1_pInt,6_pInt
allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_none_sizeDotState(matID))) allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_none_sizeDotState(instance)))
enddo enddo
endif endif
constitutive_state0(g,i,e)%p = 0.0_pReal constitutive_state0(g,i,e)%p = 0.0_pReal
@ -277,141 +277,141 @@ subroutine constitutive_init
constitutive_sizeDotState(g,i,e) = 0_pInt constitutive_sizeDotState(g,i,e) = 0_pInt
constitutive_sizePostResults(g,i,e) = 0_pInt constitutive_sizePostResults(g,i,e) = 0_pInt
case (PLASTICITY_J2_ID) case (PLASTICITY_J2_ID)
allocate(constitutive_state0(g,i,e)%p(constitutive_j2_sizeState(matID))) allocate(constitutive_state0(g,i,e)%p(constitutive_j2_sizeState(instance)))
allocate(constitutive_partionedState0(g,i,e)%p(constitutive_j2_sizeState(matID))) allocate(constitutive_partionedState0(g,i,e)%p(constitutive_j2_sizeState(instance)))
allocate(constitutive_subState0(g,i,e)%p(constitutive_j2_sizeState(matID))) allocate(constitutive_subState0(g,i,e)%p(constitutive_j2_sizeState(instance)))
allocate(constitutive_state(g,i,e)%p(constitutive_j2_sizeState(matID))) allocate(constitutive_state(g,i,e)%p(constitutive_j2_sizeState(instance)))
allocate(constitutive_state_backup(g,i,e)%p(constitutive_j2_sizeState(matID))) allocate(constitutive_state_backup(g,i,e)%p(constitutive_j2_sizeState(instance)))
allocate(constitutive_aTolState(g,i,e)%p(constitutive_j2_sizeState(matID))) allocate(constitutive_aTolState(g,i,e)%p(constitutive_j2_sizeState(instance)))
allocate(constitutive_dotState(g,i,e)%p(constitutive_j2_sizeDotState(matID))) allocate(constitutive_dotState(g,i,e)%p(constitutive_j2_sizeDotState(instance)))
allocate(constitutive_deltaState(g,i,e)%p(constitutive_j2_sizeDotState(matID))) allocate(constitutive_deltaState(g,i,e)%p(constitutive_j2_sizeDotState(instance)))
allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_j2_sizeDotState(matID))) allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_j2_sizeDotState(instance)))
if (any(numerics_integrator == 1_pInt)) then if (any(numerics_integrator == 1_pInt)) then
allocate(constitutive_previousDotState(g,i,e)%p(constitutive_j2_sizeDotState(matID))) allocate(constitutive_previousDotState(g,i,e)%p(constitutive_j2_sizeDotState(instance)))
allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_j2_sizeDotState(matID))) allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_j2_sizeDotState(instance)))
endif endif
if (any(numerics_integrator == 4_pInt)) then if (any(numerics_integrator == 4_pInt)) then
allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_j2_sizeDotState(matID))) allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_j2_sizeDotState(instance)))
endif endif
if (any(numerics_integrator == 5_pInt)) then if (any(numerics_integrator == 5_pInt)) then
do s = 1_pInt,6_pInt do s = 1_pInt,6_pInt
allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_j2_sizeDotState(matID))) allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_j2_sizeDotState(instance)))
enddo enddo
endif endif
constitutive_state0(g,i,e)%p = constitutive_j2_stateInit(matID) constitutive_state0(g,i,e)%p = constitutive_j2_stateInit(instance)
constitutive_aTolState(g,i,e)%p = constitutive_j2_aTolState(matID) constitutive_aTolState(g,i,e)%p = constitutive_j2_aTolState(instance)
constitutive_sizeState(g,i,e) = constitutive_j2_sizeState(matID) constitutive_sizeState(g,i,e) = constitutive_j2_sizeState(instance)
constitutive_sizeDotState(g,i,e) = constitutive_j2_sizeDotState(matID) constitutive_sizeDotState(g,i,e) = constitutive_j2_sizeDotState(instance)
constitutive_sizePostResults(g,i,e) = constitutive_j2_sizePostResults(matID) constitutive_sizePostResults(g,i,e) = constitutive_j2_sizePostResults(instance)
case (PLASTICITY_PHENOPOWERLAW_ID) case (PLASTICITY_PHENOPOWERLAW_ID)
allocate(constitutive_state0(g,i,e)%p(constitutive_phenopowerlaw_sizeState(matID))) allocate(constitutive_state0(g,i,e)%p(constitutive_phenopowerlaw_sizeState(instance)))
allocate(constitutive_partionedState0(g,i,e)%p(constitutive_phenopowerlaw_sizeState(matID))) allocate(constitutive_partionedState0(g,i,e)%p(constitutive_phenopowerlaw_sizeState(instance)))
allocate(constitutive_subState0(g,i,e)%p(constitutive_phenopowerlaw_sizeState(matID))) allocate(constitutive_subState0(g,i,e)%p(constitutive_phenopowerlaw_sizeState(instance)))
allocate(constitutive_state(g,i,e)%p(constitutive_phenopowerlaw_sizeState(matID))) allocate(constitutive_state(g,i,e)%p(constitutive_phenopowerlaw_sizeState(instance)))
allocate(constitutive_state_backup(g,i,e)%p(constitutive_phenopowerlaw_sizeState(matID))) allocate(constitutive_state_backup(g,i,e)%p(constitutive_phenopowerlaw_sizeState(instance)))
allocate(constitutive_aTolState(g,i,e)%p(constitutive_phenopowerlaw_sizeState(matID))) allocate(constitutive_aTolState(g,i,e)%p(constitutive_phenopowerlaw_sizeState(instance)))
allocate(constitutive_dotState(g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(matID))) allocate(constitutive_dotState(g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(instance)))
allocate(constitutive_deltaState(g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(matID))) allocate(constitutive_deltaState(g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(instance)))
allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(matID))) allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(instance)))
if (any(numerics_integrator == 1_pInt)) then if (any(numerics_integrator == 1_pInt)) then
allocate(constitutive_previousDotState(g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(matID))) allocate(constitutive_previousDotState(g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(instance)))
allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(matID))) allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(instance)))
endif endif
if (any(numerics_integrator == 4_pInt)) then if (any(numerics_integrator == 4_pInt)) then
allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(matID))) allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(instance)))
endif endif
if (any(numerics_integrator == 5_pInt)) then if (any(numerics_integrator == 5_pInt)) then
do s = 1_pInt,6_pInt do s = 1_pInt,6_pInt
allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(matID))) allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_phenopowerlaw_sizeDotState(instance)))
enddo enddo
endif endif
constitutive_state0(g,i,e)%p = constitutive_phenopowerlaw_stateInit(matID) constitutive_state0(g,i,e)%p = constitutive_phenopowerlaw_stateInit(instance)
constitutive_aTolState(g,i,e)%p = constitutive_phenopowerlaw_aTolState(matID) constitutive_aTolState(g,i,e)%p = constitutive_phenopowerlaw_aTolState(instance)
constitutive_sizeState(g,i,e) = constitutive_phenopowerlaw_sizeState(matID) constitutive_sizeState(g,i,e) = constitutive_phenopowerlaw_sizeState(instance)
constitutive_sizeDotState(g,i,e) = constitutive_phenopowerlaw_sizeDotState(matID) constitutive_sizeDotState(g,i,e) = constitutive_phenopowerlaw_sizeDotState(instance)
constitutive_sizePostResults(g,i,e) = constitutive_phenopowerlaw_sizePostResults(matID) constitutive_sizePostResults(g,i,e) = constitutive_phenopowerlaw_sizePostResults(instance)
case (PLASTICITY_DISLOTWIN_ID) case (PLASTICITY_DISLOTWIN_ID)
allocate(constitutive_state0(g,i,e)%p(constitutive_dislotwin_sizeState(matID))) allocate(constitutive_state0(g,i,e)%p(constitutive_dislotwin_sizeState(instance)))
allocate(constitutive_partionedState0(g,i,e)%p(constitutive_dislotwin_sizeState(matID))) allocate(constitutive_partionedState0(g,i,e)%p(constitutive_dislotwin_sizeState(instance)))
allocate(constitutive_subState0(g,i,e)%p(constitutive_dislotwin_sizeState(matID))) allocate(constitutive_subState0(g,i,e)%p(constitutive_dislotwin_sizeState(instance)))
allocate(constitutive_state(g,i,e)%p(constitutive_dislotwin_sizeState(matID))) allocate(constitutive_state(g,i,e)%p(constitutive_dislotwin_sizeState(instance)))
allocate(constitutive_state_backup(g,i,e)%p(constitutive_dislotwin_sizeState(matID))) allocate(constitutive_state_backup(g,i,e)%p(constitutive_dislotwin_sizeState(instance)))
allocate(constitutive_aTolState(g,i,e)%p(constitutive_dislotwin_sizeState(matID))) allocate(constitutive_aTolState(g,i,e)%p(constitutive_dislotwin_sizeState(instance)))
allocate(constitutive_dotState(g,i,e)%p(constitutive_dislotwin_sizeDotState(matID))) allocate(constitutive_dotState(g,i,e)%p(constitutive_dislotwin_sizeDotState(instance)))
allocate(constitutive_deltaState(g,i,e)%p(constitutive_dislotwin_sizeDotState(matID))) allocate(constitutive_deltaState(g,i,e)%p(constitutive_dislotwin_sizeDotState(instance)))
allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_dislotwin_sizeDotState(matID))) allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_dislotwin_sizeDotState(instance)))
if (any(numerics_integrator == 1_pInt)) then if (any(numerics_integrator == 1_pInt)) then
allocate(constitutive_previousDotState(g,i,e)%p(constitutive_dislotwin_sizeDotState(matID))) allocate(constitutive_previousDotState(g,i,e)%p(constitutive_dislotwin_sizeDotState(instance)))
allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_dislotwin_sizeDotState(matID))) allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_dislotwin_sizeDotState(instance)))
endif endif
if (any(numerics_integrator == 4_pInt)) then if (any(numerics_integrator == 4_pInt)) then
allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_dislotwin_sizeDotState(matID))) allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_dislotwin_sizeDotState(instance)))
endif endif
if (any(numerics_integrator == 5_pInt)) then if (any(numerics_integrator == 5_pInt)) then
do s = 1_pInt,6_pInt do s = 1_pInt,6_pInt
allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_dislotwin_sizeDotState(matID))) allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_dislotwin_sizeDotState(instance)))
enddo enddo
endif endif
constitutive_state0(g,i,e)%p = constitutive_dislotwin_stateInit(matID) constitutive_state0(g,i,e)%p = constitutive_dislotwin_stateInit(instance)
constitutive_aTolState(g,i,e)%p = constitutive_dislotwin_aTolState(matID) constitutive_aTolState(g,i,e)%p = constitutive_dislotwin_aTolState(instance)
constitutive_sizeState(g,i,e) = constitutive_dislotwin_sizeState(matID) constitutive_sizeState(g,i,e) = constitutive_dislotwin_sizeState(instance)
constitutive_sizeDotState(g,i,e) = constitutive_dislotwin_sizeDotState(matID) constitutive_sizeDotState(g,i,e) = constitutive_dislotwin_sizeDotState(instance)
constitutive_sizePostResults(g,i,e) = constitutive_dislotwin_sizePostResults(matID) constitutive_sizePostResults(g,i,e) = constitutive_dislotwin_sizePostResults(instance)
case (PLASTICITY_TITANMOD_ID) case (PLASTICITY_TITANMOD_ID)
allocate(constitutive_state0(g,i,e)%p(constitutive_titanmod_sizeState(matID))) allocate(constitutive_state0(g,i,e)%p(constitutive_titanmod_sizeState(instance)))
allocate(constitutive_partionedState0(g,i,e)%p(constitutive_titanmod_sizeState(matID))) allocate(constitutive_partionedState0(g,i,e)%p(constitutive_titanmod_sizeState(instance)))
allocate(constitutive_subState0(g,i,e)%p(constitutive_titanmod_sizeState(matID))) allocate(constitutive_subState0(g,i,e)%p(constitutive_titanmod_sizeState(instance)))
allocate(constitutive_state(g,i,e)%p(constitutive_titanmod_sizeState(matID))) allocate(constitutive_state(g,i,e)%p(constitutive_titanmod_sizeState(instance)))
allocate(constitutive_state_backup(g,i,e)%p(constitutive_titanmod_sizeState(matID))) allocate(constitutive_state_backup(g,i,e)%p(constitutive_titanmod_sizeState(instance)))
allocate(constitutive_aTolState(g,i,e)%p(constitutive_titanmod_sizeState(matID))) allocate(constitutive_aTolState(g,i,e)%p(constitutive_titanmod_sizeState(instance)))
allocate(constitutive_dotState(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) allocate(constitutive_dotState(g,i,e)%p(constitutive_titanmod_sizeDotState(instance)))
allocate(constitutive_deltaState(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) allocate(constitutive_deltaState(g,i,e)%p(constitutive_titanmod_sizeDotState(instance)))
allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_titanmod_sizeDotState(instance)))
if (any(numerics_integrator == 1_pInt)) then if (any(numerics_integrator == 1_pInt)) then
allocate(constitutive_previousDotState(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) allocate(constitutive_previousDotState(g,i,e)%p(constitutive_titanmod_sizeDotState(instance)))
allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_titanmod_sizeDotState(instance)))
endif endif
if (any(numerics_integrator == 4_pInt)) then if (any(numerics_integrator == 4_pInt)) then
allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_titanmod_sizeDotState(instance)))
endif endif
if (any(numerics_integrator == 5_pInt)) then if (any(numerics_integrator == 5_pInt)) then
do s = 1_pInt,6_pInt do s = 1_pInt,6_pInt
allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_titanmod_sizeDotState(matID))) allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_titanmod_sizeDotState(instance)))
enddo enddo
endif endif
constitutive_state0(g,i,e)%p = constitutive_titanmod_stateInit(matID) constitutive_state0(g,i,e)%p = constitutive_titanmod_stateInit(instance)
constitutive_aTolState(g,i,e)%p = constitutive_titanmod_aTolState(matID) constitutive_aTolState(g,i,e)%p = constitutive_titanmod_aTolState(instance)
constitutive_sizeState(g,i,e) = constitutive_titanmod_sizeState(matID) constitutive_sizeState(g,i,e) = constitutive_titanmod_sizeState(instance)
constitutive_sizeDotState(g,i,e) = constitutive_titanmod_sizeDotState(matID) constitutive_sizeDotState(g,i,e) = constitutive_titanmod_sizeDotState(instance)
constitutive_sizePostResults(g,i,e) = constitutive_titanmod_sizePostResults(matID) constitutive_sizePostResults(g,i,e) = constitutive_titanmod_sizePostResults(instance)
case (PLASTICITY_NONLOCAL_ID) case (PLASTICITY_NONLOCAL_ID)
nonlocalConstitutionPresent = .true. nonlocalConstitutionPresent = .true.
if(myNgrains/=1_pInt) call IO_error(252_pInt, e,i,g) if(myNgrains/=1_pInt) call IO_error(252_pInt, e,i,g)
allocate(constitutive_state0(g,i,e)%p(constitutive_nonlocal_sizeState(matID))) allocate(constitutive_state0(g,i,e)%p(constitutive_nonlocal_sizeState(instance)))
allocate(constitutive_partionedState0(g,i,e)%p(constitutive_nonlocal_sizeState(matID))) allocate(constitutive_partionedState0(g,i,e)%p(constitutive_nonlocal_sizeState(instance)))
allocate(constitutive_subState0(g,i,e)%p(constitutive_nonlocal_sizeState(matID))) allocate(constitutive_subState0(g,i,e)%p(constitutive_nonlocal_sizeState(instance)))
allocate(constitutive_state(g,i,e)%p(constitutive_nonlocal_sizeState(matID))) allocate(constitutive_state(g,i,e)%p(constitutive_nonlocal_sizeState(instance)))
allocate(constitutive_state_backup(g,i,e)%p(constitutive_nonlocal_sizeState(matID))) allocate(constitutive_state_backup(g,i,e)%p(constitutive_nonlocal_sizeState(instance)))
allocate(constitutive_aTolState(g,i,e)%p(constitutive_nonlocal_sizeState(matID))) allocate(constitutive_aTolState(g,i,e)%p(constitutive_nonlocal_sizeState(instance)))
allocate(constitutive_dotState(g,i,e)%p(constitutive_nonlocal_sizeDotState(matID))) allocate(constitutive_dotState(g,i,e)%p(constitutive_nonlocal_sizeDotState(instance)))
allocate(constitutive_deltaState(g,i,e)%p(constitutive_nonlocal_sizeDotState(matID))) allocate(constitutive_deltaState(g,i,e)%p(constitutive_nonlocal_sizeDotState(instance)))
allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_nonlocal_sizeDotState(matID))) allocate(constitutive_dotState_backup(g,i,e)%p(constitutive_nonlocal_sizeDotState(instance)))
if (any(numerics_integrator == 1_pInt)) then if (any(numerics_integrator == 1_pInt)) then
allocate(constitutive_previousDotState(g,i,e)%p(constitutive_nonlocal_sizeDotState(matID))) allocate(constitutive_previousDotState(g,i,e)%p(constitutive_nonlocal_sizeDotState(instance)))
allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_nonlocal_sizeDotState(matID))) allocate(constitutive_previousDotState2(g,i,e)%p(constitutive_nonlocal_sizeDotState(instance)))
endif endif
if (any(numerics_integrator == 4_pInt)) then if (any(numerics_integrator == 4_pInt)) then
allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_nonlocal_sizeDotState(matID))) allocate(constitutive_RK4dotState(g,i,e)%p(constitutive_nonlocal_sizeDotState(instance)))
endif endif
if (any(numerics_integrator == 5_pInt)) then if (any(numerics_integrator == 5_pInt)) then
do s = 1_pInt,6_pInt do s = 1_pInt,6_pInt
allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_nonlocal_sizeDotState(matID))) allocate(constitutive_RKCK45dotState(s,g,i,e)%p(constitutive_nonlocal_sizeDotState(instance)))
enddo enddo
endif endif
constitutive_aTolState(g,i,e)%p = constitutive_nonlocal_aTolState(matID) constitutive_aTolState(g,i,e)%p = constitutive_nonlocal_aTolState(instance)
constitutive_sizeState(g,i,e) = constitutive_nonlocal_sizeState(matID) constitutive_sizeState(g,i,e) = constitutive_nonlocal_sizeState(instance)
constitutive_sizeDotState(g,i,e) = constitutive_nonlocal_sizeDotState(matID) constitutive_sizeDotState(g,i,e) = constitutive_nonlocal_sizeDotState(instance)
constitutive_sizePostResults(g,i,e) = constitutive_nonlocal_sizePostResults(matID) constitutive_sizePostResults(g,i,e) = constitutive_nonlocal_sizePostResults(instance)
end select end select
enddo enddo
enddo enddo

File diff suppressed because it is too large Load Diff

View File

@ -128,7 +128,7 @@ subroutine constitutive_j2_init(fileUnit)
integer(pInt), parameter :: MAXNCHUNKS = 7_pInt integer(pInt), parameter :: MAXNCHUNKS = 7_pInt
integer(pInt), dimension(1_pInt+2_pInt*MAXNCHUNKS) :: positions integer(pInt), dimension(1_pInt+2_pInt*MAXNCHUNKS) :: positions
integer(pInt) :: section = 0_pInt, maxNinstance, i,o, mySize integer(pInt) :: section = 0_pInt, maxNinstance, instance,o, mySize
character(len=65536) :: & character(len=65536) :: &
tag = '', & tag = '', &
line = '' line = ''
@ -182,69 +182,69 @@ subroutine constitutive_j2_init(fileUnit)
if (IO_getTag(line,'[',']') /= '') then ! next section if (IO_getTag(line,'[',']') /= '') then ! next section
section = section + 1_pInt ! advance section counter section = section + 1_pInt ! advance section counter
if (phase_plasticity(section) == PLASTICITY_J2_ID) then if (phase_plasticity(section) == PLASTICITY_J2_ID) then
i = phase_plasticityInstance(section) instance = phase_plasticityInstance(section)
constitutive_j2_Cslip_66(1:6,1:6,i) = lattice_Cslip_66(1:6,1:6,section) constitutive_j2_Cslip_66(1:6,1:6,instance) = lattice_Cslip_66(1:6,1:6,section)
endif endif
cycle ! skip to next line cycle ! skip to next line
endif endif
if (section > 0_pInt ) then; if (phase_plasticity(section) == PLASTICITY_J2_ID) then ! one of my sections. Do not short-circuit here (.and. between if-statements), it's not safe in Fortran if (section > 0_pInt ) then; if (phase_plasticity(section) == PLASTICITY_J2_ID) then ! one of my sections. Do not short-circuit here (.and. between if-statements), it's not safe in Fortran
i = phase_plasticityInstance(section) ! which instance of my plasticity is present phase instance = phase_plasticityInstance(section) ! which instance of my plasticity is present phase
positions = IO_stringPos(line,MAXNCHUNKS) positions = IO_stringPos(line,MAXNCHUNKS)
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
select case(tag) select case(tag)
case ('plasticity','elasticity','lattice_structure','covera_ratio',& case ('plasticity','elasticity','lattice_structure','covera_ratio',&
'c11','c12','c13','c22','c23','c33','c44','c55','c66') 'c11','c12','c13','c22','c23','c33','c44','c55','c66')
case ('(output)') case ('(output)')
constitutive_j2_Noutput(i) = constitutive_j2_Noutput(i) + 1_pInt constitutive_j2_Noutput(instance) = constitutive_j2_Noutput(instance) + 1_pInt
constitutive_j2_output(constitutive_j2_Noutput(i),i) = & constitutive_j2_output(constitutive_j2_Noutput(instance),instance) = &
IO_lc(IO_stringValue(line,positions,2_pInt)) IO_lc(IO_stringValue(line,positions,2_pInt))
select case(IO_lc(IO_stringValue(line,positions,2_pInt))) select case(IO_lc(IO_stringValue(line,positions,2_pInt)))
case ('flowstress') case ('flowstress')
constitutive_j2_outputID(constitutive_j2_Noutput(i),i) = flowstress_ID constitutive_j2_outputID(constitutive_j2_Noutput(instance),instance) = flowstress_ID
case ('strainrate') case ('strainrate')
constitutive_j2_outputID(constitutive_j2_Noutput(i),i) = strainrate_ID constitutive_j2_outputID(constitutive_j2_Noutput(instance),instance) = strainrate_ID
case default case default
call IO_error(105_pInt,ext_msg=IO_stringValue(line,positions,2_pInt)//' ('//PLASTICITY_J2_label//')') call IO_error(105_pInt,ext_msg=IO_stringValue(line,positions,2_pInt)//' ('//PLASTICITY_J2_label//')')
end select end select
case ('tau0') case ('tau0')
constitutive_j2_tau0(i) = IO_floatValue(line,positions,2_pInt) constitutive_j2_tau0(instance) = IO_floatValue(line,positions,2_pInt)
if (constitutive_j2_tau0(i) < 0.0_pReal) & if (constitutive_j2_tau0(instance) < 0.0_pReal) &
call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')') call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')')
case ('gdot0') case ('gdot0')
constitutive_j2_gdot0(i) = IO_floatValue(line,positions,2_pInt) constitutive_j2_gdot0(instance) = IO_floatValue(line,positions,2_pInt)
if (constitutive_j2_gdot0(i) <= 0.0_pReal) & if (constitutive_j2_gdot0(instance) <= 0.0_pReal) &
call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')') call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')')
case ('n') case ('n')
constitutive_j2_n(i) = IO_floatValue(line,positions,2_pInt) constitutive_j2_n(instance) = IO_floatValue(line,positions,2_pInt)
if (constitutive_j2_n(i) <= 0.0_pReal) & if (constitutive_j2_n(instance) <= 0.0_pReal) &
call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')') call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')')
case ('h0') case ('h0')
constitutive_j2_h0(i) = IO_floatValue(line,positions,2_pInt) constitutive_j2_h0(instance) = IO_floatValue(line,positions,2_pInt)
case ('h0_slope','slopelnrate') case ('h0_slope','slopelnrate')
constitutive_j2_h0_slopeLnRate(i) = IO_floatValue(line,positions,2_pInt) constitutive_j2_h0_slopeLnRate(instance) = IO_floatValue(line,positions,2_pInt)
case ('tausat') case ('tausat')
constitutive_j2_tausat(i) = IO_floatValue(line,positions,2_pInt) constitutive_j2_tausat(instance) = IO_floatValue(line,positions,2_pInt)
if (constitutive_j2_tausat(i) <= 0.0_pReal) & if (constitutive_j2_tausat(instance) <= 0.0_pReal) &
call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')') call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')')
case ('tausat_sinhfita') case ('tausat_sinhfita')
constitutive_j2_tausat_SinhFitA(i) = IO_floatValue(line,positions,2_pInt) constitutive_j2_tausat_SinhFitA(instance) = IO_floatValue(line,positions,2_pInt)
case ('tausat_sinhfitb') case ('tausat_sinhfitb')
constitutive_j2_tausat_SinhFitB(i) = IO_floatValue(line,positions,2_pInt) constitutive_j2_tausat_SinhFitB(instance) = IO_floatValue(line,positions,2_pInt)
case ('tausat_sinhfitc') case ('tausat_sinhfitc')
constitutive_j2_tausat_SinhFitC(i) = IO_floatValue(line,positions,2_pInt) constitutive_j2_tausat_SinhFitC(instance) = IO_floatValue(line,positions,2_pInt)
case ('tausat_sinhfitd') case ('tausat_sinhfitd')
constitutive_j2_tausat_SinhFitD(i) = IO_floatValue(line,positions,2_pInt) constitutive_j2_tausat_SinhFitD(instance) = IO_floatValue(line,positions,2_pInt)
case ('a', 'w0') case ('a', 'w0')
constitutive_j2_a(i) = IO_floatValue(line,positions,2_pInt) constitutive_j2_a(instance) = IO_floatValue(line,positions,2_pInt)
if (constitutive_j2_a(i) <= 0.0_pReal) & if (constitutive_j2_a(instance) <= 0.0_pReal) &
call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')') call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')')
case ('taylorfactor') case ('taylorfactor')
constitutive_j2_fTaylor(i) = IO_floatValue(line,positions,2_pInt) constitutive_j2_fTaylor(instance) = IO_floatValue(line,positions,2_pInt)
if (constitutive_j2_fTaylor(i) <= 0.0_pReal) & if (constitutive_j2_fTaylor(instance) <= 0.0_pReal) &
call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')') call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')')
case ('atol_resistance') case ('atol_resistance')
constitutive_j2_aTolResistance(i) = IO_floatValue(line,positions,2_pInt) constitutive_j2_aTolResistance(instance) = IO_floatValue(line,positions,2_pInt)
if (constitutive_j2_aTolResistance(i) <= 0.0_pReal) & if (constitutive_j2_aTolResistance(instance) <= 0.0_pReal) &
call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')') call IO_error(211_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')')
case default case default
call IO_error(210_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')') call IO_error(210_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_J2_label//')')
@ -252,18 +252,18 @@ subroutine constitutive_j2_init(fileUnit)
endif; endif endif; endif
enddo enddo
instancesLoop: do i = 1_pInt,maxNinstance instancesLoop: do instance = 1_pInt,maxNinstance
outputsLoop: do o = 1_pInt,constitutive_j2_Noutput(i) outputsLoop: do o = 1_pInt,constitutive_j2_Noutput(instance)
select case(constitutive_j2_outputID(o,i)) select case(constitutive_j2_outputID(o,instance))
case(flowstress_ID,strainrate_ID) case(flowstress_ID,strainrate_ID)
mySize = 1_pInt mySize = 1_pInt
case default case default
end select end select
if (mySize > 0_pInt) then ! any meaningful output found if (mySize > 0_pInt) then ! any meaningful output found
constitutive_j2_sizePostResult(o,i) = mySize constitutive_j2_sizePostResult(o,instance) = mySize
constitutive_j2_sizePostResults(i) = & constitutive_j2_sizePostResults(instance) = &
constitutive_j2_sizePostResults(i) + mySize constitutive_j2_sizePostResults(instance) + mySize
endif endif
enddo outputsLoop enddo outputsLoop
enddo instancesLoop enddo instancesLoop
@ -275,13 +275,13 @@ end subroutine constitutive_j2_init
!> @brief sets the initial microstructural state for a given instance of this plasticity !> @brief sets the initial microstructural state for a given instance of this plasticity
!> @details initial microstructural state is set to the value specified by tau0 !> @details initial microstructural state is set to the value specified by tau0
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
pure function constitutive_j2_stateInit(matID) pure function constitutive_j2_stateInit(instance)
implicit none implicit none
real(pReal), dimension(1) :: constitutive_j2_stateInit real(pReal), dimension(1) :: constitutive_j2_stateInit
integer(pInt), intent(in) :: matID !< number specifying the instance of the plasticity integer(pInt), intent(in) :: instance !< number specifying the instance of the plasticity
constitutive_j2_stateInit = constitutive_j2_tau0(matID) constitutive_j2_stateInit = constitutive_j2_tau0(instance)
end function constitutive_j2_stateInit end function constitutive_j2_stateInit
@ -289,15 +289,15 @@ end function constitutive_j2_stateInit
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief sets the relevant state values for a given instance of this plasticity !> @brief sets the relevant state values for a given instance of this plasticity
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
pure function constitutive_j2_aTolState(matID) pure function constitutive_j2_aTolState(instance)
implicit none implicit none
integer(pInt), intent(in) :: matID !< number specifying the instance of the plasticity integer(pInt), intent(in) :: instance !< number specifying the instance of the plasticity
real(pReal), dimension(constitutive_j2_sizeState(matID)) :: & real(pReal), dimension(constitutive_j2_sizeState(instance)) :: &
constitutive_j2_aTolState constitutive_j2_aTolState
constitutive_j2_aTolState = constitutive_j2_aTolResistance(matID) constitutive_j2_aTolState = constitutive_j2_aTolResistance(instance)
end function constitutive_j2_aTolState end function constitutive_j2_aTolState
@ -372,10 +372,10 @@ pure subroutine constitutive_j2_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,state,ip
norm_Tstar_dev, & !< euclidean norm of Tstar_dev norm_Tstar_dev, & !< euclidean norm of Tstar_dev
squarenorm_Tstar_dev !< square of the euclidean norm of Tstar_dev squarenorm_Tstar_dev !< square of the euclidean norm of Tstar_dev
integer(pInt) :: & integer(pInt) :: &
matID, & instance, &
k, l, m, n k, l, m, n
matID = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phase(ipc,ip,el))
Tstar_dev_33 = math_deviatoric33(math_Mandel6to33(Tstar_v)) ! deviatoric part of 2nd Piola-Kirchhoff stress Tstar_dev_33 = math_deviatoric33(math_Mandel6to33(Tstar_v)) ! deviatoric part of 2nd Piola-Kirchhoff stress
squarenorm_Tstar_dev = math_mul33xx33(Tstar_dev_33,Tstar_dev_33) squarenorm_Tstar_dev = math_mul33xx33(Tstar_dev_33,Tstar_dev_33)
norm_Tstar_dev = sqrt(squarenorm_Tstar_dev) norm_Tstar_dev = sqrt(squarenorm_Tstar_dev)
@ -384,22 +384,22 @@ pure subroutine constitutive_j2_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,state,ip
Lp = 0.0_pReal Lp = 0.0_pReal
dLp_dTstar99 = 0.0_pReal dLp_dTstar99 = 0.0_pReal
else else
gamma_dot = constitutive_j2_gdot0(matID) & gamma_dot = constitutive_j2_gdot0(instance) &
* (sqrt(1.5_pReal) * norm_Tstar_dev & * (sqrt(1.5_pReal) * norm_Tstar_dev / constitutive_j2_fTaylor(instance) / state(ipc,ip,el)%p(1)) &
/ constitutive_j2_fTaylor(matID) / state(ipc,ip,el)%p(1)) **constitutive_j2_n(matID) **constitutive_j2_n(instance)
Lp = Tstar_dev_33/norm_Tstar_dev * gamma_dot/constitutive_j2_fTaylor(matID) Lp = Tstar_dev_33/norm_Tstar_dev * gamma_dot/constitutive_j2_fTaylor(instance)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! Calculation of the tangent of Lp ! Calculation of the tangent of Lp
forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) &
dLp_dTstar_3333(k,l,m,n) = (constitutive_j2_n(matID)-1.0_pReal) * & dLp_dTstar_3333(k,l,m,n) = (constitutive_j2_n(instance)-1.0_pReal) * &
Tstar_dev_33(k,l)*Tstar_dev_33(m,n) / squarenorm_Tstar_dev Tstar_dev_33(k,l)*Tstar_dev_33(m,n) / squarenorm_Tstar_dev
forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt) & forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt) &
dLp_dTstar_3333(k,l,k,l) = dLp_dTstar_3333(k,l,k,l) + 1.0_pReal dLp_dTstar_3333(k,l,k,l) = dLp_dTstar_3333(k,l,k,l) + 1.0_pReal
forall (k=1_pInt:3_pInt,m=1_pInt:3_pInt) & forall (k=1_pInt:3_pInt,m=1_pInt:3_pInt) &
dLp_dTstar_3333(k,k,m,m) = dLp_dTstar_3333(k,k,m,m) - 1.0_pReal/3.0_pReal dLp_dTstar_3333(k,k,m,m) = dLp_dTstar_3333(k,k,m,m) - 1.0_pReal/3.0_pReal
dLp_dTstar99 = math_Plain3333to99(gamma_dot / constitutive_j2_fTaylor(matID) * & dLp_dTstar99 = math_Plain3333to99(gamma_dot / constitutive_j2_fTaylor(instance) * &
dLp_dTstar_3333 / norm_Tstar_dev) dLp_dTstar_3333 / norm_Tstar_dev)
end if end if
@ -442,9 +442,9 @@ pure function constitutive_j2_dotState(Tstar_v,state,ipc,ip,el)
saturation, & !< saturation resistance saturation, & !< saturation resistance
norm_Tstar_dev !< euclidean norm of Tstar_dev norm_Tstar_dev !< euclidean norm of Tstar_dev
integer(pInt) :: & integer(pInt) :: &
matID instance
matID = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phase(ipc,ip,el))
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! norm of deviatoric part of 2nd Piola-Kirchhoff stress ! norm of deviatoric part of 2nd Piola-Kirchhoff stress
Tstar_dev_v(1:3) = Tstar_v(1:3) - sum(Tstar_v(1:3))/3.0_pReal Tstar_dev_v(1:3) = Tstar_v(1:3) - sum(Tstar_v(1:3))/3.0_pReal
@ -453,31 +453,31 @@ pure function constitutive_j2_dotState(Tstar_v,state,ipc,ip,el)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! strain rate ! strain rate
gamma_dot = constitutive_j2_gdot0(matID) * ( sqrt(1.5_pReal) * norm_Tstar_dev & gamma_dot = constitutive_j2_gdot0(instance) * ( sqrt(1.5_pReal) * norm_Tstar_dev &
/ &!----------------------------------------------------------------------------------- / &!-----------------------------------------------------------------------------------
(constitutive_j2_fTaylor(matID) * state(ipc,ip,el)%p(1)) ) ** constitutive_j2_n(matID) (constitutive_j2_fTaylor(instance) * state(ipc,ip,el)%p(1)) ) ** constitutive_j2_n(instance)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! hardening coefficient ! hardening coefficient
if (abs(gamma_dot) > 1e-12_pReal) then if (abs(gamma_dot) > 1e-12_pReal) then
if (constitutive_j2_tausat_SinhFitA(matID) == 0.0_pReal) then if (constitutive_j2_tausat_SinhFitA(instance) == 0.0_pReal) then
saturation = constitutive_j2_tausat(matID) saturation = constitutive_j2_tausat(instance)
else else
saturation = ( constitutive_j2_tausat(matID) & saturation = ( constitutive_j2_tausat(instance) &
+ ( log( ( gamma_dot / constitutive_j2_tausat_SinhFitA(matID)& + ( log( ( gamma_dot / constitutive_j2_tausat_SinhFitA(instance)&
)**(1.0_pReal / constitutive_j2_tausat_SinhFitD(matID))& )**(1.0_pReal / constitutive_j2_tausat_SinhFitD(instance))&
+ sqrt( ( gamma_dot / constitutive_j2_tausat_SinhFitA(matID) & + sqrt( ( gamma_dot / constitutive_j2_tausat_SinhFitA(instance) &
)**(2.0_pReal / constitutive_j2_tausat_SinhFitD(matID)) & )**(2.0_pReal / constitutive_j2_tausat_SinhFitD(instance)) &
+ 1.0_pReal ) & + 1.0_pReal ) &
) & ! asinh(K) = ln(K + sqrt(K^2 +1)) ) & ! asinh(K) = ln(K + sqrt(K^2 +1))
)**(1.0_pReal / constitutive_j2_tausat_SinhFitC(matID)) & )**(1.0_pReal / constitutive_j2_tausat_SinhFitC(instance)) &
/ ( constitutive_j2_tausat_SinhFitB(matID) & / ( constitutive_j2_tausat_SinhFitB(instance) &
* (gamma_dot / constitutive_j2_gdot0(matID))**(1.0_pReal / constitutive_j2_n(matID)) & * (gamma_dot / constitutive_j2_gdot0(instance))**(1.0_pReal / constitutive_j2_n(instance)) &
) & ) &
) )
endif endif
hardening = ( constitutive_j2_h0(matID) + constitutive_j2_h0_slopeLnRate(matID) * log(gamma_dot) ) & hardening = ( constitutive_j2_h0(instance) + constitutive_j2_h0_slopeLnRate(instance) * log(gamma_dot) ) &
* abs( 1.0_pReal - state(ipc,ip,el)%p(1)/saturation )**constitutive_j2_a(matID) & * abs( 1.0_pReal - state(ipc,ip,el)%p(1)/saturation )**constitutive_j2_a(instance) &
* sign(1.0_pReal, 1.0_pReal - state(ipc,ip,el)%p(1)/saturation) * sign(1.0_pReal, 1.0_pReal - state(ipc,ip,el)%p(1)/saturation)
else else
hardening = 0.0_pReal hardening = 0.0_pReal
@ -523,11 +523,11 @@ pure function constitutive_j2_postResults(Tstar_v,state,ipc,ip,el)
real(pReal) :: & real(pReal) :: &
norm_Tstar_dev ! euclidean norm of Tstar_dev norm_Tstar_dev ! euclidean norm of Tstar_dev
integer(pInt) :: & integer(pInt) :: &
matID, & instance, &
o, & o, &
c c
matID = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phase(ipc,ip,el))
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! calculate deviatoric part of 2nd Piola-Kirchhoff stress and its norm ! calculate deviatoric part of 2nd Piola-Kirchhoff stress and its norm
@ -539,15 +539,15 @@ pure function constitutive_j2_postResults(Tstar_v,state,ipc,ip,el)
constitutive_j2_postResults = 0.0_pReal constitutive_j2_postResults = 0.0_pReal
outputsLoop: do o = 1_pInt,phase_Noutput(material_phase(ipc,ip,el)) outputsLoop: do o = 1_pInt,phase_Noutput(material_phase(ipc,ip,el))
select case(constitutive_j2_outputID(o,matID)) select case(constitutive_j2_outputID(o,instance))
case (flowstress_ID) case (flowstress_ID)
constitutive_j2_postResults(c+1_pInt) = state(ipc,ip,el)%p(1) constitutive_j2_postResults(c+1_pInt) = state(ipc,ip,el)%p(1)
c = c + 1_pInt c = c + 1_pInt
case (strainrate_ID) case (strainrate_ID)
constitutive_j2_postResults(c+1_pInt) = & constitutive_j2_postResults(c+1_pInt) = &
constitutive_j2_gdot0(matID) * ( sqrt(1.5_pReal) * norm_Tstar_dev & constitutive_j2_gdot0(instance) * ( sqrt(1.5_pReal) * norm_Tstar_dev &
/ &!---------------------------------------------------------------------------------- / &!----------------------------------------------------------------------------------
(constitutive_j2_fTaylor(matID) * state(ipc,ip,el)%p(1)) ) ** constitutive_j2_n(matID) (constitutive_j2_fTaylor(instance) * state(ipc,ip,el)%p(1)) ) ** constitutive_j2_n(instance)
c = c + 1_pInt c = c + 1_pInt
end select end select
enddo outputsLoop enddo outputsLoop

View File

@ -94,7 +94,7 @@ subroutine constitutive_none_init(fileUnit)
integer(pInt), parameter :: MAXNCHUNKS = 7_pInt integer(pInt), parameter :: MAXNCHUNKS = 7_pInt
integer(pInt), dimension(1_pInt+2_pInt*MAXNCHUNKS) :: positions integer(pInt), dimension(1_pInt+2_pInt*MAXNCHUNKS) :: positions
integer(pInt) :: section = 0_pInt, maxNinstance, i integer(pInt) :: section = 0_pInt, maxNinstance, instance
character(len=32) :: & character(len=32) :: &
structure = '' structure = ''
character(len=65536) :: & character(len=65536) :: &
@ -136,7 +136,7 @@ subroutine constitutive_none_init(fileUnit)
endif endif
if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if-statement). It's not safe in Fortran if (section > 0_pInt ) then ! do not short-circuit here (.and. with next if-statement). It's not safe in Fortran
if (phase_plasticity(section) == PLASTICITY_NONE_ID) then ! one of my sections if (phase_plasticity(section) == PLASTICITY_NONE_ID) then ! one of my sections
i = phase_plasticityInstance(section) ! which instance of my plasticity is present phase instance = phase_plasticityInstance(section) ! which instance of my plasticity is present phase
positions = IO_stringPos(line,MAXNCHUNKS) positions = IO_stringPos(line,MAXNCHUNKS)
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
select case(tag) select case(tag)
@ -145,34 +145,34 @@ subroutine constitutive_none_init(fileUnit)
structure = IO_lc(IO_stringValue(line,positions,2_pInt)) structure = IO_lc(IO_stringValue(line,positions,2_pInt))
select case(structure(1:3)) select case(structure(1:3))
case(LATTICE_iso_label) case(LATTICE_iso_label)
constitutive_none_structureID(i) = LATTICE_iso_ID constitutive_none_structureID(instance) = LATTICE_iso_ID
case(LATTICE_fcc_label) case(LATTICE_fcc_label)
constitutive_none_structureID(i) = LATTICE_fcc_ID constitutive_none_structureID(instance) = LATTICE_fcc_ID
case(LATTICE_bcc_label) case(LATTICE_bcc_label)
constitutive_none_structureID(i) = LATTICE_bcc_ID constitutive_none_structureID(instance) = LATTICE_bcc_ID
case(LATTICE_hex_label) case(LATTICE_hex_label)
constitutive_none_structureID(i) = LATTICE_hex_ID constitutive_none_structureID(instance) = LATTICE_hex_ID
case(LATTICE_ort_label) case(LATTICE_ort_label)
constitutive_none_structureID(i) = LATTICE_ort_ID constitutive_none_structureID(instance) = LATTICE_ort_ID
end select end select
case ('c11') case ('c11')
constitutive_none_Cslip_66(1,1,i) = IO_floatValue(line,positions,2_pInt) constitutive_none_Cslip_66(1,1,instance) = IO_floatValue(line,positions,2_pInt)
case ('c12') case ('c12')
constitutive_none_Cslip_66(1,2,i) = IO_floatValue(line,positions,2_pInt) constitutive_none_Cslip_66(1,2,instance) = IO_floatValue(line,positions,2_pInt)
case ('c13') case ('c13')
constitutive_none_Cslip_66(1,3,i) = IO_floatValue(line,positions,2_pInt) constitutive_none_Cslip_66(1,3,instance) = IO_floatValue(line,positions,2_pInt)
case ('c22') case ('c22')
constitutive_none_Cslip_66(2,2,i) = IO_floatValue(line,positions,2_pInt) constitutive_none_Cslip_66(2,2,instance) = IO_floatValue(line,positions,2_pInt)
case ('c23') case ('c23')
constitutive_none_Cslip_66(2,3,i) = IO_floatValue(line,positions,2_pInt) constitutive_none_Cslip_66(2,3,instance) = IO_floatValue(line,positions,2_pInt)
case ('c33') case ('c33')
constitutive_none_Cslip_66(3,3,i) = IO_floatValue(line,positions,2_pInt) constitutive_none_Cslip_66(3,3,instance) = IO_floatValue(line,positions,2_pInt)
case ('c44') case ('c44')
constitutive_none_Cslip_66(4,4,i) = IO_floatValue(line,positions,2_pInt) constitutive_none_Cslip_66(4,4,instance) = IO_floatValue(line,positions,2_pInt)
case ('c55') case ('c55')
constitutive_none_Cslip_66(5,5,i) = IO_floatValue(line,positions,2_pInt) constitutive_none_Cslip_66(5,5,instance) = IO_floatValue(line,positions,2_pInt)
case ('c66') case ('c66')
constitutive_none_Cslip_66(6,6,i) = IO_floatValue(line,positions,2_pInt) constitutive_none_Cslip_66(6,6,instance) = IO_floatValue(line,positions,2_pInt)
case default case default
call IO_error(210_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_NONE_label//')') call IO_error(210_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_NONE_label//')')
end select end select
@ -180,11 +180,11 @@ subroutine constitutive_none_init(fileUnit)
endif endif
enddo enddo
instancesLoop: do i = 1_pInt,maxNinstance instancesLoop: do instance = 1_pInt,maxNinstance
constitutive_none_Cslip_66(1:6,1:6,i) = & constitutive_none_Cslip_66(1:6,1:6,instance) = &
lattice_symmetrizeC66(constitutive_none_structureID(i),constitutive_none_Cslip_66(1:6,1:6,i)) lattice_symmetrizeC66(constitutive_none_structureID(instance),constitutive_none_Cslip_66(1:6,1:6,instance))
constitutive_none_Cslip_66(1:6,1:6,i) = & ! Literature data is Voigt, DAMASK uses Mandel constitutive_none_Cslip_66(1:6,1:6,instance) = & ! Literature data is Voigt, DAMASK uses Mandel
math_Mandel3333to66(math_Voigt66to3333(constitutive_none_Cslip_66(1:6,1:6,i))) math_Mandel3333to66(math_Voigt66to3333(constitutive_none_Cslip_66(1:6,1:6,instance)))
enddo instancesLoop enddo instancesLoop
end subroutine constitutive_none_init end subroutine constitutive_none_init

View File

@ -163,7 +163,7 @@ subroutine constitutive_phenopowerlaw_init(fileUnit)
integer(pInt), dimension(7) :: configNchunks integer(pInt), dimension(7) :: configNchunks
integer(pInt) :: & integer(pInt) :: &
maxNinstance, & maxNinstance, &
i,j,k, f,o, & instance,j,k, f,o, &
Nchunks_SlipSlip, Nchunks_SlipTwin, Nchunks_TwinSlip, Nchunks_TwinTwin, & Nchunks_SlipSlip, Nchunks_SlipTwin, Nchunks_TwinSlip, Nchunks_TwinTwin, &
Nchunks_SlipFamilies, Nchunks_TwinFamilies, Nchunks_nonSchmid, & Nchunks_SlipFamilies, Nchunks_TwinFamilies, Nchunks_nonSchmid, &
structID, index_myFamily, index_otherFamily, & structID, index_myFamily, index_otherFamily, &
@ -257,9 +257,9 @@ subroutine constitutive_phenopowerlaw_init(fileUnit)
if (IO_getTag(line,'[',']') /= '') then ! next section if (IO_getTag(line,'[',']') /= '') then ! next section
section = section + 1_pInt ! advance section counter section = section + 1_pInt ! advance section counter
if (phase_plasticity(section) == PLASTICITY_PHENOPOWERLAW_ID) then if (phase_plasticity(section) == PLASTICITY_PHENOPOWERLAW_ID) then
i = phase_plasticityInstance(section) instance = phase_plasticityInstance(section)
constitutive_phenopowerlaw_Cslip_66(1:6,1:6,i) = lattice_Cslip_66(1:6,1:6,section) constitutive_phenopowerlaw_Cslip_66(1:6,1:6,instance) = lattice_Cslip_66(1:6,1:6,section)
constitutive_phenopowerlaw_structure(i) = lattice_structure(section) constitutive_phenopowerlaw_structure(instance) = lattice_structure(section)
configNchunks = lattice_configNchunks(lattice_structureID(section)) configNchunks = lattice_configNchunks(lattice_structureID(section))
Nchunks_SlipFamilies = configNchunks(1) Nchunks_SlipFamilies = configNchunks(1)
Nchunks_TwinFamilies = configNchunks(2) Nchunks_TwinFamilies = configNchunks(2)
@ -272,37 +272,37 @@ subroutine constitutive_phenopowerlaw_init(fileUnit)
cycle ! skip to next line cycle ! skip to next line
endif endif
if (section > 0_pInt ) then; if (phase_plasticity(section) == PLASTICITY_PHENOPOWERLAW_ID) then ! one of my sections. Do not short-circuit here (.and. between if-statements), it's not safe in Fortran if (section > 0_pInt ) then; if (phase_plasticity(section) == PLASTICITY_PHENOPOWERLAW_ID) then ! one of my sections. Do not short-circuit here (.and. between if-statements), it's not safe in Fortran
i = phase_plasticityInstance(section) ! which instance of my plasticity is present phase instance = phase_plasticityInstance(section) ! which instance of my plasticity is present phase
positions = IO_stringPos(line,MAXNCHUNKS) positions = IO_stringPos(line,MAXNCHUNKS)
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
select case(tag) select case(tag)
case ('plasticity','elasticity','lattice_structure','covera_ratio',& case ('plasticity','elasticity','lattice_structure','covera_ratio',&
'c11','c12','c13','c22','c23','c33','c44','c55','c66') 'c11','c12','c13','c22','c23','c33','c44','c55','c66')
case ('(output)') case ('(output)')
constitutive_phenopowerlaw_Noutput(i) = constitutive_phenopowerlaw_Noutput(i) + 1_pInt constitutive_phenopowerlaw_Noutput(instance) = constitutive_phenopowerlaw_Noutput(instance) + 1_pInt
constitutive_phenopowerlaw_output(constitutive_phenopowerlaw_Noutput(i),i) = & constitutive_phenopowerlaw_output(constitutive_phenopowerlaw_Noutput(instance),instance) = &
IO_lc(IO_stringValue(line,positions,2_pInt)) IO_lc(IO_stringValue(line,positions,2_pInt))
select case(IO_lc(IO_stringValue(line,positions,2_pInt))) select case(IO_lc(IO_stringValue(line,positions,2_pInt)))
case ('resistance_slip') case ('resistance_slip')
constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(i),i) = resistance_slip_ID constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(instance),instance) = resistance_slip_ID
case ('accumulatedshear_slip') case ('accumulatedshear_slip')
constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(i),i) = accumulatedshear_slip_ID constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(instance),instance) = accumulatedshear_slip_ID
case ('shearrate_slip') case ('shearrate_slip')
constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(i),i) = shearrate_slip_ID constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(instance),instance) = shearrate_slip_ID
case ('resolvedstress_slip') case ('resolvedstress_slip')
constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(i),i) = resolvedstress_slip_ID constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(instance),instance) = resolvedstress_slip_ID
case ('totalshear') case ('totalshear')
constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(i),i) = totalshear_ID constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(instance),instance) = totalshear_ID
case ('resistance_twin') case ('resistance_twin')
constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(i),i) = resistance_twin_ID constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(instance),instance) = resistance_twin_ID
case ('accumulatedshear_twin') case ('accumulatedshear_twin')
constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(i),i) = accumulatedshear_twin_ID constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(instance),instance) = accumulatedshear_twin_ID
case ('shearrate_twin') case ('shearrate_twin')
constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(i),i) = shearrate_twin_ID constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(instance),instance) = shearrate_twin_ID
case ('resolvedstress_twin') case ('resolvedstress_twin')
constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(i),i) = resolvedstress_twin_ID constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(instance),instance) = resolvedstress_twin_ID
case ('totalvolfrac') case ('totalvolfrac')
constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(i),i) = totalvolfrac_ID constitutive_phenopowerlaw_outputID(constitutive_phenopowerlaw_Noutput(instance),instance) = totalvolfrac_ID
case default case default
call IO_error(105_pInt,ext_msg=IO_stringValue(line,positions,2_pInt)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') call IO_error(105_pInt,ext_msg=IO_stringValue(line,positions,2_pInt)//' ('//PLASTICITY_PHENOPOWERLAW_label//')')
end select end select
@ -311,91 +311,91 @@ subroutine constitutive_phenopowerlaw_init(fileUnit)
call IO_warning(50_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') call IO_warning(50_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')')
Nchunks_SlipFamilies = positions(1) - 1_pInt Nchunks_SlipFamilies = positions(1) - 1_pInt
do j = 1_pInt, Nchunks_SlipFamilies do j = 1_pInt, Nchunks_SlipFamilies
constitutive_phenopowerlaw_Nslip(j,i) = IO_intValue(line,positions,1_pInt+j) constitutive_phenopowerlaw_Nslip(j,instance) = IO_intValue(line,positions,1_pInt+j)
enddo enddo
case ('gdot0_slip') case ('gdot0_slip')
constitutive_phenopowerlaw_gdot0_slip(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_gdot0_slip(instance) = IO_floatValue(line,positions,2_pInt)
case ('n_slip') case ('n_slip')
constitutive_phenopowerlaw_n_slip(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_n_slip(instance) = IO_floatValue(line,positions,2_pInt)
case ('tau0_slip') case ('tau0_slip')
do j = 1_pInt,Nchunks_SlipFamilies do j = 1_pInt,Nchunks_SlipFamilies
constitutive_phenopowerlaw_tau0_slip(j,i) = IO_floatValue(line,positions,1_pInt+j) constitutive_phenopowerlaw_tau0_slip(j,instance) = IO_floatValue(line,positions,1_pInt+j)
enddo enddo
case ('tausat_slip') case ('tausat_slip')
do j = 1_pInt, Nchunks_SlipFamilies do j = 1_pInt, Nchunks_SlipFamilies
constitutive_phenopowerlaw_tausat_slip(j,i) = IO_floatValue(line,positions,1_pInt+j) constitutive_phenopowerlaw_tausat_slip(j,instance) = IO_floatValue(line,positions,1_pInt+j)
enddo enddo
case ('a_slip', 'w0_slip') case ('a_slip', 'w0_slip')
constitutive_phenopowerlaw_a_slip(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_a_slip(instance) = IO_floatValue(line,positions,2_pInt)
case ('ntwin') case ('ntwin')
if (positions(1) < 1_pInt + Nchunks_TwinFamilies) & if (positions(1) < 1_pInt + Nchunks_TwinFamilies) &
call IO_warning(51_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') call IO_warning(51_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')')
Nchunks_TwinFamilies = positions(1) - 1_pInt Nchunks_TwinFamilies = positions(1) - 1_pInt
do j = 1_pInt, Nchunks_TwinFamilies do j = 1_pInt, Nchunks_TwinFamilies
constitutive_phenopowerlaw_Ntwin(j,i) = IO_intValue(line,positions,1_pInt+j) constitutive_phenopowerlaw_Ntwin(j,instance) = IO_intValue(line,positions,1_pInt+j)
enddo enddo
case ('gdot0_twin') case ('gdot0_twin')
constitutive_phenopowerlaw_gdot0_twin(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_gdot0_twin(instance) = IO_floatValue(line,positions,2_pInt)
case ('n_twin') case ('n_twin')
constitutive_phenopowerlaw_n_twin(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_n_twin(instance) = IO_floatValue(line,positions,2_pInt)
case ('tau0_twin') case ('tau0_twin')
do j = 1_pInt, Nchunks_TwinFamilies do j = 1_pInt, Nchunks_TwinFamilies
constitutive_phenopowerlaw_tau0_twin(j,i) = IO_floatValue(line,positions,1_pInt+j) constitutive_phenopowerlaw_tau0_twin(j,instance) = IO_floatValue(line,positions,1_pInt+j)
enddo enddo
case ('s_pr') case ('s_pr')
constitutive_phenopowerlaw_spr(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_spr(instance) = IO_floatValue(line,positions,2_pInt)
case ('twin_b') case ('twin_b')
constitutive_phenopowerlaw_twinB(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_twinB(instance) = IO_floatValue(line,positions,2_pInt)
case ('twin_c') case ('twin_c')
constitutive_phenopowerlaw_twinC(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_twinC(instance) = IO_floatValue(line,positions,2_pInt)
case ('twin_d') case ('twin_d')
constitutive_phenopowerlaw_twinD(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_twinD(instance) = IO_floatValue(line,positions,2_pInt)
case ('twin_e') case ('twin_e')
constitutive_phenopowerlaw_twinE(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_twinE(instance) = IO_floatValue(line,positions,2_pInt)
case ('h0_slipslip') case ('h0_slipslip')
constitutive_phenopowerlaw_h0_SlipSlip(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_h0_SlipSlip(instance) = IO_floatValue(line,positions,2_pInt)
case ('h0_sliptwin') case ('h0_sliptwin')
constitutive_phenopowerlaw_h0_SlipTwin(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_h0_SlipTwin(instance) = IO_floatValue(line,positions,2_pInt)
call IO_warning(42_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') call IO_warning(42_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')')
case ('h0_twinslip') case ('h0_twinslip')
constitutive_phenopowerlaw_h0_TwinSlip(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_h0_TwinSlip(instance) = IO_floatValue(line,positions,2_pInt)
case ('h0_twintwin') case ('h0_twintwin')
constitutive_phenopowerlaw_h0_TwinTwin(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_h0_TwinTwin(instance) = IO_floatValue(line,positions,2_pInt)
case ('atol_resistance') case ('atol_resistance')
constitutive_phenopowerlaw_aTolResistance(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_aTolResistance(instance) = IO_floatValue(line,positions,2_pInt)
case ('atol_shear') case ('atol_shear')
constitutive_phenopowerlaw_aTolShear(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_aTolShear(instance) = IO_floatValue(line,positions,2_pInt)
case ('atol_twinfrac') case ('atol_twinfrac')
constitutive_phenopowerlaw_aTolTwinfrac(i) = IO_floatValue(line,positions,2_pInt) constitutive_phenopowerlaw_aTolTwinfrac(instance) = IO_floatValue(line,positions,2_pInt)
case ('interaction_slipslip') case ('interaction_slipslip')
if (positions(1) < 1_pInt + Nchunks_SlipSlip) & if (positions(1) < 1_pInt + Nchunks_SlipSlip) &
call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')')
do j = 1_pInt, Nchunks_SlipSlip do j = 1_pInt, Nchunks_SlipSlip
constitutive_phenopowerlaw_interaction_SlipSlip(j,i) = IO_floatValue(line,positions,1_pInt+j) constitutive_phenopowerlaw_interaction_SlipSlip(j,instance) = IO_floatValue(line,positions,1_pInt+j)
enddo enddo
case ('interaction_sliptwin') case ('interaction_sliptwin')
if (positions(1) < 1_pInt + Nchunks_SlipTwin) & if (positions(1) < 1_pInt + Nchunks_SlipTwin) &
call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')')
do j = 1_pInt, Nchunks_SlipTwin do j = 1_pInt, Nchunks_SlipTwin
constitutive_phenopowerlaw_interaction_SlipTwin(j,i) = IO_floatValue(line,positions,1_pInt+j) constitutive_phenopowerlaw_interaction_SlipTwin(j,instance) = IO_floatValue(line,positions,1_pInt+j)
enddo enddo
case ('interaction_twinslip') case ('interaction_twinslip')
if (positions(1) < 1_pInt + Nchunks_TwinSlip) & if (positions(1) < 1_pInt + Nchunks_TwinSlip) &
call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')')
do j = 1_pInt, Nchunks_TwinSlip do j = 1_pInt, Nchunks_TwinSlip
constitutive_phenopowerlaw_interaction_TwinSlip(j,i) = IO_floatValue(line,positions,1_pInt+j) constitutive_phenopowerlaw_interaction_TwinSlip(j,instance) = IO_floatValue(line,positions,1_pInt+j)
enddo enddo
case ('interaction_twintwin') case ('interaction_twintwin')
if (positions(1) < 1_pInt + Nchunks_TwinTwin) & if (positions(1) < 1_pInt + Nchunks_TwinTwin) &
call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')')
do j = 1_pInt, Nchunks_TwinTwin do j = 1_pInt, Nchunks_TwinTwin
constitutive_phenopowerlaw_interaction_TwinTwin(j,i) = IO_floatValue(line,positions,1_pInt+j) constitutive_phenopowerlaw_interaction_TwinTwin(j,instance) = IO_floatValue(line,positions,1_pInt+j)
enddo enddo
case ('nonschmid_coefficients') case ('nonschmid_coefficients')
if (positions(1) < 1_pInt + Nchunks_nonSchmid) & if (positions(1) < 1_pInt + Nchunks_nonSchmid) &
call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') call IO_warning(52_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')')
do j = 1_pInt,Nchunks_nonSchmid do j = 1_pInt,Nchunks_nonSchmid
constitutive_phenopowerlaw_nonSchmidCoeff(j,i) = IO_floatValue(line,positions,1_pInt+j) constitutive_phenopowerlaw_nonSchmidCoeff(j,instance) = IO_floatValue(line,positions,1_pInt+j)
enddo enddo
case default case default
call IO_error(210_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')') call IO_error(210_pInt,ext_msg=trim(tag)//' ('//PLASTICITY_PHENOPOWERLAW_label//')')
@ -403,44 +403,44 @@ subroutine constitutive_phenopowerlaw_init(fileUnit)
endif; endif endif; endif
enddo enddo
sanityChecks: do i = 1_pInt,maxNinstance sanityChecks: do instance = 1_pInt,maxNinstance
constitutive_phenopowerlaw_Nslip(1:lattice_maxNslipFamily,i) = & constitutive_phenopowerlaw_Nslip(1:lattice_maxNslipFamily,instance) = &
min(lattice_NslipSystem(1:lattice_maxNslipFamily,constitutive_phenopowerlaw_structure(i)),& ! limit active slip systems per family to min of available and requested min(lattice_NslipSystem(1:lattice_maxNslipFamily,constitutive_phenopowerlaw_structure(instance)),& ! limit active slip systems per family to min of available and requested
constitutive_phenopowerlaw_Nslip(1:lattice_maxNslipFamily,i)) constitutive_phenopowerlaw_Nslip(1:lattice_maxNslipFamily,instance))
constitutive_phenopowerlaw_Ntwin(1:lattice_maxNtwinFamily,i) = & constitutive_phenopowerlaw_Ntwin(1:lattice_maxNtwinFamily,instance) = &
min(lattice_NtwinSystem(1:lattice_maxNtwinFamily,constitutive_phenopowerlaw_structure(i)),& ! limit active twin systems per family to min of available and requested min(lattice_NtwinSystem(1:lattice_maxNtwinFamily,constitutive_phenopowerlaw_structure(instance)),& ! limit active twin systems per family to min of available and requested
constitutive_phenopowerlaw_Ntwin(:,i)) constitutive_phenopowerlaw_Ntwin(:,instance))
constitutive_phenopowerlaw_totalNslip(i) = sum(constitutive_phenopowerlaw_Nslip(:,i)) ! how many slip systems altogether constitutive_phenopowerlaw_totalNslip(instance) = sum(constitutive_phenopowerlaw_Nslip(:,instance)) ! how many slip systems altogether
constitutive_phenopowerlaw_totalNtwin(i) = sum(constitutive_phenopowerlaw_Ntwin(:,i)) ! how many twin systems altogether constitutive_phenopowerlaw_totalNtwin(instance) = sum(constitutive_phenopowerlaw_Ntwin(:,instance)) ! how many twin systems altogether
if (any(constitutive_phenopowerlaw_tau0_slip(:,i) < 0.0_pReal .and. & if (any(constitutive_phenopowerlaw_tau0_slip(:,instance) < 0.0_pReal .and. &
constitutive_phenopowerlaw_Nslip(:,i) > 0)) call IO_error(211_pInt,el=i,ext_msg='tau0_slip (' & constitutive_phenopowerlaw_Nslip(:,instance) > 0)) call IO_error(211_pInt,el=instance,ext_msg='tau0_slip (' &
//PLASTICITY_PHENOPOWERLAW_label//')') //PLASTICITY_PHENOPOWERLAW_label//')')
if (constitutive_phenopowerlaw_gdot0_slip(i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='gdot0_slip (' & if (constitutive_phenopowerlaw_gdot0_slip(instance) <= 0.0_pReal) call IO_error(211_pInt,el=instance,ext_msg='gdot0_slip (' &
//PLASTICITY_PHENOPOWERLAW_label//')') //PLASTICITY_PHENOPOWERLAW_label//')')
if (constitutive_phenopowerlaw_n_slip(i) <= 0.0_pReal) call IO_error(211_pInt,el=i,ext_msg='n_slip (' & if (constitutive_phenopowerlaw_n_slip(instance) <= 0.0_pReal) call IO_error(211_pInt,el=instance,ext_msg='n_slip (' &
//PLASTICITY_PHENOPOWERLAW_label//')') //PLASTICITY_PHENOPOWERLAW_label//')')
if (any(constitutive_phenopowerlaw_tausat_slip(:,i) <= 0.0_pReal .and. & if (any(constitutive_phenopowerlaw_tausat_slip(:,instance) <= 0.0_pReal .and. &
constitutive_phenopowerlaw_Nslip(:,i) > 0)) call IO_error(211_pInt,el=i,ext_msg='tausat_slip (' & constitutive_phenopowerlaw_Nslip(:,instance) > 0)) call IO_error(211_pInt,el=instance,ext_msg='tausat_slip (' &
//PLASTICITY_PHENOPOWERLAW_label//')') //PLASTICITY_PHENOPOWERLAW_label//')')
if (any(constitutive_phenopowerlaw_a_slip(i) == 0.0_pReal .and. & if (any(constitutive_phenopowerlaw_a_slip(instance) == 0.0_pReal .and. &
constitutive_phenopowerlaw_Nslip(:,i) > 0)) call IO_error(211_pInt,el=i,ext_msg='a_slip (' & constitutive_phenopowerlaw_Nslip(:,instance) > 0)) call IO_error(211_pInt,el=instance,ext_msg='a_slip (' &
//PLASTICITY_PHENOPOWERLAW_label//')') //PLASTICITY_PHENOPOWERLAW_label//')')
if (any(constitutive_phenopowerlaw_tau0_twin(:,i) < 0.0_pReal .and. & if (any(constitutive_phenopowerlaw_tau0_twin(:,instance) < 0.0_pReal .and. &
constitutive_phenopowerlaw_Ntwin(:,i) > 0)) call IO_error(211_pInt,el=i,ext_msg='tau0_twin (' & constitutive_phenopowerlaw_Ntwin(:,instance) > 0)) call IO_error(211_pInt,el=instance,ext_msg='tau0_twin (' &
//PLASTICITY_PHENOPOWERLAW_label//')') //PLASTICITY_PHENOPOWERLAW_label//')')
if ( constitutive_phenopowerlaw_gdot0_twin(i) <= 0.0_pReal .and. & if ( constitutive_phenopowerlaw_gdot0_twin(instance) <= 0.0_pReal .and. &
any(constitutive_phenopowerlaw_Ntwin(:,i) > 0)) call IO_error(211_pInt,el=i,ext_msg='gdot0_twin (' & any(constitutive_phenopowerlaw_Ntwin(:,instance) > 0)) call IO_error(211_pInt,el=instance,ext_msg='gdot0_twin (' &
//PLASTICITY_PHENOPOWERLAW_label//')') //PLASTICITY_PHENOPOWERLAW_label//')')
if ( constitutive_phenopowerlaw_n_twin(i) <= 0.0_pReal .and. & if ( constitutive_phenopowerlaw_n_twin(instance) <= 0.0_pReal .and. &
any(constitutive_phenopowerlaw_Ntwin(:,i) > 0)) call IO_error(211_pInt,el=i,ext_msg='n_twin (' & any(constitutive_phenopowerlaw_Ntwin(:,instance) > 0)) call IO_error(211_pInt,el=instance,ext_msg='n_twin (' &
//PLASTICITY_PHENOPOWERLAW_label//')') //PLASTICITY_PHENOPOWERLAW_label//')')
if (constitutive_phenopowerlaw_aTolResistance(i) <= 0.0_pReal) & if (constitutive_phenopowerlaw_aTolResistance(instance) <= 0.0_pReal) &
constitutive_phenopowerlaw_aTolResistance(i) = 1.0_pReal ! default absolute tolerance 1 Pa constitutive_phenopowerlaw_aTolResistance(instance) = 1.0_pReal ! default absolute tolerance 1 Pa
if (constitutive_phenopowerlaw_aTolShear(i) <= 0.0_pReal) & if (constitutive_phenopowerlaw_aTolShear(instance) <= 0.0_pReal) &
constitutive_phenopowerlaw_aTolShear(i) = 1.0e-6_pReal ! default absolute tolerance 1e-6 constitutive_phenopowerlaw_aTolShear(instance) = 1.0e-6_pReal ! default absolute tolerance 1e-6
if (constitutive_phenopowerlaw_aTolTwinfrac(i) <= 0.0_pReal) & if (constitutive_phenopowerlaw_aTolTwinfrac(instance) <= 0.0_pReal) &
constitutive_phenopowerlaw_aTolTwinfrac(i) = 1.0e-6_pReal ! default absolute tolerance 1e-6 constitutive_phenopowerlaw_aTolTwinfrac(instance) = 1.0e-6_pReal ! default absolute tolerance 1e-6
enddo sanityChecks enddo sanityChecks
@ -459,21 +459,21 @@ subroutine constitutive_phenopowerlaw_init(fileUnit)
maxval(constitutive_phenopowerlaw_totalNtwin),& maxval(constitutive_phenopowerlaw_totalNtwin),&
maxNinstance), source=0.0_pReal) maxNinstance), source=0.0_pReal)
instancesLoop: do i = 1_pInt,maxNinstance instancesLoop: do instance = 1_pInt,maxNinstance
outputsLoop: do o = 1_pInt,constitutive_phenopowerlaw_Noutput(i) outputsLoop: do o = 1_pInt,constitutive_phenopowerlaw_Noutput(instance)
select case(constitutive_phenopowerlaw_outputID(o,i)) select case(constitutive_phenopowerlaw_outputID(o,instance))
case(resistance_slip_ID, & case(resistance_slip_ID, &
shearrate_slip_ID, & shearrate_slip_ID, &
accumulatedshear_slip_ID, & accumulatedshear_slip_ID, &
resolvedstress_slip_ID & resolvedstress_slip_ID &
) )
mySize = constitutive_phenopowerlaw_totalNslip(i) mySize = constitutive_phenopowerlaw_totalNslip(instance)
case(resistance_twin_ID, & case(resistance_twin_ID, &
shearrate_twin_ID, & shearrate_twin_ID, &
accumulatedshear_twin_ID, & accumulatedshear_twin_ID, &
resolvedstress_twin_ID & resolvedstress_twin_ID &
) )
mySize = constitutive_phenopowerlaw_totalNtwin(i) mySize = constitutive_phenopowerlaw_totalNtwin(instance)
case(totalshear_ID, & case(totalshear_ID, &
totalvolfrac_ID & totalvolfrac_ID &
) )
@ -482,67 +482,67 @@ subroutine constitutive_phenopowerlaw_init(fileUnit)
end select end select
outputFound: if (mySize > 0_pInt) then outputFound: if (mySize > 0_pInt) then
constitutive_phenopowerlaw_sizePostResult(o,i) = mySize constitutive_phenopowerlaw_sizePostResult(o,instance) = mySize
constitutive_phenopowerlaw_sizePostResults(i) = constitutive_phenopowerlaw_sizePostResults(i) + mySize constitutive_phenopowerlaw_sizePostResults(instance) = constitutive_phenopowerlaw_sizePostResults(instance) + mySize
endif outputFound endif outputFound
enddo outputsLoop enddo outputsLoop
constitutive_phenopowerlaw_sizeDotState(i) = constitutive_phenopowerlaw_totalNslip(i)+ & constitutive_phenopowerlaw_sizeDotState(instance) = constitutive_phenopowerlaw_totalNslip(instance)+ &
constitutive_phenopowerlaw_totalNtwin(i)+ & constitutive_phenopowerlaw_totalNtwin(instance)+ &
2_pInt + & 2_pInt + &
constitutive_phenopowerlaw_totalNslip(i)+ & constitutive_phenopowerlaw_totalNslip(instance)+ &
constitutive_phenopowerlaw_totalNtwin(i) ! s_slip, s_twin, sum(gamma), sum(f), accshear_slip, accshear_twin constitutive_phenopowerlaw_totalNtwin(instance) ! s_slip, s_twin, sum(gamma), sum(f), accshear_slip, accshear_twin
constitutive_phenopowerlaw_sizeState(i) = constitutive_phenopowerlaw_sizeDotState(i) constitutive_phenopowerlaw_sizeState(instance) = constitutive_phenopowerlaw_sizeDotState(instance)
structID = constitutive_phenopowerlaw_structure(i) structID = constitutive_phenopowerlaw_structure(instance)
do f = 1_pInt,lattice_maxNslipFamily ! >>> interaction slip -- X do f = 1_pInt,lattice_maxNslipFamily ! >>> interaction slip -- X
index_myFamily = sum(constitutive_phenopowerlaw_Nslip(1:f-1_pInt,i)) index_myFamily = sum(constitutive_phenopowerlaw_Nslip(1:f-1_pInt,instance))
do j = 1_pInt,constitutive_phenopowerlaw_Nslip(f,i) ! loop over (active) systems in my family (slip) do j = 1_pInt,constitutive_phenopowerlaw_Nslip(f,instance) ! loop over (active) systems in my family (slip)
do o = 1_pInt,lattice_maxNslipFamily do o = 1_pInt,lattice_maxNslipFamily
index_otherFamily = sum(constitutive_phenopowerlaw_Nslip(1:o-1_pInt,i)) index_otherFamily = sum(constitutive_phenopowerlaw_Nslip(1:o-1_pInt,instance))
do k = 1_pInt,constitutive_phenopowerlaw_Nslip(o,i) ! loop over (active) systems in other family (slip) do k = 1_pInt,constitutive_phenopowerlaw_Nslip(o,instance) ! loop over (active) systems in other family (slip)
constitutive_phenopowerlaw_hardeningMatrix_SlipSlip(index_myFamily+j,index_otherFamily+k,i) = & constitutive_phenopowerlaw_hardeningMatrix_SlipSlip(index_myFamily+j,index_otherFamily+k,instance) = &
constitutive_phenopowerlaw_interaction_SlipSlip(lattice_interactionSlipSlip( & constitutive_phenopowerlaw_interaction_SlipSlip(lattice_interactionSlipSlip( &
sum(lattice_NslipSystem(1:f-1,structID))+j, & sum(lattice_NslipSystem(1:f-1,structID))+j, &
sum(lattice_NslipSystem(1:o-1,structID))+k, & sum(lattice_NslipSystem(1:o-1,structID))+k, &
structID), i ) structID), instance )
enddo; enddo enddo; enddo
do o = 1_pInt,lattice_maxNtwinFamily do o = 1_pInt,lattice_maxNtwinFamily
index_otherFamily = sum(constitutive_phenopowerlaw_Ntwin(1:o-1_pInt,i)) index_otherFamily = sum(constitutive_phenopowerlaw_Ntwin(1:o-1_pInt,instance))
do k = 1_pInt,constitutive_phenopowerlaw_Ntwin(o,i) ! loop over (active) systems in other family (twin) do k = 1_pInt,constitutive_phenopowerlaw_Ntwin(o,instance) ! loop over (active) systems in other family (twin)
constitutive_phenopowerlaw_hardeningMatrix_SlipTwin(index_myFamily+j,index_otherFamily+k,i) = & constitutive_phenopowerlaw_hardeningMatrix_SlipTwin(index_myFamily+j,index_otherFamily+k,instance) = &
constitutive_phenopowerlaw_interaction_SlipTwin(lattice_interactionSlipTwin( & constitutive_phenopowerlaw_interaction_SlipTwin(lattice_interactionSlipTwin( &
sum(lattice_NslipSystem(1:f-1_pInt,structID))+j, & sum(lattice_NslipSystem(1:f-1_pInt,structID))+j, &
sum(lattice_NtwinSystem(1:o-1_pInt,structID))+k, & sum(lattice_NtwinSystem(1:o-1_pInt,structID))+k, &
structID), i ) structID), instance )
enddo; enddo enddo; enddo
enddo; enddo enddo; enddo
do f = 1_pInt,lattice_maxNtwinFamily ! >>> interaction twin -- X do f = 1_pInt,lattice_maxNtwinFamily ! >>> interaction twin -- X
index_myFamily = sum(constitutive_phenopowerlaw_Ntwin(1:f-1_pInt,i)) index_myFamily = sum(constitutive_phenopowerlaw_Ntwin(1:f-1_pInt,instance))
do j = 1_pInt,constitutive_phenopowerlaw_Ntwin(f,i) ! loop over (active) systems in my family (twin) do j = 1_pInt,constitutive_phenopowerlaw_Ntwin(f,instance) ! loop over (active) systems in my family (twin)
do o = 1_pInt,lattice_maxNslipFamily do o = 1_pInt,lattice_maxNslipFamily
index_otherFamily = sum(constitutive_phenopowerlaw_Nslip(1:o-1_pInt,i)) index_otherFamily = sum(constitutive_phenopowerlaw_Nslip(1:o-1_pInt,instance))
do k = 1_pInt,constitutive_phenopowerlaw_Nslip(o,i) ! loop over (active) systems in other family (slip) do k = 1_pInt,constitutive_phenopowerlaw_Nslip(o,instance) ! loop over (active) systems in other family (slip)
constitutive_phenopowerlaw_hardeningMatrix_TwinSlip(index_myFamily+j,index_otherFamily+k,i) = & constitutive_phenopowerlaw_hardeningMatrix_TwinSlip(index_myFamily+j,index_otherFamily+k,instance) = &
constitutive_phenopowerlaw_interaction_TwinSlip(lattice_interactionTwinSlip( & constitutive_phenopowerlaw_interaction_TwinSlip(lattice_interactionTwinSlip( &
sum(lattice_NtwinSystem(1:f-1_pInt,structID))+j, & sum(lattice_NtwinSystem(1:f-1_pInt,structID))+j, &
sum(lattice_NslipSystem(1:o-1_pInt,structID))+k, & sum(lattice_NslipSystem(1:o-1_pInt,structID))+k, &
structID), i ) structID), instance )
enddo; enddo enddo; enddo
do o = 1_pInt,lattice_maxNtwinFamily do o = 1_pInt,lattice_maxNtwinFamily
index_otherFamily = sum(constitutive_phenopowerlaw_Ntwin(1:o-1_pInt,i)) index_otherFamily = sum(constitutive_phenopowerlaw_Ntwin(1:o-1_pInt,instance))
do k = 1_pInt,constitutive_phenopowerlaw_Ntwin(o,i) ! loop over (active) systems in other family (twin) do k = 1_pInt,constitutive_phenopowerlaw_Ntwin(o,instance) ! loop over (active) systems in other family (twin)
constitutive_phenopowerlaw_hardeningMatrix_TwinTwin(index_myFamily+j,index_otherFamily+k,i) = & constitutive_phenopowerlaw_hardeningMatrix_TwinTwin(index_myFamily+j,index_otherFamily+k,instance) = &
constitutive_phenopowerlaw_interaction_TwinTwin(lattice_interactionTwinTwin( & constitutive_phenopowerlaw_interaction_TwinTwin(lattice_interactionTwinTwin( &
sum(lattice_NtwinSystem(1:f-1_pInt,structID))+j, & sum(lattice_NtwinSystem(1:f-1_pInt,structID))+j, &
sum(lattice_NtwinSystem(1:o-1_pInt,structID))+k, & sum(lattice_NtwinSystem(1:o-1_pInt,structID))+k, &
structID), i ) structID), instance )
enddo; enddo enddo; enddo
enddo; enddo enddo; enddo
@ -555,15 +555,15 @@ end subroutine constitutive_phenopowerlaw_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief sets the initial microstructural state for a given instance of this plasticity !> @brief sets the initial microstructural state for a given instance of this plasticity
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
pure function constitutive_phenopowerlaw_stateInit(matID) pure function constitutive_phenopowerlaw_stateInit(instance)
use lattice, only: & use lattice, only: &
lattice_maxNslipFamily, & lattice_maxNslipFamily, &
lattice_maxNtwinFamily lattice_maxNtwinFamily
implicit none implicit none
integer(pInt), intent(in) :: & integer(pInt), intent(in) :: &
matID !< number specifying the instance of the plasticity instance !< number specifying the instance of the plasticity
real(pReal), dimension(constitutive_phenopowerlaw_sizeDotState(matID)) :: & real(pReal), dimension(constitutive_phenopowerlaw_sizeDotState(instance)) :: &
constitutive_phenopowerlaw_stateInit constitutive_phenopowerlaw_stateInit
integer(pInt) :: & integer(pInt) :: &
i i
@ -572,17 +572,17 @@ pure function constitutive_phenopowerlaw_stateInit(matID)
do i = 1_pInt,lattice_maxNslipFamily do i = 1_pInt,lattice_maxNslipFamily
constitutive_phenopowerlaw_stateInit(1+& constitutive_phenopowerlaw_stateInit(1+&
sum(constitutive_phenopowerlaw_Nslip(1:i-1,matID)) : & sum(constitutive_phenopowerlaw_Nslip(1:i-1,instance)) : &
sum(constitutive_phenopowerlaw_Nslip(1:i ,matID))) = & sum(constitutive_phenopowerlaw_Nslip(1:i ,instance))) = &
constitutive_phenopowerlaw_tau0_slip(i,matID) constitutive_phenopowerlaw_tau0_slip(i,instance)
enddo enddo
do i = 1_pInt,lattice_maxNtwinFamily do i = 1_pInt,lattice_maxNtwinFamily
constitutive_phenopowerlaw_stateInit(1+sum(constitutive_phenopowerlaw_Nslip(:,matID))+& constitutive_phenopowerlaw_stateInit(1+sum(constitutive_phenopowerlaw_Nslip(:,instance))+&
sum(constitutive_phenopowerlaw_Ntwin(1:i-1,matID)) : & sum(constitutive_phenopowerlaw_Ntwin(1:i-1,instance)) : &
sum(constitutive_phenopowerlaw_Nslip(:,matID))+& sum(constitutive_phenopowerlaw_Nslip(:,instance))+&
sum(constitutive_phenopowerlaw_Ntwin(1:i ,matID))) = & sum(constitutive_phenopowerlaw_Ntwin(1:i ,instance))) = &
constitutive_phenopowerlaw_tau0_twin(i,matID) constitutive_phenopowerlaw_tau0_twin(i,instance)
enddo enddo
end function constitutive_phenopowerlaw_stateInit end function constitutive_phenopowerlaw_stateInit
@ -591,28 +591,28 @@ end function constitutive_phenopowerlaw_stateInit
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief sets the relevant state values for a given instance of this plasticity !> @brief sets the relevant state values for a given instance of this plasticity
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
pure function constitutive_phenopowerlaw_aTolState(matID) pure function constitutive_phenopowerlaw_aTolState(instance)
implicit none implicit none
integer(pInt), intent(in) :: matID !< number specifying the instance of the plasticity integer(pInt), intent(in) :: instance !< number specifying the instance of the plasticity
real(pReal), dimension(constitutive_phenopowerlaw_sizeState(matID)) :: & real(pReal), dimension(constitutive_phenopowerlaw_sizeState(instance)) :: &
constitutive_phenopowerlaw_aTolState constitutive_phenopowerlaw_aTolState
constitutive_phenopowerlaw_aTolState(1:constitutive_phenopowerlaw_totalNslip(matID)+ & constitutive_phenopowerlaw_aTolState(1:constitutive_phenopowerlaw_totalNslip(instance)+ &
constitutive_phenopowerlaw_totalNtwin(matID)) = & constitutive_phenopowerlaw_totalNtwin(instance)) = &
constitutive_phenopowerlaw_aTolResistance(matID) constitutive_phenopowerlaw_aTolResistance(instance)
constitutive_phenopowerlaw_aTolState(1+constitutive_phenopowerlaw_totalNslip(matID)+ & constitutive_phenopowerlaw_aTolState(1+constitutive_phenopowerlaw_totalNslip(instance)+ &
constitutive_phenopowerlaw_totalNtwin(matID)) = & constitutive_phenopowerlaw_totalNtwin(instance)) = &
constitutive_phenopowerlaw_aTolShear(matID) constitutive_phenopowerlaw_aTolShear(instance)
constitutive_phenopowerlaw_aTolState(2+constitutive_phenopowerlaw_totalNslip(matID)+ & constitutive_phenopowerlaw_aTolState(2+constitutive_phenopowerlaw_totalNslip(instance)+ &
constitutive_phenopowerlaw_totalNtwin(matID)) = & constitutive_phenopowerlaw_totalNtwin(instance)) = &
constitutive_phenopowerlaw_aTolTwinFrac(matID) constitutive_phenopowerlaw_aTolTwinFrac(instance)
constitutive_phenopowerlaw_aTolState(3+constitutive_phenopowerlaw_totalNslip(matID)+ & constitutive_phenopowerlaw_aTolState(3+constitutive_phenopowerlaw_totalNslip(instance)+ &
constitutive_phenopowerlaw_totalNtwin(matID): & constitutive_phenopowerlaw_totalNtwin(instance): &
2+2*(constitutive_phenopowerlaw_totalNslip(matID)+ & 2+2*(constitutive_phenopowerlaw_totalNslip(instance)+ &
constitutive_phenopowerlaw_totalNtwin(matID))) = & constitutive_phenopowerlaw_totalNtwin(instance))) = &
constitutive_phenopowerlaw_aTolShear(matID) constitutive_phenopowerlaw_aTolShear(instance)
end function constitutive_phenopowerlaw_aTolState end function constitutive_phenopowerlaw_aTolState
@ -688,7 +688,7 @@ pure subroutine constitutive_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar
state !< microstructure state state !< microstructure state
integer(pInt) :: & integer(pInt) :: &
matID, & instance, &
nSlip, & nSlip, &
nTwin,structID,index_Gamma,index_F,index_myFamily, & nTwin,structID,index_Gamma,index_F,index_myFamily, &
f,i,j,k,l,m,n f,i,j,k,l,m,n
@ -701,11 +701,11 @@ pure subroutine constitutive_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar
real(pReal), dimension(constitutive_phenopowerlaw_totalNtwin(phase_plasticityInstance(material_phase(ipc,ip,el)))) :: & real(pReal), dimension(constitutive_phenopowerlaw_totalNtwin(phase_plasticityInstance(material_phase(ipc,ip,el)))) :: &
gdot_twin,dgdot_dtautwin,tau_twin gdot_twin,dgdot_dtautwin,tau_twin
matID = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phase(ipc,ip,el))
structID = constitutive_phenopowerlaw_structure(matID) structID = constitutive_phenopowerlaw_structure(instance)
nSlip = constitutive_phenopowerlaw_totalNslip(matID) nSlip = constitutive_phenopowerlaw_totalNslip(instance)
nTwin = constitutive_phenopowerlaw_totalNtwin(matID) nTwin = constitutive_phenopowerlaw_totalNtwin(instance)
index_Gamma = nSlip + nTwin + 1_pInt index_Gamma = nSlip + nTwin + 1_pInt
index_F = nSlip + nTwin + 2_pInt index_F = nSlip + nTwin + 2_pInt
@ -717,7 +717,7 @@ pure subroutine constitutive_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar
j = 0_pInt j = 0_pInt
slipFamiliesLoop: do f = 1_pInt,lattice_maxNslipFamily slipFamiliesLoop: do f = 1_pInt,lattice_maxNslipFamily
index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,structID)) ! at which index starts my family index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,structID)) ! at which index starts my family
do i = 1_pInt,constitutive_phenopowerlaw_Nslip(f,matID) ! process each (active) slip system in family do i = 1_pInt,constitutive_phenopowerlaw_Nslip(f,instance) ! process each (active) slip system in family
j = j+1_pInt j = j+1_pInt
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -727,20 +727,20 @@ pure subroutine constitutive_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar
nonSchmid_tensor(1:3,1:3,1) = lattice_Sslip(1:3,1:3,1,index_myFamily+i,structID) nonSchmid_tensor(1:3,1:3,1) = lattice_Sslip(1:3,1:3,1,index_myFamily+i,structID)
nonSchmid_tensor(1:3,1:3,2) = nonSchmid_tensor(1:3,1:3,1) nonSchmid_tensor(1:3,1:3,2) = nonSchmid_tensor(1:3,1:3,1)
do k = 1,lattice_NnonSchmid(structID) do k = 1,lattice_NnonSchmid(structID)
tau_slip_pos(j) = tau_slip_pos(j) + constitutive_phenopowerlaw_nonSchmidCoeff(k,matID)* & tau_slip_pos(j) = tau_slip_pos(j) + constitutive_phenopowerlaw_nonSchmidCoeff(k,instance)* &
dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k,index_myFamily+i,structID)) dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k,index_myFamily+i,structID))
tau_slip_neg(j) = tau_slip_neg(j) + constitutive_phenopowerlaw_nonSchmidCoeff(k,matID)* & tau_slip_neg(j) = tau_slip_neg(j) + constitutive_phenopowerlaw_nonSchmidCoeff(k,instance)* &
dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,structID)) dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,structID))
nonSchmid_tensor(1:3,1:3,1) = nonSchmid_tensor(1:3,1:3,1) + constitutive_phenopowerlaw_nonSchmidCoeff(k,matID)*& nonSchmid_tensor(1:3,1:3,1) = nonSchmid_tensor(1:3,1:3,1) + constitutive_phenopowerlaw_nonSchmidCoeff(k,instance)*&
lattice_Sslip(1:3,1:3,2*k,index_myFamily+i,structID) lattice_Sslip(1:3,1:3,2*k,index_myFamily+i,structID)
nonSchmid_tensor(1:3,1:3,2) = nonSchmid_tensor(1:3,1:3,2) + constitutive_phenopowerlaw_nonSchmidCoeff(k,matID)*& nonSchmid_tensor(1:3,1:3,2) = nonSchmid_tensor(1:3,1:3,2) + constitutive_phenopowerlaw_nonSchmidCoeff(k,instance)*&
lattice_Sslip(1:3,1:3,2*k+1,index_myFamily+i,structID) lattice_Sslip(1:3,1:3,2*k+1,index_myFamily+i,structID)
enddo enddo
gdot_slip_pos(j) = 0.5_pReal*constitutive_phenopowerlaw_gdot0_slip(matID)* & gdot_slip_pos(j) = 0.5_pReal*constitutive_phenopowerlaw_gdot0_slip(instance)* &
((abs(tau_slip_pos(j))/state(ipc,ip,el)%p(j))**constitutive_phenopowerlaw_n_slip(matID))*& ((abs(tau_slip_pos(j))/state(ipc,ip,el)%p(j))**constitutive_phenopowerlaw_n_slip(instance))*&
sign(1.0_pReal,tau_slip_pos(j)) sign(1.0_pReal,tau_slip_pos(j))
gdot_slip_neg(j) = 0.5_pReal*constitutive_phenopowerlaw_gdot0_slip(matID)* & gdot_slip_neg(j) = 0.5_pReal*constitutive_phenopowerlaw_gdot0_slip(instance)* &
((abs(tau_slip_neg(j))/state(ipc,ip,el)%p(j))**constitutive_phenopowerlaw_n_slip(matID))*& ((abs(tau_slip_neg(j))/state(ipc,ip,el)%p(j))**constitutive_phenopowerlaw_n_slip(instance))*&
sign(1.0_pReal,tau_slip_neg(j)) sign(1.0_pReal,tau_slip_neg(j))
Lp = Lp + (1.0_pReal-state(ipc,ip,el)%p(index_F))*& ! 1-F Lp = Lp + (1.0_pReal-state(ipc,ip,el)%p(index_F))*& ! 1-F
(gdot_slip_pos(j)+gdot_slip_neg(j))*lattice_Sslip(1:3,1:3,1,index_myFamily+i,structID) (gdot_slip_pos(j)+gdot_slip_neg(j))*lattice_Sslip(1:3,1:3,1,index_myFamily+i,structID)
@ -748,7 +748,7 @@ pure subroutine constitutive_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! Calculation of the tangent of Lp ! Calculation of the tangent of Lp
if (gdot_slip_pos(j) /= 0.0_pReal) then if (gdot_slip_pos(j) /= 0.0_pReal) then
dgdot_dtauslip_pos(j) = gdot_slip_pos(j)*constitutive_phenopowerlaw_n_slip(matID)/tau_slip_pos(j) dgdot_dtauslip_pos(j) = gdot_slip_pos(j)*constitutive_phenopowerlaw_n_slip(instance)/tau_slip_pos(j)
forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) &
dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + &
dgdot_dtauslip_pos(j)*lattice_Sslip(k,l,1,index_myFamily+i,structID)* & dgdot_dtauslip_pos(j)*lattice_Sslip(k,l,1,index_myFamily+i,structID)* &
@ -756,7 +756,7 @@ pure subroutine constitutive_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar
endif endif
if (gdot_slip_neg(j) /= 0.0_pReal) then if (gdot_slip_neg(j) /= 0.0_pReal) then
dgdot_dtauslip_neg(j) = gdot_slip_neg(j)*constitutive_phenopowerlaw_n_slip(matID)/tau_slip_neg(j) dgdot_dtauslip_neg(j) = gdot_slip_neg(j)*constitutive_phenopowerlaw_n_slip(instance)/tau_slip_neg(j)
forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) &
dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + &
dgdot_dtauslip_neg(j)*lattice_Sslip(k,l,1,index_myFamily+i,structID)* & dgdot_dtauslip_neg(j)*lattice_Sslip(k,l,1,index_myFamily+i,structID)* &
@ -768,22 +768,22 @@ pure subroutine constitutive_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar
j = 0_pInt j = 0_pInt
twinFamiliesLoop: do f = 1_pInt,lattice_maxNtwinFamily twinFamiliesLoop: do f = 1_pInt,lattice_maxNtwinFamily
index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,structID)) ! at which index starts my family index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,structID)) ! at which index starts my family
do i = 1_pInt,constitutive_phenopowerlaw_Ntwin(f,matID) ! process each (active) twin system in family do i = 1_pInt,constitutive_phenopowerlaw_Ntwin(f,instance) ! process each (active) twin system in family
j = j+1_pInt j = j+1_pInt
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! Calculation of Lp ! Calculation of Lp
tau_twin(j) = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,structID)) tau_twin(j) = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,structID))
gdot_twin(j) = (1.0_pReal-state(ipc,ip,el)%p(index_F))*& ! 1-F gdot_twin(j) = (1.0_pReal-state(ipc,ip,el)%p(index_F))*& ! 1-F
constitutive_phenopowerlaw_gdot0_twin(matID)*& constitutive_phenopowerlaw_gdot0_twin(instance)*&
(abs(tau_twin(j))/state(ipc,ip,el)%p(nSlip+j))**& (abs(tau_twin(j))/state(ipc,ip,el)%p(nSlip+j))**&
constitutive_phenopowerlaw_n_twin(matID)*max(0.0_pReal,sign(1.0_pReal,tau_twin(j))) constitutive_phenopowerlaw_n_twin(instance)*max(0.0_pReal,sign(1.0_pReal,tau_twin(j)))
Lp = Lp + gdot_twin(j)*lattice_Stwin(1:3,1:3,index_myFamily+i,structID) Lp = Lp + gdot_twin(j)*lattice_Stwin(1:3,1:3,index_myFamily+i,structID)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! Calculation of the tangent of Lp ! Calculation of the tangent of Lp
if (gdot_twin(j) /= 0.0_pReal) then if (gdot_twin(j) /= 0.0_pReal) then
dgdot_dtautwin(j) = gdot_twin(j)*constitutive_phenopowerlaw_n_twin(matID)/tau_twin(j) dgdot_dtautwin(j) = gdot_twin(j)*constitutive_phenopowerlaw_n_twin(instance)/tau_twin(j)
forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) &
dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + &
dgdot_dtautwin(j)*lattice_Stwin(k,l,index_myFamily+i,structID)* & dgdot_dtautwin(j)*lattice_Stwin(k,l,index_myFamily+i,structID)* &
@ -834,7 +834,7 @@ function constitutive_phenopowerlaw_dotState(Tstar_v,state,ipc,ip,el)
constitutive_phenopowerlaw_dotState constitutive_phenopowerlaw_dotState
integer(pInt) :: & integer(pInt) :: &
matID,structID, & instance,structID, &
nSlip,nTwin, & nSlip,nTwin, &
f,i,j,k, & f,i,j,k, &
index_Gamma,index_F,index_myFamily, & index_Gamma,index_F,index_myFamily, &
@ -849,11 +849,11 @@ function constitutive_phenopowerlaw_dotState(Tstar_v,state,ipc,ip,el)
gdot_twin,tau_twin,left_TwinSlip,left_TwinTwin,right_SlipTwin,right_TwinTwin gdot_twin,tau_twin,left_TwinSlip,left_TwinTwin,right_SlipTwin,right_TwinTwin
matID = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phase(ipc,ip,el))
structID = constitutive_phenopowerlaw_structure(matID) structID = constitutive_phenopowerlaw_structure(instance)
nSlip = constitutive_phenopowerlaw_totalNslip(matID) nSlip = constitutive_phenopowerlaw_totalNslip(instance)
nTwin = constitutive_phenopowerlaw_totalNtwin(matID) nTwin = constitutive_phenopowerlaw_totalNtwin(instance)
index_Gamma = nSlip + nTwin + 1_pInt index_Gamma = nSlip + nTwin + 1_pInt
index_F = nSlip + nTwin + 2_pInt index_F = nSlip + nTwin + 2_pInt
@ -864,30 +864,30 @@ function constitutive_phenopowerlaw_dotState(Tstar_v,state,ipc,ip,el)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! system-independent (nonlinear) prefactors to M_Xx (X influenced by x) matrices ! system-independent (nonlinear) prefactors to M_Xx (X influenced by x) matrices
c_SlipSlip = constitutive_phenopowerlaw_h0_SlipSlip(matID)*& c_SlipSlip = constitutive_phenopowerlaw_h0_SlipSlip(instance)*&
(1.0_pReal + constitutive_phenopowerlaw_twinC(matID)*state(ipc,ip,el)%p(index_F)**& (1.0_pReal + constitutive_phenopowerlaw_twinC(instance)*state(ipc,ip,el)%p(index_F)**&
constitutive_phenopowerlaw_twinB(matID)) constitutive_phenopowerlaw_twinB(instance))
c_SlipTwin = 0.0_pReal c_SlipTwin = 0.0_pReal
c_TwinSlip = constitutive_phenopowerlaw_h0_TwinSlip(matID)*& c_TwinSlip = constitutive_phenopowerlaw_h0_TwinSlip(instance)*&
state(ipc,ip,el)%p(index_Gamma)**constitutive_phenopowerlaw_twinE(matID) state(ipc,ip,el)%p(index_Gamma)**constitutive_phenopowerlaw_twinE(instance)
c_TwinTwin = constitutive_phenopowerlaw_h0_TwinTwin(matID)*& c_TwinTwin = constitutive_phenopowerlaw_h0_TwinTwin(instance)*&
state(ipc,ip,el)%p(index_F)**constitutive_phenopowerlaw_twinD(matID) state(ipc,ip,el)%p(index_F)**constitutive_phenopowerlaw_twinD(instance)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! calculate left and right vectors and calculate dot gammas ! calculate left and right vectors and calculate dot gammas
ssat_offset = constitutive_phenopowerlaw_spr(matID)*sqrt(state(ipc,ip,el)%p(index_F)) ssat_offset = constitutive_phenopowerlaw_spr(instance)*sqrt(state(ipc,ip,el)%p(index_F))
j = 0_pInt j = 0_pInt
slipFamiliesLoop1: do f = 1_pInt,lattice_maxNslipFamily slipFamiliesLoop1: do f = 1_pInt,lattice_maxNslipFamily
index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,structID)) ! at which index starts my family index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,structID)) ! at which index starts my family
do i = 1_pInt,constitutive_phenopowerlaw_Nslip(f,matID) ! process each (active) slip system in family do i = 1_pInt,constitutive_phenopowerlaw_Nslip(f,instance) ! process each (active) slip system in family
j = j+1_pInt j = j+1_pInt
left_SlipSlip(j) = 1.0_pReal ! no system-dependent left part left_SlipSlip(j) = 1.0_pReal ! no system-dependent left part
left_SlipTwin(j) = 1.0_pReal ! no system-dependent left part left_SlipTwin(j) = 1.0_pReal ! no system-dependent left part
right_SlipSlip(j) = abs(1.0_pReal-state(ipc,ip,el)%p(j) / & right_SlipSlip(j) = abs(1.0_pReal-state(ipc,ip,el)%p(j) / &
(constitutive_phenopowerlaw_tausat_slip(f,matID)+ssat_offset)) & (constitutive_phenopowerlaw_tausat_slip(f,instance)+ssat_offset)) &
**constitutive_phenopowerlaw_a_slip(matID)& **constitutive_phenopowerlaw_a_slip(instance)&
*sign(1.0_pReal,1.0_pReal-state(ipc,ip,el)%p(j) / & *sign(1.0_pReal,1.0_pReal-state(ipc,ip,el)%p(j) / &
(constitutive_phenopowerlaw_tausat_slip(f,matID)+ssat_offset)) (constitutive_phenopowerlaw_tausat_slip(f,instance)+ssat_offset))
right_TwinSlip(j) = 1.0_pReal ! no system-dependent part right_TwinSlip(j) = 1.0_pReal ! no system-dependent part
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -895,14 +895,14 @@ function constitutive_phenopowerlaw_dotState(Tstar_v,state,ipc,ip,el)
tau_slip_pos(j) = dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,structID)) tau_slip_pos(j) = dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,structID))
tau_slip_neg(j) = tau_slip_pos(j) tau_slip_neg(j) = tau_slip_pos(j)
do k = 1,lattice_NnonSchmid(structID) do k = 1,lattice_NnonSchmid(structID)
tau_slip_pos(j) = tau_slip_pos(j) + constitutive_phenopowerlaw_nonSchmidCoeff(k,matID)* & tau_slip_pos(j) = tau_slip_pos(j) + constitutive_phenopowerlaw_nonSchmidCoeff(k,instance)* &
dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k,index_myFamily+i,structID)) dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k,index_myFamily+i,structID))
tau_slip_neg(j) = tau_slip_neg(j) + constitutive_phenopowerlaw_nonSchmidCoeff(k,matID)* & tau_slip_neg(j) = tau_slip_neg(j) + constitutive_phenopowerlaw_nonSchmidCoeff(k,instance)* &
dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,structID)) dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,structID))
enddo enddo
gdot_slip(j) = constitutive_phenopowerlaw_gdot0_slip(matID)*0.5_pReal* & gdot_slip(j) = constitutive_phenopowerlaw_gdot0_slip(instance)*0.5_pReal* &
((abs(tau_slip_pos(j))/state(ipc,ip,el)%p(j))**constitutive_phenopowerlaw_n_slip(matID) & ((abs(tau_slip_pos(j))/state(ipc,ip,el)%p(j))**constitutive_phenopowerlaw_n_slip(instance) &
+(abs(tau_slip_neg(j))/state(ipc,ip,el)%p(j))**constitutive_phenopowerlaw_n_slip(matID))& +(abs(tau_slip_neg(j))/state(ipc,ip,el)%p(j))**constitutive_phenopowerlaw_n_slip(instance))&
*sign(1.0_pReal,tau_slip_pos(j)) *sign(1.0_pReal,tau_slip_pos(j))
enddo enddo
enddo slipFamiliesLoop1 enddo slipFamiliesLoop1
@ -910,7 +910,7 @@ function constitutive_phenopowerlaw_dotState(Tstar_v,state,ipc,ip,el)
j = 0_pInt j = 0_pInt
twinFamiliesLoop1: do f = 1_pInt,lattice_maxNtwinFamily twinFamiliesLoop1: do f = 1_pInt,lattice_maxNtwinFamily
index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,structID)) ! at which index starts my family index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,structID)) ! at which index starts my family
do i = 1_pInt,constitutive_phenopowerlaw_Ntwin(f,matID) ! process each (active) twin system in family do i = 1_pInt,constitutive_phenopowerlaw_Ntwin(f,instance) ! process each (active) twin system in family
j = j+1_pInt j = j+1_pInt
left_TwinSlip(j) = 1.0_pReal ! no system-dependent right part left_TwinSlip(j) = 1.0_pReal ! no system-dependent right part
left_TwinTwin(j) = 1.0_pReal ! no system-dependent right part left_TwinTwin(j) = 1.0_pReal ! no system-dependent right part
@ -921,9 +921,9 @@ function constitutive_phenopowerlaw_dotState(Tstar_v,state,ipc,ip,el)
! Calculation of dot vol frac ! Calculation of dot vol frac
tau_twin(j) = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,structID)) tau_twin(j) = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,structID))
gdot_twin(j) = (1.0_pReal-state(ipc,ip,el)%p(index_F))*& ! 1-F gdot_twin(j) = (1.0_pReal-state(ipc,ip,el)%p(index_F))*& ! 1-F
constitutive_phenopowerlaw_gdot0_twin(matID)*& constitutive_phenopowerlaw_gdot0_twin(instance)*&
(abs(tau_twin(j))/state(ipc,ip,el)%p(nSlip+j))**& (abs(tau_twin(j))/state(ipc,ip,el)%p(nSlip+j))**&
constitutive_phenopowerlaw_n_twin(matID)*max(0.0_pReal,sign(1.0_pReal,tau_twin(j))) constitutive_phenopowerlaw_n_twin(instance)*max(0.0_pReal,sign(1.0_pReal,tau_twin(j)))
enddo enddo
enddo twinFamiliesLoop1 enddo twinFamiliesLoop1
@ -931,14 +931,14 @@ function constitutive_phenopowerlaw_dotState(Tstar_v,state,ipc,ip,el)
! calculate the overall hardening based on above ! calculate the overall hardening based on above
j = 0_pInt j = 0_pInt
slipFamiliesLoop2: do f = 1_pInt,lattice_maxNslipFamily slipFamiliesLoop2: do f = 1_pInt,lattice_maxNslipFamily
do i = 1_pInt,constitutive_phenopowerlaw_Nslip(f,matID) ! process each (active) slip system in family do i = 1_pInt,constitutive_phenopowerlaw_Nslip(f,instance) ! process each (active) slip system in family
j = j+1_pInt j = j+1_pInt
constitutive_phenopowerlaw_dotState(j) = & ! evolution of slip resistance j constitutive_phenopowerlaw_dotState(j) = & ! evolution of slip resistance j
c_SlipSlip * left_SlipSlip(j) * & c_SlipSlip * left_SlipSlip(j) * &
dot_product(constitutive_phenopowerlaw_hardeningMatrix_SlipSlip(j,1:nSlip,matID), & dot_product(constitutive_phenopowerlaw_hardeningMatrix_SlipSlip(j,1:nSlip,instance), &
right_SlipSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor right_SlipSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor
c_SlipTwin * left_SlipTwin(j) * & c_SlipTwin * left_SlipTwin(j) * &
dot_product(constitutive_phenopowerlaw_hardeningMatrix_SlipTwin(j,1:nTwin,matID), & dot_product(constitutive_phenopowerlaw_hardeningMatrix_SlipTwin(j,1:nTwin,instance), &
right_SlipTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor right_SlipTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor
constitutive_phenopowerlaw_dotState(index_Gamma) = constitutive_phenopowerlaw_dotState(index_Gamma) + & constitutive_phenopowerlaw_dotState(index_Gamma) = constitutive_phenopowerlaw_dotState(index_Gamma) + &
abs(gdot_slip(j)) abs(gdot_slip(j))
@ -949,14 +949,14 @@ function constitutive_phenopowerlaw_dotState(Tstar_v,state,ipc,ip,el)
j = 0_pInt j = 0_pInt
twinFamiliesLoop2: do f = 1_pInt,lattice_maxNtwinFamily twinFamiliesLoop2: do f = 1_pInt,lattice_maxNtwinFamily
index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,structID)) ! at which index starts my family index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,structID)) ! at which index starts my family
do i = 1_pInt,constitutive_phenopowerlaw_Ntwin(f,matID) ! process each (active) twin system in family do i = 1_pInt,constitutive_phenopowerlaw_Ntwin(f,instance) ! process each (active) twin system in family
j = j+1_pInt j = j+1_pInt
constitutive_phenopowerlaw_dotState(j+nSlip) = & ! evolution of twin resistance j constitutive_phenopowerlaw_dotState(j+nSlip) = & ! evolution of twin resistance j
c_TwinSlip * left_TwinSlip(j) * & c_TwinSlip * left_TwinSlip(j) * &
dot_product(constitutive_phenopowerlaw_hardeningMatrix_TwinSlip(j,1:nSlip,matID), & dot_product(constitutive_phenopowerlaw_hardeningMatrix_TwinSlip(j,1:nSlip,instance), &
right_TwinSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor right_TwinSlip*abs(gdot_slip)) + & ! dot gamma_slip modulated by right-side slip factor
c_TwinTwin * left_TwinTwin(j) * & c_TwinTwin * left_TwinTwin(j) * &
dot_product(constitutive_phenopowerlaw_hardeningMatrix_TwinTwin(j,1:nTwin,matID), & dot_product(constitutive_phenopowerlaw_hardeningMatrix_TwinTwin(j,1:nTwin,instance), &
right_TwinTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor right_TwinTwin*gdot_twin) ! dot gamma_twin modulated by right-side twin factor
if (state(ipc,ip,el)%p(index_F) < 0.98_pReal) & ! ensure twin volume fractions stays below 1.0 if (state(ipc,ip,el)%p(index_F) < 0.98_pReal) & ! ensure twin volume fractions stays below 1.0
constitutive_phenopowerlaw_dotState(index_F) = constitutive_phenopowerlaw_dotState(index_F) + & constitutive_phenopowerlaw_dotState(index_F) = constitutive_phenopowerlaw_dotState(index_F) + &
@ -1008,7 +1008,7 @@ pure function constitutive_phenopowerlaw_postResults(Tstar_v,state,ipc,ip,el)
constitutive_phenopowerlaw_postResults constitutive_phenopowerlaw_postResults
integer(pInt) :: & integer(pInt) :: &
matID,structID, & instance,structID, &
nSlip,nTwin, & nSlip,nTwin, &
o,f,i,c,j,k, & o,f,i,c,j,k, &
index_Gamma,index_F,index_accshear_slip,index_accshear_twin,index_myFamily index_Gamma,index_F,index_accshear_slip,index_accshear_twin,index_myFamily
@ -1016,11 +1016,11 @@ pure function constitutive_phenopowerlaw_postResults(Tstar_v,state,ipc,ip,el)
tau_slip_pos,tau_slip_neg,tau tau_slip_pos,tau_slip_neg,tau
matID = phase_plasticityInstance(material_phase(ipc,ip,el)) instance = phase_plasticityInstance(material_phase(ipc,ip,el))
structID = constitutive_phenopowerlaw_structure(matID) structID = constitutive_phenopowerlaw_structure(instance)
nSlip = constitutive_phenopowerlaw_totalNslip(matID) nSlip = constitutive_phenopowerlaw_totalNslip(instance)
nTwin = constitutive_phenopowerlaw_totalNtwin(matID) nTwin = constitutive_phenopowerlaw_totalNtwin(instance)
index_Gamma = nSlip + nTwin + 1_pInt index_Gamma = nSlip + nTwin + 1_pInt
index_F = nSlip + nTwin + 2_pInt index_F = nSlip + nTwin + 2_pInt
@ -1031,7 +1031,7 @@ pure function constitutive_phenopowerlaw_postResults(Tstar_v,state,ipc,ip,el)
c = 0_pInt c = 0_pInt
outputsLoop: do o = 1_pInt,phase_Noutput(material_phase(ipc,ip,el)) outputsLoop: do o = 1_pInt,phase_Noutput(material_phase(ipc,ip,el))
select case(constitutive_phenopowerlaw_outputID(o,matID)) select case(constitutive_phenopowerlaw_outputID(o,instance))
case (resistance_slip_ID) case (resistance_slip_ID)
constitutive_phenopowerlaw_postResults(c+1_pInt:c+nSlip) = state(ipc,ip,el)%p(1:nSlip) constitutive_phenopowerlaw_postResults(c+1_pInt:c+nSlip) = state(ipc,ip,el)%p(1:nSlip)
c = c + nSlip c = c + nSlip
@ -1045,19 +1045,19 @@ pure function constitutive_phenopowerlaw_postResults(Tstar_v,state,ipc,ip,el)
j = 0_pInt j = 0_pInt
slipFamiliesLoop1: do f = 1_pInt,lattice_maxNslipFamily slipFamiliesLoop1: do f = 1_pInt,lattice_maxNslipFamily
index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,structID)) ! at which index starts my family index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,structID)) ! at which index starts my family
do i = 1_pInt,constitutive_phenopowerlaw_Nslip(f,matID) ! process each (active) slip system in family do i = 1_pInt,constitutive_phenopowerlaw_Nslip(f,instance) ! process each (active) slip system in family
j = j + 1_pInt j = j + 1_pInt
tau_slip_pos = dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,structID)) tau_slip_pos = dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,structID))
tau_slip_neg = tau_slip_pos tau_slip_neg = tau_slip_pos
do k = 1,lattice_NnonSchmid(structID) do k = 1,lattice_NnonSchmid(structID)
tau_slip_pos = tau_slip_pos + constitutive_phenopowerlaw_nonSchmidCoeff(k,matID)* & tau_slip_pos = tau_slip_pos + constitutive_phenopowerlaw_nonSchmidCoeff(k,instance)* &
dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k,index_myFamily+i,structID)) dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k,index_myFamily+i,structID))
tau_slip_neg = tau_slip_neg + constitutive_phenopowerlaw_nonSchmidCoeff(k,matID)* & tau_slip_neg = tau_slip_neg + constitutive_phenopowerlaw_nonSchmidCoeff(k,instance)* &
dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,structID)) dot_product(Tstar_v,lattice_Sslip_v(1:6,2*k+1,index_myFamily+i,structID))
enddo enddo
constitutive_phenopowerlaw_postResults(c+j) = constitutive_phenopowerlaw_gdot0_slip(matID)*0.5_pReal* & constitutive_phenopowerlaw_postResults(c+j) = constitutive_phenopowerlaw_gdot0_slip(instance)*0.5_pReal* &
((abs(tau_slip_pos)/state(ipc,ip,el)%p(j))**constitutive_phenopowerlaw_n_slip(matID) & ((abs(tau_slip_pos)/state(ipc,ip,el)%p(j))**constitutive_phenopowerlaw_n_slip(instance) &
+(abs(tau_slip_neg)/state(ipc,ip,el)%p(j))**constitutive_phenopowerlaw_n_slip(matID))& +(abs(tau_slip_neg)/state(ipc,ip,el)%p(j))**constitutive_phenopowerlaw_n_slip(instance))&
*sign(1.0_pReal,tau_slip_pos) *sign(1.0_pReal,tau_slip_pos)
enddo enddo
enddo slipFamiliesLoop1 enddo slipFamiliesLoop1
@ -1067,7 +1067,7 @@ pure function constitutive_phenopowerlaw_postResults(Tstar_v,state,ipc,ip,el)
j = 0_pInt j = 0_pInt
slipFamiliesLoop2: do f = 1_pInt,lattice_maxNslipFamily slipFamiliesLoop2: do f = 1_pInt,lattice_maxNslipFamily
index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,structID)) ! at which index starts my family index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,structID)) ! at which index starts my family
do i = 1_pInt,constitutive_phenopowerlaw_Nslip(f,matID) ! process each (active) slip system in family do i = 1_pInt,constitutive_phenopowerlaw_Nslip(f,instance) ! process each (active) slip system in family
j = j + 1_pInt j = j + 1_pInt
constitutive_phenopowerlaw_postResults(c+j) = & constitutive_phenopowerlaw_postResults(c+j) = &
dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,structID)) dot_product(Tstar_v,lattice_Sslip_v(1:6,1,index_myFamily+i,structID))
@ -1094,13 +1094,13 @@ pure function constitutive_phenopowerlaw_postResults(Tstar_v,state,ipc,ip,el)
j = 0_pInt j = 0_pInt
twinFamiliesLoop1: do f = 1_pInt,lattice_maxNtwinFamily twinFamiliesLoop1: do f = 1_pInt,lattice_maxNtwinFamily
index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,structID)) ! at which index starts my family index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,structID)) ! at which index starts my family
do i = 1_pInt,constitutive_phenopowerlaw_Ntwin(f,matID) ! process each (active) twin system in family do i = 1_pInt,constitutive_phenopowerlaw_Ntwin(f,instance) ! process each (active) twin system in family
j = j + 1_pInt j = j + 1_pInt
tau = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,structID)) tau = dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,structID))
constitutive_phenopowerlaw_postResults(c+j) = (1.0_pReal-state(ipc,ip,el)%p(index_F))*& ! 1-F constitutive_phenopowerlaw_postResults(c+j) = (1.0_pReal-state(ipc,ip,el)%p(index_F))*& ! 1-F
constitutive_phenopowerlaw_gdot0_twin(matID)*& constitutive_phenopowerlaw_gdot0_twin(instance)*&
(abs(tau)/state(ipc,ip,el)%p(j+nSlip))**& (abs(tau)/state(ipc,ip,el)%p(j+nSlip))**&
constitutive_phenopowerlaw_n_twin(matID)*max(0.0_pReal,sign(1.0_pReal,tau)) constitutive_phenopowerlaw_n_twin(instance)*max(0.0_pReal,sign(1.0_pReal,tau))
enddo enddo
enddo twinFamiliesLoop1 enddo twinFamiliesLoop1
c = c + nTwin c = c + nTwin
@ -1109,7 +1109,7 @@ pure function constitutive_phenopowerlaw_postResults(Tstar_v,state,ipc,ip,el)
j = 0_pInt j = 0_pInt
twinFamiliesLoop2: do f = 1_pInt,lattice_maxNtwinFamily twinFamiliesLoop2: do f = 1_pInt,lattice_maxNtwinFamily
index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,structID)) ! at which index starts my family index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,structID)) ! at which index starts my family
do i = 1_pInt,constitutive_phenopowerlaw_Ntwin(f,matID) ! process each (active) twin system in family do i = 1_pInt,constitutive_phenopowerlaw_Ntwin(f,instance) ! process each (active) twin system in family
j = j + 1_pInt j = j + 1_pInt
constitutive_phenopowerlaw_postResults(c+j) = & constitutive_phenopowerlaw_postResults(c+j) = &
dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,structID)) dot_product(Tstar_v,lattice_Stwin_v(1:6,index_myFamily+i,structID))

File diff suppressed because it is too large Load Diff