rename Nconstituents --> Nmembers

This commit is contained in:
Philip Eisenlohr 2021-03-04 15:16:36 -05:00
parent e1f0d2e0a3
commit a7e2ed40dd
15 changed files with 127 additions and 135 deletions

View File

@ -133,7 +133,7 @@ module subroutine damage_init
integer :: &
ph, & !< counter in phase loop
Nconstituents
Nmembers
class(tNode), pointer :: &
phases, &
phase, &
@ -151,10 +151,10 @@ module subroutine damage_init
do ph = 1,phases%length
Nconstituents = count(material_phaseAt2 == ph)
Nmembers = count(material_phaseAt2 == ph)
allocate(current(ph)%phi(Nconstituents),source=1.0_pReal)
allocate(current(ph)%d_phi_d_dot_phi(Nconstituents),source=0.0_pReal)
allocate(current(ph)%phi(Nmembers),source=1.0_pReal)
allocate(current(ph)%d_phi_d_dot_phi(Nmembers),source=0.0_pReal)
phase => phases%get(ph)
sources => phase%get('damage',defaultVal=emptyList)
@ -199,7 +199,7 @@ module subroutine phase_damage_getRateAndItsTangents(phiDot, dPhiDot_dPhi, phi,
phiDot = 0.0_pReal
dPhiDot_dPhi = 0.0_pReal
do co = 1, homogenization_Nconstituents(material_homogenizationAt2(ce))
do co = 1, homogenization_Nmembers(material_homogenizationAt2(ce))
ph = material_phaseAt2(co,ce)
me = material_phasememberAt2(co,ce)

View File

@ -40,7 +40,7 @@ module function anisobrittle_init() result(mySources)
phase, &
sources, &
src
integer :: Nconstituents,p
integer :: Nmembers,p
integer, dimension(:), allocatable :: N_cl
character(len=pStringLen) :: extmsg = ''
@ -92,8 +92,8 @@ module function anisobrittle_init() result(mySources)
if (any(prm%g_crit < 0.0_pReal)) extmsg = trim(extmsg)//' g_crit'
if (any(prm%s_crit < 0.0_pReal)) extmsg = trim(extmsg)//' s_crit'
Nconstituents = count(material_phaseAt==p) * discretization_nIPs
call phase_allocateState(damageState(p),Nconstituents,1,1,0)
Nmembers = count(material_phaseAt==p) * discretization_nIPs
call phase_allocateState(damageState(p),Nmembers,1,1,0)
damageState(p)%atol = src%get_asFloat('anisobrittle_atol',defaultVal=1.0e-3_pReal)
if(any(damageState(p)%atol < 0.0_pReal)) extmsg = trim(extmsg)//' anisobrittle_atol'

View File

@ -35,7 +35,7 @@ module function anisoductile_init() result(mySources)
pl, &
sources, &
src
integer :: Ninstances,Nconstituents,p
integer :: Ninstances,Nmembers,p
integer, dimension(:), allocatable :: N_sl
character(len=pStringLen) :: extmsg = ''
@ -78,8 +78,8 @@ module function anisoductile_init() result(mySources)
if (prm%q <= 0.0_pReal) extmsg = trim(extmsg)//' q'
if (any(prm%gamma_crit < 0.0_pReal)) extmsg = trim(extmsg)//' gamma_crit'
Nconstituents=count(material_phaseAt2==p)
call phase_allocateState(damageState(p),Nconstituents,1,1,0)
Nmembers=count(material_phaseAt2==p)
call phase_allocateState(damageState(p),Nmembers,1,1,0)
damageState(p)%atol = src%get_asFloat('anisoDuctile_atol',defaultVal=1.0e-3_pReal)
if(any(damageState(p)%atol < 0.0_pReal)) extmsg = trim(extmsg)//' anisoductile_atol'

View File

@ -31,7 +31,7 @@ module function isobrittle_init() result(mySources)
phase, &
sources, &
src
integer :: Nconstituents,p
integer :: Nmembers,p
character(len=pStringLen) :: extmsg = ''
@ -64,8 +64,8 @@ module function isobrittle_init() result(mySources)
! sanity checks
if (prm%W_crit <= 0.0_pReal) extmsg = trim(extmsg)//' W_crit'
Nconstituents = count(material_phaseAt2==p)
call phase_allocateState(damageState(p),Nconstituents,1,1,1)
Nmembers = count(material_phaseAt2==p)
call phase_allocateState(damageState(p),Nmembers,1,1,1)
damageState(p)%atol = src%get_asFloat('isoBrittle_atol',defaultVal=1.0e-3_pReal)
if(any(damageState(p)%atol < 0.0_pReal)) extmsg = trim(extmsg)//' isobrittle_atol'

View File

@ -33,7 +33,7 @@ module function isoductile_init() result(mySources)
phase, &
sources, &
src
integer :: Ninstances,Nconstituents,p
integer :: Ninstances,Nmembers,p
character(len=pStringLen) :: extmsg = ''
@ -68,8 +68,8 @@ module function isoductile_init() result(mySources)
if (prm%q <= 0.0_pReal) extmsg = trim(extmsg)//' q'
if (prm%gamma_crit <= 0.0_pReal) extmsg = trim(extmsg)//' gamma_crit'
Nconstituents=count(material_phaseAt2==p)
call phase_allocateState(damageState(p),Nconstituents,1,1,0)
Nmembers=count(material_phaseAt2==p)
call phase_allocateState(damageState(p),Nmembers,1,1,0)
damageState(p)%atol = src%get_asFloat('isoDuctile_atol',defaultVal=1.0e-3_pReal)
if(any(damageState(p)%atol < 0.0_pReal)) extmsg = trim(extmsg)//' isoductile_atol'

View File

@ -191,7 +191,7 @@ module subroutine mechanical_init(materials,phases)
ph, &
me, &
stiffDegradationCtr, &
Nconstituents
Nmembers
class(tNode), pointer :: &
num_crystallite, &
material, &
@ -229,22 +229,22 @@ module subroutine mechanical_init(materials,phases)
allocate(material_orientation0(homogenization_maxNconstituents,phases%length,maxVal(material_phaseMemberAt)))
do ph = 1, phases%length
Nconstituents = count(material_phaseAt == ph) * discretization_nIPs
Nmembers = count(material_phaseAt == ph) * discretization_nIPs
allocate(phase_mechanical_Fi(ph)%data(3,3,Nconstituents))
allocate(phase_mechanical_Fe(ph)%data(3,3,Nconstituents))
allocate(phase_mechanical_Fi0(ph)%data(3,3,Nconstituents))
allocate(phase_mechanical_Fp(ph)%data(3,3,Nconstituents))
allocate(phase_mechanical_Fp0(ph)%data(3,3,Nconstituents))
allocate(phase_mechanical_Li(ph)%data(3,3,Nconstituents))
allocate(phase_mechanical_Li0(ph)%data(3,3,Nconstituents))
allocate(phase_mechanical_Lp0(ph)%data(3,3,Nconstituents))
allocate(phase_mechanical_Lp(ph)%data(3,3,Nconstituents))
allocate(phase_mechanical_S(ph)%data(3,3,Nconstituents),source=0.0_pReal)
allocate(phase_mechanical_P(ph)%data(3,3,Nconstituents),source=0.0_pReal)
allocate(phase_mechanical_S0(ph)%data(3,3,Nconstituents),source=0.0_pReal)
allocate(phase_mechanical_F(ph)%data(3,3,Nconstituents))
allocate(phase_mechanical_F0(ph)%data(3,3,Nconstituents))
allocate(phase_mechanical_Fi(ph)%data(3,3,Nmembers))
allocate(phase_mechanical_Fe(ph)%data(3,3,Nmembers))
allocate(phase_mechanical_Fi0(ph)%data(3,3,Nmembers))
allocate(phase_mechanical_Fp(ph)%data(3,3,Nmembers))
allocate(phase_mechanical_Fp0(ph)%data(3,3,Nmembers))
allocate(phase_mechanical_Li(ph)%data(3,3,Nmembers))
allocate(phase_mechanical_Li0(ph)%data(3,3,Nmembers))
allocate(phase_mechanical_Lp0(ph)%data(3,3,Nmembers))
allocate(phase_mechanical_Lp(ph)%data(3,3,Nmembers))
allocate(phase_mechanical_S(ph)%data(3,3,Nmembers),source=0.0_pReal)
allocate(phase_mechanical_P(ph)%data(3,3,Nmembers),source=0.0_pReal)
allocate(phase_mechanical_S0(ph)%data(3,3,Nmembers),source=0.0_pReal)
allocate(phase_mechanical_F(ph)%data(3,3,Nmembers))
allocate(phase_mechanical_F0(ph)%data(3,3,Nmembers))
phase => phases%get(ph)
mech => phase%get('mechanics')
@ -278,9 +278,9 @@ module subroutine mechanical_init(materials,phases)
enddo
endif
do el = 1, size(material_phaseMemberAt,3); do ip = 1, size(material_phaseMemberAt,2)
do co = 1, homogenization_Nconstituents(material_homogenizationAt(el))
do co = 1, homogenization_Nmembers(material_homogenizationAt(el))
material => materials%get(discretization_materialAt(el))
constituents => material%get('constituents')
constituent => constituents%get(co)
@ -1238,7 +1238,7 @@ module subroutine mechanical_restore(ce,includeL)
co, ph, me
do co = 1,homogenization_Nconstituents(material_homogenizationAt2(ce))
do co = 1,homogenization_Nmembers(material_homogenizationAt2(ce))
ph = material_phaseAt2(co,ce)
me = material_phaseMemberAt2(co,ce)
if (includeL) then

View File

@ -79,7 +79,7 @@ module function plastic_dislotungsten_init() result(myPlasticity)
logical, dimension(:), allocatable :: myPlasticity
integer :: &
ph, i, &
Nconstituents, &
Nmembers, &
sizeState, sizeDotState, &
startIndex, endIndex
integer, dimension(:), allocatable :: &
@ -220,18 +220,18 @@ module function plastic_dislotungsten_init() result(myPlasticity)
!--------------------------------------------------------------------------------------------------
! allocate state arrays
Nconstituents = count(material_phaseAt2 == ph)
Nmembers = count(material_phaseAt2 == ph)
sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl
sizeState = sizeDotState
call phase_allocateState(plasticState(ph),Nconstituents,sizeState,sizeDotState,0)
call phase_allocateState(plasticState(ph),Nmembers,sizeState,sizeDotState,0)
!--------------------------------------------------------------------------------------------------
! state aliases and initialization
startIndex = 1
endIndex = prm%sum_N_sl
stt%rho_mob => plasticState(ph)%state(startIndex:endIndex,:)
stt%rho_mob = spread(rho_mob_0,2,Nconstituents)
stt%rho_mob = spread(rho_mob_0,2,Nmembers)
dot%rho_mob => plasticState(ph)%dotState(startIndex:endIndex,:)
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_rho',defaultVal=1.0_pReal)
if (any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_rho'
@ -239,7 +239,7 @@ module function plastic_dislotungsten_init() result(myPlasticity)
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_sl
stt%rho_dip => plasticState(ph)%state(startIndex:endIndex,:)
stt%rho_dip = spread(rho_dip_0,2,Nconstituents)
stt%rho_dip = spread(rho_dip_0,2,Nmembers)
dot%rho_dip => plasticState(ph)%dotState(startIndex:endIndex,:)
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_rho',defaultVal=1.0_pReal)
@ -251,8 +251,8 @@ module function plastic_dislotungsten_init() result(myPlasticity)
! global alias
plasticState(ph)%slipRate => plasticState(ph)%dotState(startIndex:endIndex,:)
allocate(dst%Lambda_sl(prm%sum_N_sl,Nconstituents), source=0.0_pReal)
allocate(dst%threshold_stress(prm%sum_N_sl,Nconstituents), source=0.0_pReal)
allocate(dst%Lambda_sl(prm%sum_N_sl,Nmembers), source=0.0_pReal)
allocate(dst%threshold_stress(prm%sum_N_sl,Nmembers), source=0.0_pReal)
plasticState(ph)%state0 = plasticState(ph)%state ! ToDo: this could be done centrally

View File

@ -127,7 +127,7 @@ module function plastic_dislotwin_init() result(myPlasticity)
logical, dimension(:), allocatable :: myPlasticity
integer :: &
ph, i, &
Nconstituents, &
Nmembers, &
sizeState, sizeDotState, &
startIndex, endIndex
integer, dimension(:), allocatable :: &
@ -406,21 +406,21 @@ module function plastic_dislotwin_init() result(myPlasticity)
!--------------------------------------------------------------------------------------------------
! allocate state arrays
Nconstituents = count(material_phaseAt2 == ph)
Nmembers = count(material_phaseAt2 == ph)
sizeDotState = size(['rho_mob ','rho_dip ','gamma_sl']) * prm%sum_N_sl &
+ size(['f_tw']) * prm%sum_N_tw &
+ size(['f_tr']) * prm%sum_N_tr
sizeState = sizeDotState
call phase_allocateState(plasticState(ph),Nconstituents,sizeState,sizeDotState,0)
call phase_allocateState(plasticState(ph),Nmembers,sizeState,sizeDotState,0)
!--------------------------------------------------------------------------------------------------
! locally defined state aliases and initialization of state0 and atol
startIndex = 1
endIndex = prm%sum_N_sl
stt%rho_mob=>plasticState(ph)%state(startIndex:endIndex,:)
stt%rho_mob= spread(rho_mob_0,2,Nconstituents)
stt%rho_mob= spread(rho_mob_0,2,Nmembers)
dot%rho_mob=>plasticState(ph)%dotState(startIndex:endIndex,:)
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_rho',defaultVal=1.0_pReal)
if (any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_rho'
@ -428,7 +428,7 @@ module function plastic_dislotwin_init() result(myPlasticity)
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_sl
stt%rho_dip=>plasticState(ph)%state(startIndex:endIndex,:)
stt%rho_dip= spread(rho_dip_0,2,Nconstituents)
stt%rho_dip= spread(rho_dip_0,2,Nmembers)
dot%rho_dip=>plasticState(ph)%dotState(startIndex:endIndex,:)
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_rho',defaultVal=1.0_pReal)
@ -454,18 +454,18 @@ module function plastic_dislotwin_init() result(myPlasticity)
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_f_tr',defaultVal=1.0e-6_pReal)
if (any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_f_tr'
allocate(dst%Lambda_sl (prm%sum_N_sl,Nconstituents),source=0.0_pReal)
allocate(dst%tau_pass (prm%sum_N_sl,Nconstituents),source=0.0_pReal)
allocate(dst%Lambda_sl (prm%sum_N_sl,Nmembers),source=0.0_pReal)
allocate(dst%tau_pass (prm%sum_N_sl,Nmembers),source=0.0_pReal)
allocate(dst%Lambda_tw (prm%sum_N_tw,Nconstituents),source=0.0_pReal)
allocate(dst%tau_hat_tw (prm%sum_N_tw,Nconstituents),source=0.0_pReal)
allocate(dst%tau_r_tw (prm%sum_N_tw,Nconstituents),source=0.0_pReal)
allocate(dst%V_tw (prm%sum_N_tw,Nconstituents),source=0.0_pReal)
allocate(dst%Lambda_tw (prm%sum_N_tw,Nmembers),source=0.0_pReal)
allocate(dst%tau_hat_tw (prm%sum_N_tw,Nmembers),source=0.0_pReal)
allocate(dst%tau_r_tw (prm%sum_N_tw,Nmembers),source=0.0_pReal)
allocate(dst%V_tw (prm%sum_N_tw,Nmembers),source=0.0_pReal)
allocate(dst%Lambda_tr (prm%sum_N_tr,Nconstituents),source=0.0_pReal)
allocate(dst%tau_hat_tr (prm%sum_N_tr,Nconstituents),source=0.0_pReal)
allocate(dst%tau_r_tr (prm%sum_N_tr,Nconstituents),source=0.0_pReal)
allocate(dst%V_tr (prm%sum_N_tr,Nconstituents),source=0.0_pReal)
allocate(dst%Lambda_tr (prm%sum_N_tr,Nmembers),source=0.0_pReal)
allocate(dst%tau_hat_tr (prm%sum_N_tr,Nmembers),source=0.0_pReal)
allocate(dst%tau_r_tr (prm%sum_N_tr,Nmembers),source=0.0_pReal)
allocate(dst%V_tr (prm%sum_N_tr,Nmembers),source=0.0_pReal)
plasticState(ph)%state0 = plasticState(ph)%state ! ToDo: this could be done centrally

View File

@ -52,7 +52,7 @@ module function plastic_isotropic_init() result(myPlasticity)
logical, dimension(:), allocatable :: myPlasticity
integer :: &
ph, &
Nconstituents, &
Nmembers, &
sizeState, sizeDotState
real(pReal) :: &
xi_0 !< initial critical stress
@ -119,11 +119,11 @@ module function plastic_isotropic_init() result(myPlasticity)
!--------------------------------------------------------------------------------------------------
! allocate state arrays
Nconstituents = count(material_phaseAt2 == ph)
Nmembers = count(material_phaseAt2 == ph)
sizeDotState = size(['xi ','gamma'])
sizeState = sizeDotState
call phase_allocateState(plasticState(ph),Nconstituents,sizeState,sizeDotState,0)
call phase_allocateState(plasticState(ph),Nmembers,sizeState,sizeDotState,0)
!--------------------------------------------------------------------------------------------------
! state aliases and initialization

View File

@ -62,7 +62,7 @@ module function plastic_kinehardening_init() result(myPlasticity)
logical, dimension(:), allocatable :: myPlasticity
integer :: &
ph, o, &
Nconstituents, &
Nmembers, &
sizeState, sizeDeltaState, sizeDotState, &
startIndex, endIndex
integer, dimension(:), allocatable :: &
@ -165,19 +165,19 @@ module function plastic_kinehardening_init() result(myPlasticity)
!--------------------------------------------------------------------------------------------------
! allocate state arrays
Nconstituents = count(material_phaseAt2 == ph)
Nmembers = count(material_phaseAt2 == ph)
sizeDotState = size(['crss ','crss_back', 'accshear ']) * prm%sum_N_sl !ToDo: adjust names like in material.yaml
sizeDeltaState = size(['sense ', 'chi0 ', 'gamma0' ]) * prm%sum_N_sl !ToDo: adjust names like in material.yaml
sizeState = sizeDotState + sizeDeltaState
call phase_allocateState(plasticState(ph),Nconstituents,sizeState,sizeDotState,sizeDeltaState)
call phase_allocateState(plasticState(ph),Nmembers,sizeState,sizeDotState,sizeDeltaState)
!--------------------------------------------------------------------------------------------------
! state aliases and initialization
startIndex = 1
endIndex = prm%sum_N_sl
stt%crss => plasticState(ph)%state (startIndex:endIndex,:)
stt%crss = spread(xi_0, 2, Nconstituents)
stt%crss = spread(xi_0, 2, Nmembers)
dot%crss => plasticState(ph)%dotState(startIndex:endIndex,:)
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_xi',defaultVal=1.0_pReal)
if(any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_xi'

View File

@ -177,7 +177,7 @@ module function plastic_nonlocal_init() result(myPlasticity)
integer :: &
Ninstances, &
ph, &
Nconstituents, &
Nmembers, &
sizeState, sizeDotState, sizeDependentState, sizeDeltaState, &
s1, s2, &
s, t, l
@ -398,7 +398,7 @@ module function plastic_nonlocal_init() result(myPlasticity)
!--------------------------------------------------------------------------------------------------
! allocate state arrays
Nconstituents = count(material_phaseAt2 == ph)
Nmembers = count(material_phaseAt2 == ph)
sizeDotState = size([ 'rhoSglEdgePosMobile ','rhoSglEdgeNegMobile ', &
'rhoSglScrewPosMobile ','rhoSglScrewNegMobile ', &
'rhoSglEdgePosImmobile ','rhoSglEdgeNegImmobile ', &
@ -412,9 +412,9 @@ module function plastic_nonlocal_init() result(myPlasticity)
'maxDipoleHeightEdge ','maxDipoleHeightScrew' ]) * prm%sum_N_sl !< other dependent state variables that are not updated by microstructure
sizeDeltaState = sizeDotState
call phase_allocateState(plasticState(ph),Nconstituents,sizeState,sizeDotState,sizeDeltaState)
call phase_allocateState(plasticState(ph),Nmembers,sizeState,sizeDotState,sizeDeltaState)
allocate(geom(ph)%V_0(Nconstituents))
allocate(geom(ph)%V_0(Nmembers))
call storeGeometry(ph)
plasticState(ph)%nonlocal = pl%get_asBool('nonlocal')
@ -486,26 +486,26 @@ module function plastic_nonlocal_init() result(myPlasticity)
dot%rho_dip_scr => plasticState(ph)%dotState (9*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
del%rho_dip_scr => plasticState(ph)%deltaState (9*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
stt%gamma => plasticState(ph)%state (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:Nconstituents)
dot%gamma => plasticState(ph)%dotState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:Nconstituents)
del%gamma => plasticState(ph)%deltaState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:Nconstituents)
stt%gamma => plasticState(ph)%state (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:Nmembers)
dot%gamma => plasticState(ph)%dotState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:Nmembers)
del%gamma => plasticState(ph)%deltaState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:Nmembers)
plasticState(ph)%atol(10*prm%sum_N_sl+1:11*prm%sum_N_sl ) = pl%get_asFloat('atol_gamma', defaultVal = 1.0e-2_pReal)
if(any(plasticState(ph)%atol(10*prm%sum_N_sl+1:11*prm%sum_N_sl) < 0.0_pReal)) &
extmsg = trim(extmsg)//' atol_gamma'
plasticState(ph)%slipRate => plasticState(ph)%dotState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:Nconstituents)
plasticState(ph)%slipRate => plasticState(ph)%dotState (10*prm%sum_N_sl + 1:11*prm%sum_N_sl,1:Nmembers)
stt%rho_forest => plasticState(ph)%state (11*prm%sum_N_sl + 1:12*prm%sum_N_sl,1:Nconstituents)
stt%v => plasticState(ph)%state (12*prm%sum_N_sl + 1:16*prm%sum_N_sl,1:Nconstituents)
stt%v_edg_pos => plasticState(ph)%state (12*prm%sum_N_sl + 1:13*prm%sum_N_sl,1:Nconstituents)
stt%v_edg_neg => plasticState(ph)%state (13*prm%sum_N_sl + 1:14*prm%sum_N_sl,1:Nconstituents)
stt%v_scr_pos => plasticState(ph)%state (14*prm%sum_N_sl + 1:15*prm%sum_N_sl,1:Nconstituents)
stt%v_scr_neg => plasticState(ph)%state (15*prm%sum_N_sl + 1:16*prm%sum_N_sl,1:Nconstituents)
stt%rho_forest => plasticState(ph)%state (11*prm%sum_N_sl + 1:12*prm%sum_N_sl,1:Nmembers)
stt%v => plasticState(ph)%state (12*prm%sum_N_sl + 1:16*prm%sum_N_sl,1:Nmembers)
stt%v_edg_pos => plasticState(ph)%state (12*prm%sum_N_sl + 1:13*prm%sum_N_sl,1:Nmembers)
stt%v_edg_neg => plasticState(ph)%state (13*prm%sum_N_sl + 1:14*prm%sum_N_sl,1:Nmembers)
stt%v_scr_pos => plasticState(ph)%state (14*prm%sum_N_sl + 1:15*prm%sum_N_sl,1:Nmembers)
stt%v_scr_neg => plasticState(ph)%state (15*prm%sum_N_sl + 1:16*prm%sum_N_sl,1:Nmembers)
allocate(dst%tau_pass(prm%sum_N_sl,Nconstituents),source=0.0_pReal)
allocate(dst%tau_back(prm%sum_N_sl,Nconstituents),source=0.0_pReal)
allocate(dst%tau_pass(prm%sum_N_sl,Nmembers),source=0.0_pReal)
allocate(dst%tau_back(prm%sum_N_sl,Nmembers),source=0.0_pReal)
end associate
if (Nconstituents > 0) call stateInit(ini,ph,Nconstituents)
if (Nmembers > 0) call stateInit(ini,ph,Nmembers)
plasticState(ph)%state0 = plasticState(ph)%state
!--------------------------------------------------------------------------------------------------
@ -527,7 +527,7 @@ module function plastic_nonlocal_init() result(myPlasticity)
if(.not. myPlasticity(ph)) cycle
phase => phases%get(ph)
Nconstituents = count(material_phaseAt2 == ph)
Nmembers = count(material_phaseAt2 == ph)
l = 0
do t = 1,4
do s = 1,param(ph)%sum_N_sl
@ -1406,7 +1406,7 @@ module subroutine plastic_nonlocal_updateCompatibility(orientation,ph,i,e)
me, &
neighbor_e, & ! element index of my neighbor
neighbor_i, & ! integration point index of my neighbor
neighbor_me, &
neighbor_me, &
neighbor_phase, &
ns, & ! number of active slip systems
s1, & ! slip system index (me)
@ -1579,13 +1579,13 @@ end subroutine plastic_nonlocal_results
!--------------------------------------------------------------------------------------------------
!> @brief populates the initial dislocation density
!--------------------------------------------------------------------------------------------------
subroutine stateInit(ini,phase,Nconstituents)
subroutine stateInit(ini,phase,Nmembers)
type(tInitialParameters) :: &
ini
integer,intent(in) :: &
phase, &
Nconstituents
Nmembers
integer :: &
i, &
e, &
@ -1602,7 +1602,7 @@ subroutine stateInit(ini,phase,Nconstituents)
totalVolume, &
densityBinning, &
minimumIpVolume
real(pReal), dimension(Nconstituents) :: &
real(pReal), dimension(Nmembers) :: &
volume
@ -1622,13 +1622,13 @@ subroutine stateInit(ini,phase,Nconstituents)
meanDensity = 0.0_pReal
do while(meanDensity < ini%random_rho_u)
call random_number(rnd)
phasemember = nint(rnd(1)*real(Nconstituents,pReal) + 0.5_pReal)
phasemember = nint(rnd(1)*real(Nmembers,pReal) + 0.5_pReal)
s = nint(rnd(2)*real(sum(ini%N_sl),pReal)*4.0_pReal + 0.5_pReal)
meanDensity = meanDensity + densityBinning * volume(phasemember) / totalVolume
stt%rhoSglMobile(s,phasemember) = densityBinning
enddo
else ! homogeneous distribution with noise
do e = 1, Nconstituents
do e = 1, Nmembers
do f = 1,size(ini%N_sl,1)
from = 1 + sum(ini%N_sl(1:f-1))
upto = sum(ini%N_sl(1:f))
@ -1809,7 +1809,7 @@ pure function getRho0(ph,me)
getRho0(:,mob) = max(getRho0(:,mob),0.0_pReal)
getRho0(:,dip) = max(getRho0(:,dip),0.0_pReal)
where(abs(getRho0) < max(prm%rho_min/geom(ph)%V_0(me)**(2.0_pReal/3.0_pReal),prm%rho_significant)) &
where (abs(getRho0) < max(prm%rho_min/geom(ph)%V_0(me)**(2.0_pReal/3.0_pReal),prm%rho_significant)) &
getRho0 = 0.0_pReal
end associate
@ -1823,12 +1823,12 @@ subroutine storeGeometry(ph)
integer :: ip, el, ce, co
real(pReal), dimension(:), allocatable :: V
V = reshape(IPvolume,[product(shape(IPvolume))])
do ce = 1, size(material_homogenizationMemberAt2,1)
do co = 1, homogenization_maxNconstituents
if(material_phaseAt2(co,ce) == ph) geom(ph)%V_0(material_phaseMemberAt2(co,ce)) = V(ce)
if (material_phaseAt2(co,ce) == ph) geom(ph)%V_0(material_phaseMemberAt2(co,ce)) = V(ce)
enddo
enddo

View File

@ -71,7 +71,7 @@ module function plastic_phenopowerlaw_init() result(myPlasticity)
logical, dimension(:), allocatable :: myPlasticity
integer :: &
ph, i, &
Nconstituents, &
Nmembers, &
sizeState, sizeDotState, &
startIndex, endIndex
integer, dimension(:), allocatable :: &
@ -223,20 +223,20 @@ module function plastic_phenopowerlaw_init() result(myPlasticity)
!--------------------------------------------------------------------------------------------------
! allocate state arrays
Nconstituents = count(material_phaseAt2 == ph)
Nmembers = count(material_phaseAt2 == ph)
sizeDotState = size(['xi_sl ','gamma_sl']) * prm%sum_N_sl &
+ size(['xi_tw ','gamma_tw']) * prm%sum_N_tw
sizeState = sizeDotState
call phase_allocateState(plasticState(ph),Nconstituents,sizeState,sizeDotState,0)
call phase_allocateState(plasticState(ph),Nmembers,sizeState,sizeDotState,0)
!--------------------------------------------------------------------------------------------------
! state aliases and initialization
startIndex = 1
endIndex = prm%sum_N_sl
stt%xi_slip => plasticState(ph)%state (startIndex:endIndex,:)
stt%xi_slip = spread(xi_0_sl, 2, Nconstituents)
stt%xi_slip = spread(xi_0_sl, 2, Nmembers)
dot%xi_slip => plasticState(ph)%dotState(startIndex:endIndex,:)
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_xi',defaultVal=1.0_pReal)
if(any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_xi'
@ -244,7 +244,7 @@ module function plastic_phenopowerlaw_init() result(myPlasticity)
startIndex = endIndex + 1
endIndex = endIndex + prm%sum_N_tw
stt%xi_twin => plasticState(ph)%state (startIndex:endIndex,:)
stt%xi_twin = spread(xi_0_tw, 2, Nconstituents)
stt%xi_twin = spread(xi_0_tw, 2, Nmembers)
dot%xi_twin => plasticState(ph)%dotState(startIndex:endIndex,:)
plasticState(ph)%atol(startIndex:endIndex) = pl%get_asFloat('atol_xi',defaultVal=1.0_pReal)
if(any(plasticState(ph)%atol(startIndex:endIndex) < 0.0_pReal)) extmsg = trim(extmsg)//' atol_xi'

View File

@ -15,13 +15,13 @@ submodule(phase) thermal
THERMAL_EXTERNALHEAT_ID
end enum
type :: tDataContainer
type :: tDataContainer ! ?? not very telling name. Better: "fieldQuantities" ??
real(pReal), dimension(:), allocatable :: T, dot_T
end type tDataContainer
integer(kind(THERMAL_UNDEFINED_ID)), dimension(:,:), allocatable :: &
thermal_source
type(tDataContainer), dimension(:), allocatable :: current
type(tDataContainer), dimension(:), allocatable :: current ! ?? not very telling name. Better: "field" ??
integer :: thermal_source_maxSizeDotState
@ -78,41 +78,36 @@ module subroutine thermal_init(phases)
integer :: &
ph, so, &
Nconstituents
Nmembers
print'(/,a)', ' <<<+- phase:thermal init -+>>>'
allocate(current(phases%length))
allocate(thermalState (phases%length))
allocate(thermalState(phases%length))
allocate(thermal_Nsources(phases%length),source = 0)
do ph = 1, phases%length
Nconstituents = count(material_phaseAt2 == ph)
allocate(current(ph)%T(Nconstituents),source=300.0_pReal)
allocate(current(ph)%dot_T(Nconstituents),source=0.0_pReal)
Nmembers = count(material_phaseAt2 == ph)
allocate(current(ph)%T(Nmembers),source=300.0_pReal)
allocate(current(ph)%dot_T(Nmembers),source=0.0_pReal)
phase => phases%get(ph)
if(phase%contains('thermal')) then
thermal => phase%get('thermal')
sources => thermal%get('source',defaultVal=emptyList)
thermal_Nsources(ph) = sources%length
endif
thermal => phase%get('thermal',defaultVal=emptyDict)
sources => thermal%get('source',defaultVal=emptyList)
thermal_Nsources(ph) = sources%length
allocate(thermalstate(ph)%p(thermal_Nsources(ph)))
enddo
allocate(thermal_source(maxval(thermal_Nsources),phases%length), source = THERMAL_UNDEFINED_ID)
if(maxval(thermal_Nsources) /= 0) then
if (maxval(thermal_Nsources) /= 0) then
where(dissipation_init (maxval(thermal_Nsources))) thermal_source = THERMAL_DISSIPATION_ID
where(externalheat_init(maxval(thermal_Nsources))) thermal_source = THERMAL_EXTERNALHEAT_ID
endif
thermal_source_maxSizeDotState = 0
PhaseLoop2:do ph = 1,phases%length
do ph = 1,phases%length
do so = 1,thermal_Nsources(ph)
thermalState(ph)%p(so)%state = thermalState(ph)%p(so)%state0
@ -120,7 +115,7 @@ module subroutine thermal_init(phases)
thermal_source_maxSizeDotState = max(thermal_source_maxSizeDotState, &
maxval(thermalState(ph)%p%sizeDotState))
enddo PhaseLoop2
enddo
end subroutine thermal_init
@ -145,18 +140,17 @@ module subroutine phase_thermal_getRate(TDot, ph,me)
do so = 1, thermal_Nsources(ph)
select case(thermal_source(so,ph))
case (THERMAL_DISSIPATION_ID)
call dissipation_getRate(my_Tdot, ph,me)
call dissipation_getRate(my_Tdot, ph,me)
case (THERMAL_EXTERNALHEAT_ID)
call externalheat_getRate(my_Tdot, ph,me)
call externalheat_getRate(my_Tdot, ph,me)
case default
my_Tdot = 0.0_pReal
my_Tdot = 0.0_pReal
end select
Tdot = Tdot + my_Tdot
enddo
end subroutine phase_thermal_getRate
@ -185,7 +179,7 @@ function phase_thermal_collectDotState(ph,me) result(broken)
end function phase_thermal_collectDotState
module function thermal_stress(Delta_t,ph,me) result(converged_)
module function thermal_stress(Delta_t,ph,me) result(converged_) ! ?? why is this called "stress" when it seems closer to "updateState" ??
real(pReal), intent(in) :: Delta_t
integer, intent(in) :: ph, me
@ -212,7 +206,7 @@ function integrateThermalState(Delta_t, ph,me) result(broken)
sizeDotState
broken = phase_thermal_collectDotState(ph,me)
if(broken) return
if (broken) return
do so = 1, thermal_Nsources(ph)
sizeDotState = thermalState(ph)%p(so)%sizeDotState
@ -301,14 +295,12 @@ function thermal_active(source_label,src_length) result(active_source)
allocate(active_source(src_length,phases%length), source = .false. )
do p = 1, phases%length
phase => phases%get(p)
if (phase%contains('thermal')) then
thermal => phase%get('thermal',defaultVal=emptyList)
sources => thermal%get('source',defaultVal=emptyList)
do s = 1, sources%length
src => sources%get(s)
if(src%get_asString('type') == source_label) active_source(s,p) = .true.
enddo
endif
thermal => phase%get('thermal',defaultVal=emptyDict)
sources => thermal%get('source',defaultVal=emptyList)
do s = 1, sources%length
src => sources%get(s)
active_source(s,p) = src%get_asString('type') == source_label
enddo
enddo

View File

@ -31,7 +31,7 @@ module function dissipation_init(source_length) result(mySources)
phase, &
sources, thermal, &
src
integer :: so,Nconstituents,ph
integer :: so,Nmembers,ph
mySources = thermal_active('dissipation',source_length)
@ -54,8 +54,8 @@ module function dissipation_init(source_length) result(mySources)
src => sources%get(so)
prm%kappa = src%get_asFloat('kappa')
Nconstituents = count(material_phaseAt2 == ph)
call phase_allocateState(thermalState(ph)%p(so),Nconstituents,0,0,0)
Nmembers = count(material_phaseAt2 == ph)
call phase_allocateState(thermalState(ph)%p(so),Nmembers,0,0,0)
end associate
endif

View File

@ -38,7 +38,7 @@ module function externalheat_init(source_length) result(mySources)
phase, &
sources, thermal, &
src
integer :: so,Nconstituents,ph
integer :: so,Nmembers,ph
mySources = thermal_active('externalheat',source_length)
@ -67,8 +67,8 @@ module function externalheat_init(source_length) result(mySources)
prm%f_T = src%get_asFloats('f_T',requiredSize = size(prm%t_n))
Nconstituents = count(material_phaseAt2 == ph)
call phase_allocateState(thermalState(ph)%p(so),Nconstituents,1,1,0)
Nmembers = count(material_phaseAt2 == ph)
call phase_allocateState(thermalState(ph)%p(so),Nmembers,1,1,0)
end associate
endif
enddo