no need to store atol twice

This commit is contained in:
Martin Diehl 2020-03-15 08:28:38 +01:00
parent 941a9fbff4
commit a3e2d39854
2 changed files with 20 additions and 28 deletions

View File

@ -54,7 +54,6 @@ submodule(constitutive) plastic_nonlocal
Dsd0, & !< prefactor for self-diffusion coefficient
selfDiffusionEnergy, & !< activation enthalpy for diffusion
atol_rho, & !< absolute tolerance for dislocation density in state integration
atol_gamma, & !< absolute tolerance for accumulated shear in state integration
significantRho, & !< density considered significant
significantN, & !< number of dislocations considered significant
doublekinkwidth, & !< width of a doubkle kink in multiples of the burgers vector length b
@ -217,7 +216,6 @@ module subroutine plastic_nonlocal_init
prm%output = config%getStrings('(output)',defaultVal=emptyStringArray)
prm%atol_rho = config%getFloat('atol_rho', defaultVal=0.0_pReal)
prm%atol_gamma = config%getFloat('atol_shear', defaultVal=0.0_pReal)
structure = config%getString('lattice_structure')
@ -353,7 +351,6 @@ module subroutine plastic_nonlocal_init
if (prm%significantN < 0.0_pReal) extmsg = trim(extmsg)//' significantN'
if (prm%significantrho < 0.0_pReal) extmsg = trim(extmsg)//' significantrho'
if (prm%atol_rho <= 0.0_pReal) extmsg = trim(extmsg)//' atol_rho'
if (prm%atol_gamma <= 0.0_pReal) extmsg = trim(extmsg)//' atol_gamma'
if (prm%CFLfactor < 0.0_pReal) extmsg = trim(extmsg)//' CFLfactor'
if (prm%p <= 0.0_pReal .or. prm%p > 1.0_pReal) extmsg = trim(extmsg)//' p'
@ -465,7 +462,9 @@ module subroutine plastic_nonlocal_init
stt%gamma => plasticState(p)%state (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
dot%gamma => plasticState(p)%dotState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
del%gamma => plasticState(p)%deltaState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
plasticState(p)%atolState(10*prm%totalNslip + 1:11*prm%totalNslip ) = prm%atol_gamma
plasticState(p)%atolState(10*prm%totalNslip+1:11*prm%totalNslip ) = config%getFloat('atol_shear', defaultVal=0.0_pReal)
if(any(plasticState(p)%atolState(10*prm%totalNslip+1:11*prm%totalNslip)<=0.0_pReal)) &
extmsg = trim(extmsg)//' atol_gamma'
plasticState(p)%slipRate => plasticState(p)%dotState (10*prm%totalNslip + 1:11*prm%totalNslip ,1:NofMyPhase)
stt%rho_forest => plasticState(p)%state (11*prm%totalNslip + 1:12*prm%totalNslip ,1:NofMyPhase)

View File

@ -20,10 +20,7 @@ submodule(constitutive) plastic_phenopowerlaw
h0_SlipSlip, & !< reference hardening slip - slip
h0_TwinSlip, & !< reference hardening twin - slip
h0_TwinTwin, & !< reference hardening twin - twin
a_slip, &
aTolResistance, & !< absolute tolerance for integration of xi
aTolShear, & !< absolute tolerance for integration of gamma
aTolTwinfrac !< absolute tolerance for integration of f
a_slip
real(pReal), allocatable, dimension(:) :: &
xi_slip_0, & !< initial critical shear stress for slip
xi_twin_0, & !< initial critical shear stress for twin
@ -85,7 +82,7 @@ module subroutine plastic_phenopowerlaw_init
character(len=pStringLen) :: &
extmsg = ''
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_PHENOPOWERLAW_label//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_PHENOPOWERLAW_LABEL//' init -+>>>'; flush(6)
Ninstance = count(phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
@ -109,15 +106,6 @@ module subroutine plastic_phenopowerlaw_init
prm%c_3 = config%getFloat('twin_e',defaultVal=0.0_pReal)
prm%c_4 = config%getFloat('twin_d',defaultVal=0.0_pReal)
prm%aTolResistance = config%getFloat('atol_resistance',defaultVal=1.0_pReal)
prm%aTolShear = config%getFloat('atol_shear', defaultVal=1.0e-6_pReal)
prm%aTolTwinfrac = config%getFloat('atol_twinfrac', defaultVal=1.0e-6_pReal)
! sanity checks
if (prm%aTolResistance <= 0.0_pReal) extmsg = trim(extmsg)//' aTolresistance'
if (prm%aTolShear <= 0.0_pReal) extmsg = trim(extmsg)//' aTolShear'
if (prm%aTolTwinfrac <= 0.0_pReal) extmsg = trim(extmsg)//' atoltwinfrac'
!--------------------------------------------------------------------------------------------------
! slip related parameters
prm%Nslip = config%getInts('nslip',defaultVal=emptyIntArray)
@ -214,11 +202,6 @@ module subroutine plastic_phenopowerlaw_init
prm%h0_TwinSlip = 0.0_pReal
endif slipAndTwinActive
!--------------------------------------------------------------------------------------------------
! exit if any parameter is out of range
if (extmsg /= '') &
call IO_error(211,ext_msg=trim(extmsg)//'('//PLASTICITY_PHENOPOWERLAW_label//')')
!--------------------------------------------------------------------------------------------------
! output pararameters
prm%output = config%getStrings('(output)',defaultVal=emptyStringArray)
@ -233,26 +216,30 @@ module subroutine plastic_phenopowerlaw_init
call material_allocatePlasticState(p,NipcMyPhase,sizeState,sizeDotState,0)
!--------------------------------------------------------------------------------------------------
! locally defined state aliases and initialization of state0 and aTolState
! locally defined state aliases and initialization of state0 and atolState
startIndex = 1
endIndex = prm%totalNslip
stt%xi_slip => plasticState(p)%state (startIndex:endIndex,:)
stt%xi_slip = spread(prm%xi_slip_0, 2, NipcMyPhase)
dot%xi_slip => plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolResistance
plasticState(p)%atolState(startIndex:endIndex) = config%getFloat('atol_resistance',defaultVal=1.0_pReal)
if(any(plasticState(p)%atolState(startIndex:endIndex)<=0.0_pReal)) &
extmsg = trim(extmsg)//' atol_xi'
startIndex = endIndex + 1
endIndex = endIndex + prm%totalNtwin
stt%xi_twin => plasticState(p)%state (startIndex:endIndex,:)
stt%xi_twin = spread(prm%xi_twin_0, 2, NipcMyPhase)
dot%xi_twin => plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolResistance
plasticState(p)%atolState(startIndex:endIndex) = config%getFloat('atol_resistance',defaultVal=1.0_pReal)
startIndex = endIndex + 1
endIndex = endIndex + prm%totalNslip
stt%gamma_slip => plasticState(p)%state (startIndex:endIndex,:)
dot%gamma_slip => plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear
plasticState(p)%atolState(startIndex:endIndex) = config%getFloat('atol_shear',defaultVal=1.0e-6_pReal)
if(any(plasticState(p)%atolState(startIndex:endIndex)<=0.0_pReal)) &
extmsg = trim(extmsg)//' atol_gamma_slip'
! global alias
plasticState(p)%slipRate => plasticState(p)%dotState(startIndex:endIndex,:)
@ -260,12 +247,18 @@ module subroutine plastic_phenopowerlaw_init
endIndex = endIndex + prm%totalNtwin
stt%gamma_twin => plasticState(p)%state (startIndex:endIndex,:)
dot%gamma_twin => plasticState(p)%dotState(startIndex:endIndex,:)
plasticState(p)%aTolState(startIndex:endIndex) = prm%aTolShear
plasticState(p)%atolState(startIndex:endIndex) = config%getFloat('atol_twinfrac',defaultVal=1.0e-6_pReal)
if(any(plasticState(p)%atolState(startIndex:endIndex)<=0.0_pReal)) &
extmsg = trim(extmsg)//' atol_gamma_twin'
plasticState(p)%state0 = plasticState(p)%state ! ToDo: this could be done centrally
end associate
!--------------------------------------------------------------------------------------------------
! exit if any parameter is out of range
if (extmsg /= '') call IO_error(211,ext_msg=trim(extmsg)//'('//PLASTICITY_PHENOPOWERLAW_LABEL//')')
enddo
end subroutine plastic_phenopowerlaw_init