avoiding repeated reading of material.config
This commit is contained in:
parent
55cef533f1
commit
9574dfae2d
|
@ -32,10 +32,7 @@ module source_damage_anisoBrittle
|
|||
source_damage_anisoBrittle_Ncleavage !< number of cleavage systems per family
|
||||
|
||||
real(pReal), dimension(:), allocatable, private :: &
|
||||
source_damage_anisoBrittle_aTol, &
|
||||
source_damage_anisoBrittle_sdot_0, &
|
||||
source_damage_anisoBrittle_N
|
||||
|
||||
source_damage_anisoBrittle_sdot_0
|
||||
real(pReal), dimension(:,:), allocatable, private :: &
|
||||
source_damage_anisoBrittle_critDisp, &
|
||||
source_damage_anisoBrittle_critLoad
|
||||
|
@ -85,6 +82,8 @@ subroutine source_damage_anisoBrittle_init(fileUnit)
|
|||
compiler_version, &
|
||||
compiler_options
|
||||
#endif
|
||||
use prec, only: &
|
||||
pStringLen
|
||||
use debug, only: &
|
||||
debug_level,&
|
||||
debug_constitutive,&
|
||||
|
@ -128,9 +127,12 @@ subroutine source_damage_anisoBrittle_init(fileUnit)
|
|||
integer(pInt) :: sizeState, sizeDotState, sizeDeltaState
|
||||
integer(pInt) :: NofMyPhase,p
|
||||
integer(pInt) :: Nchunks_CleavageFamilies = 0_pInt, j
|
||||
character(len=pStringLen) :: &
|
||||
extmsg = ''
|
||||
character(len=65536) :: &
|
||||
tag = '', &
|
||||
line = ''
|
||||
integer(pInt), dimension(0), parameter :: emptyIntArray = [integer(pInt)::]
|
||||
|
||||
write(6,'(/,a)') ' <<<+- source_'//SOURCE_damage_anisoBrittle_LABEL//' init -+>>>'
|
||||
write(6,'(a15,a)') ' Current time: ',IO_timeStamp()
|
||||
|
@ -163,12 +165,30 @@ subroutine source_damage_anisoBrittle_init(fileUnit)
|
|||
allocate(source_damage_anisoBrittle_critLoad(lattice_maxNcleavageFamily,Ninstance), source=0.0_pReal)
|
||||
allocate(source_damage_anisoBrittle_Ncleavage(lattice_maxNcleavageFamily,Ninstance), source=0_pInt)
|
||||
allocate(source_damage_anisoBrittle_totalNcleavage(Ninstance), source=0_pInt)
|
||||
allocate(source_damage_anisoBrittle_aTol(Ninstance), source=0.0_pReal)
|
||||
allocate(source_damage_anisoBrittle_sdot_0(Ninstance), source=0.0_pReal)
|
||||
allocate(source_damage_anisoBrittle_N(Ninstance), source=0.0_pReal)
|
||||
|
||||
allocate(param(Ninstance))
|
||||
|
||||
do p=1, size(config_phase)
|
||||
if (all(phase_source(:,p) /= SOURCE_damage_anisoBrittle_ID)) cycle
|
||||
if (all(phase_source(:,p) /= SOURCE_DAMAGE_ANISOBRITTLE_ID)) cycle
|
||||
associate(prm => param(source_damage_anisoBrittle_instance(p)), &
|
||||
config => config_phase(p))
|
||||
|
||||
prm%aTol = config%getFloat('anisobrittle_atol',defaultVal = 1.0e-3_pReal)
|
||||
|
||||
prm%N = config%getFloat('anisobrittle_ratesensitivity')
|
||||
prm%sdot_0 = config%getFloat('anisobrittle_sdot0')
|
||||
|
||||
! sanity checks
|
||||
if (prm%aTol < 0.0_pReal) extmsg = trim(extmsg)//' anisobrittle_atol'
|
||||
|
||||
if (prm%N <= 0.0_pReal) extmsg = trim(extmsg)//' anisobrittle_ratesensitivity'
|
||||
if (prm%sdot_0 <= 0.0_pReal) extmsg = trim(extmsg)//' anisobrittle_sdot0'
|
||||
|
||||
prm%Ncleavage = config%getInts('ncleavage',defaultVal=emptyIntArray)
|
||||
|
||||
end associate
|
||||
|
||||
enddo
|
||||
|
||||
rewind(fileUnit)
|
||||
|
@ -202,15 +222,9 @@ subroutine source_damage_anisoBrittle_init(fileUnit)
|
|||
IO_lc(IO_stringValue(line,chunkPos,2_pInt))
|
||||
end select
|
||||
|
||||
case ('anisobrittle_atol')
|
||||
source_damage_anisoBrittle_aTol(instance) = IO_floatValue(line,chunkPos,2_pInt)
|
||||
|
||||
case ('anisobrittle_sdot0')
|
||||
source_damage_anisoBrittle_sdot_0(instance) = IO_floatValue(line,chunkPos,2_pInt)
|
||||
|
||||
case ('anisobrittle_ratesensitivity')
|
||||
source_damage_anisoBrittle_N(instance) = IO_floatValue(line,chunkPos,2_pInt)
|
||||
|
||||
case ('ncleavage') !
|
||||
Nchunks_CleavageFamilies = chunkPos(1) - 1_pInt
|
||||
do j = 1_pInt, Nchunks_CleavageFamilies
|
||||
|
@ -240,16 +254,14 @@ subroutine source_damage_anisoBrittle_init(fileUnit)
|
|||
min(lattice_NcleavageSystem(1:lattice_maxNcleavageFamily,phase),& ! limit active cleavage systems per family to min of available and requested
|
||||
source_damage_anisoBrittle_Ncleavage(1:lattice_maxNcleavageFamily,instance))
|
||||
source_damage_anisoBrittle_totalNcleavage(instance) = sum(source_damage_anisoBrittle_Ncleavage(:,instance)) ! how many cleavage systems altogether
|
||||
if (source_damage_anisoBrittle_aTol(instance) < 0.0_pReal) &
|
||||
source_damage_anisoBrittle_aTol(instance) = 1.0e-3_pReal ! default absolute tolerance 1e-3
|
||||
if (source_damage_anisoBrittle_sdot_0(instance) <= 0.0_pReal) &
|
||||
call IO_error(211_pInt,el=instance,ext_msg='sdot_0 ('//SOURCE_damage_anisoBrittle_LABEL//')')
|
||||
|
||||
|
||||
if (any(source_damage_anisoBrittle_critDisp(1:Nchunks_CleavageFamilies,instance) < 0.0_pReal)) &
|
||||
call IO_error(211_pInt,el=instance,ext_msg='critical_displacement ('//SOURCE_damage_anisoBrittle_LABEL//')')
|
||||
if (any(source_damage_anisoBrittle_critLoad(1:Nchunks_CleavageFamilies,instance) < 0.0_pReal)) &
|
||||
call IO_error(211_pInt,el=instance,ext_msg='critical_load ('//SOURCE_damage_anisoBrittle_LABEL//')')
|
||||
if (source_damage_anisoBrittle_N(instance) <= 0.0_pReal) &
|
||||
call IO_error(211_pInt,el=instance,ext_msg='rate_sensitivity ('//SOURCE_damage_anisoBrittle_LABEL//')')
|
||||
|
||||
|
||||
endif myPhase
|
||||
enddo sanityChecks
|
||||
|
||||
|
@ -284,7 +296,7 @@ subroutine source_damage_anisoBrittle_init(fileUnit)
|
|||
sourceState(phase)%p(sourceOffset)%sizeDeltaState = sizeDeltaState
|
||||
sourceState(phase)%p(sourceOffset)%sizePostResults = source_damage_anisoBrittle_sizePostResults(instance)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%aTolState (sizeState), &
|
||||
source=source_damage_anisoBrittle_aTol(instance))
|
||||
source=param(instance)%aTol)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%state0 (sizeState,NofMyPhase), source=0.0_pReal)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%partionedState0 (sizeState,NofMyPhase), source=0.0_pReal)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%subState0 (sizeState,NofMyPhase), source=0.0_pReal)
|
||||
|
@ -361,9 +373,9 @@ subroutine source_damage_anisoBrittle_dotState(S, ipc, ip, el)
|
|||
sourceState(phase)%p(sourceOffset)%dotState(1,constituent) = &
|
||||
sourceState(phase)%p(sourceOffset)%dotState(1,constituent) + &
|
||||
source_damage_anisoBrittle_sdot_0(instance)* &
|
||||
((max(0.0_pReal, abs(traction_d) - traction_crit)/traction_crit)**source_damage_anisoBrittle_N(instance) + &
|
||||
(max(0.0_pReal, abs(traction_t) - traction_crit)/traction_crit)**source_damage_anisoBrittle_N(instance) + &
|
||||
(max(0.0_pReal, abs(traction_n) - traction_crit)/traction_crit)**source_damage_anisoBrittle_N(instance))/ &
|
||||
((max(0.0_pReal, abs(traction_d) - traction_crit)/traction_crit)**param(instance)%N + &
|
||||
(max(0.0_pReal, abs(traction_t) - traction_crit)/traction_crit)**param(instance)%N + &
|
||||
(max(0.0_pReal, abs(traction_n) - traction_crit)/traction_crit)**param(instance)%N)/ &
|
||||
source_damage_anisoBrittle_critDisp(f,instance)
|
||||
|
||||
enddo
|
||||
|
|
|
@ -31,15 +31,11 @@ module source_damage_anisoDuctile
|
|||
integer(pInt), dimension(:,:), allocatable, private :: &
|
||||
source_damage_anisoDuctile_Nslip !< number of slip systems per family
|
||||
|
||||
real(pReal), dimension(:), allocatable, private :: &
|
||||
source_damage_anisoDuctile_aTol
|
||||
|
||||
real(pReal), dimension(:,:), allocatable, private :: &
|
||||
source_damage_anisoDuctile_critPlasticStrain
|
||||
|
||||
real(pReal), dimension(:), allocatable, private :: &
|
||||
source_damage_anisoDuctile_sdot_0, &
|
||||
source_damage_anisoDuctile_N
|
||||
source_damage_anisoDuctile_sdot_0
|
||||
|
||||
real(pReal), dimension(:,:), allocatable, private :: &
|
||||
source_damage_anisoDuctile_critLoad
|
||||
|
@ -89,6 +85,8 @@ subroutine source_damage_anisoDuctile_init(fileUnit)
|
|||
compiler_version, &
|
||||
compiler_options
|
||||
#endif
|
||||
use prec, only: &
|
||||
pStringLen
|
||||
use debug, only: &
|
||||
debug_level,&
|
||||
debug_constitutive,&
|
||||
|
@ -132,9 +130,12 @@ subroutine source_damage_anisoDuctile_init(fileUnit)
|
|||
integer(pInt) :: sizeState, sizeDotState, sizeDeltaState
|
||||
integer(pInt) :: NofMyPhase,p
|
||||
integer(pInt) :: Nchunks_SlipFamilies = 0_pInt, j
|
||||
character(len=pStringLen) :: &
|
||||
extmsg = ''
|
||||
character(len=65536) :: &
|
||||
tag = '', &
|
||||
line = ''
|
||||
integer(pInt), dimension(0), parameter :: emptyIntArray = [integer(pInt)::]
|
||||
|
||||
write(6,'(/,a)') ' <<<+- source_'//SOURCE_damage_anisoDuctile_LABEL//' init -+>>>'
|
||||
write(6,'(a15,a)') ' Current time: ',IO_timeStamp()
|
||||
|
@ -167,12 +168,30 @@ subroutine source_damage_anisoDuctile_init(fileUnit)
|
|||
allocate(source_damage_anisoDuctile_critPlasticStrain(lattice_maxNslipFamily,Ninstance),source=0.0_pReal)
|
||||
allocate(source_damage_anisoDuctile_Nslip(lattice_maxNslipFamily,Ninstance), source=0_pInt)
|
||||
allocate(source_damage_anisoDuctile_totalNslip(Ninstance), source=0_pInt)
|
||||
allocate(source_damage_anisoDuctile_N(Ninstance), source=0.0_pReal)
|
||||
allocate(source_damage_anisoDuctile_sdot_0(Ninstance), source=0.0_pReal)
|
||||
allocate(source_damage_anisoDuctile_aTol(Ninstance), source=0.0_pReal)
|
||||
|
||||
allocate(param(Ninstance))
|
||||
|
||||
do p=1, size(config_phase)
|
||||
if (all(phase_source(:,p) /= SOURCE_damage_anisoDuctile_ID)) cycle
|
||||
if (all(phase_source(:,p) /= SOURCE_DAMAGE_ANISODUCTILE_ID)) cycle
|
||||
associate(prm => param(source_damage_anisoDuctile_instance(p)), &
|
||||
config => config_phase(p))
|
||||
|
||||
prm%aTol = config%getFloat('anisoductile_atol',defaultVal = 1.0e-3_pReal)
|
||||
|
||||
prm%N = config%getFloat('anisoductile_ratesensitivity')
|
||||
prm%sdot_0 = config%getFloat('anisoductile_sdot0')
|
||||
|
||||
! sanity checks
|
||||
if (prm%aTol < 0.0_pReal) extmsg = trim(extmsg)//' anisoductile_atol'
|
||||
|
||||
if (prm%N <= 0.0_pReal) extmsg = trim(extmsg)//' anisoductile_ratesensitivity'
|
||||
if (prm%sdot_0 <= 0.0_pReal) extmsg = trim(extmsg)//' anisoductile_sdot0'
|
||||
|
||||
prm%Nslip = config%getInts('nslip',defaultVal=emptyIntArray)
|
||||
|
||||
end associate
|
||||
|
||||
enddo
|
||||
|
||||
rewind(fileUnit)
|
||||
|
@ -206,9 +225,6 @@ subroutine source_damage_anisoDuctile_init(fileUnit)
|
|||
IO_lc(IO_stringValue(line,chunkPos,2_pInt))
|
||||
end select
|
||||
|
||||
case ('anisoductile_atol')
|
||||
source_damage_anisoDuctile_aTol(instance) = IO_floatValue(line,chunkPos,2_pInt)
|
||||
|
||||
case ('nslip') !
|
||||
Nchunks_SlipFamilies = chunkPos(1) - 1_pInt
|
||||
do j = 1_pInt, Nchunks_SlipFamilies
|
||||
|
@ -223,9 +239,6 @@ subroutine source_damage_anisoDuctile_init(fileUnit)
|
|||
source_damage_anisoDuctile_critPlasticStrain(j,instance) = IO_floatValue(line,chunkPos,1_pInt+j)
|
||||
enddo
|
||||
|
||||
case ('anisoductile_ratesensitivity')
|
||||
source_damage_anisoDuctile_N(instance) = IO_floatValue(line,chunkPos,2_pInt)
|
||||
|
||||
case ('anisoductile_criticalload')
|
||||
do j = 1_pInt, Nchunks_SlipFamilies
|
||||
source_damage_anisoDuctile_critLoad(j,instance) = IO_floatValue(line,chunkPos,1_pInt+j)
|
||||
|
@ -244,14 +257,10 @@ subroutine source_damage_anisoDuctile_init(fileUnit)
|
|||
min(lattice_NslipSystem(1:lattice_maxNslipFamily,phase),& ! limit active cleavage systems per family to min of available and requested
|
||||
source_damage_anisoDuctile_Nslip(1:lattice_maxNslipFamily,instance))
|
||||
source_damage_anisoDuctile_totalNslip(instance) = sum(source_damage_anisoDuctile_Nslip(:,instance))
|
||||
if (source_damage_anisoDuctile_aTol(instance) < 0.0_pReal) &
|
||||
source_damage_anisoDuctile_aTol(instance) = 1.0e-3_pReal ! default absolute tolerance 1e-3
|
||||
if (source_damage_anisoDuctile_sdot_0(instance) <= 0.0_pReal) &
|
||||
call IO_error(211_pInt,el=instance,ext_msg='sdot_0 ('//SOURCE_damage_anisoDuctile_LABEL//')')
|
||||
|
||||
if (any(source_damage_anisoDuctile_critPlasticStrain(:,instance) < 0.0_pReal)) &
|
||||
call IO_error(211_pInt,el=instance,ext_msg='criticaPlasticStrain ('//SOURCE_damage_anisoDuctile_LABEL//')')
|
||||
if (source_damage_anisoDuctile_N(instance) <= 0.0_pReal) &
|
||||
call IO_error(211_pInt,el=instance,ext_msg='rate_sensitivity ('//SOURCE_damage_anisoDuctile_LABEL//')')
|
||||
|
||||
endif myPhase
|
||||
enddo sanityChecks
|
||||
|
||||
|
@ -286,7 +295,7 @@ subroutine source_damage_anisoDuctile_init(fileUnit)
|
|||
sourceState(phase)%p(sourceOffset)%sizeDeltaState = sizeDeltaState
|
||||
sourceState(phase)%p(sourceOffset)%sizePostResults = source_damage_anisoDuctile_sizePostResults(instance)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%aTolState (sizeState), &
|
||||
source=source_damage_anisoDuctile_aTol(instance))
|
||||
source=param(instance)%aTol)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%state0 (sizeState,NofMyPhase), source=0.0_pReal)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%partionedState0 (sizeState,NofMyPhase), source=0.0_pReal)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%subState0 (sizeState,NofMyPhase), source=0.0_pReal)
|
||||
|
@ -349,7 +358,7 @@ subroutine source_damage_anisoDuctile_dotState(ipc, ip, el)
|
|||
sourceState(phase)%p(sourceOffset)%dotState(1,constituent) = &
|
||||
sourceState(phase)%p(sourceOffset)%dotState(1,constituent) + &
|
||||
plasticState(phase)%slipRate(index,constituent)/ &
|
||||
((damage(homog)%p(damageOffset))**source_damage_anisoDuctile_N(instance))/ &
|
||||
((damage(homog)%p(damageOffset))**param(instance)%N)/ &
|
||||
source_damage_anisoDuctile_critPlasticStrain(f,instance)
|
||||
|
||||
index = index + 1_pInt
|
||||
|
|
|
@ -26,8 +26,6 @@ module source_damage_isoBrittle
|
|||
source_damage_isoBrittle_Noutput !< number of outputs per instance of this damage
|
||||
|
||||
real(pReal), dimension(:), allocatable, private :: &
|
||||
source_damage_isoBrittle_aTol, &
|
||||
source_damage_isoBrittle_N, &
|
||||
source_damage_isoBrittle_critStrainEnergy
|
||||
|
||||
enum, bind(c)
|
||||
|
@ -68,6 +66,8 @@ subroutine source_damage_isoBrittle_init(fileUnit)
|
|||
compiler_version, &
|
||||
compiler_options
|
||||
#endif
|
||||
use prec, only: &
|
||||
pStringLen
|
||||
use debug, only: &
|
||||
debug_level,&
|
||||
debug_constitutive,&
|
||||
|
@ -107,6 +107,8 @@ subroutine source_damage_isoBrittle_init(fileUnit)
|
|||
integer(pInt) :: Ninstance,mySize=0_pInt,phase,instance,source,sourceOffset,o
|
||||
integer(pInt) :: sizeState, sizeDotState, sizeDeltaState
|
||||
integer(pInt) :: NofMyPhase,p
|
||||
character(len=pStringLen) :: &
|
||||
extmsg = ''
|
||||
character(len=65536) :: &
|
||||
tag = '', &
|
||||
line = ''
|
||||
|
@ -139,11 +141,27 @@ subroutine source_damage_isoBrittle_init(fileUnit)
|
|||
allocate(source_damage_isoBrittle_Noutput(Ninstance), source=0_pInt)
|
||||
|
||||
allocate(source_damage_isoBrittle_critStrainEnergy(Ninstance), source=0.0_pReal)
|
||||
allocate(source_damage_isoBrittle_N(Ninstance), source=1.0_pReal)
|
||||
allocate(source_damage_isoBrittle_aTol(Ninstance), source=0.0_pReal)
|
||||
|
||||
allocate(param(Ninstance))
|
||||
|
||||
do p=1, size(config_phase)
|
||||
if (all(phase_source(:,p) /= SOURCE_damage_isoBrittle_ID)) cycle
|
||||
if (all(phase_source(:,p) /= SOURCE_DAMAGE_ISOBRITTLE_ID)) cycle
|
||||
associate(prm => param(source_damage_isoBrittle_instance(p)), &
|
||||
config => config_phase(p))
|
||||
|
||||
prm%aTol = config%getFloat('isobrittle_atol',defaultVal = 1.0e-3_pReal)
|
||||
|
||||
prm%N = config%getFloat('isobrittle_n')
|
||||
prm%critStrainEnergy = config%getFloat('isobrittle_criticalstrainenergy')
|
||||
|
||||
! sanity checks
|
||||
if (prm%aTol < 0.0_pReal) extmsg = trim(extmsg)//' isobrittle_atol'
|
||||
|
||||
if (prm%N <= 0.0_pReal) extmsg = trim(extmsg)//' isobrittle_n'
|
||||
if (prm%critStrainEnergy <= 0.0_pReal) extmsg = trim(extmsg)//' isobrittle_criticalstrainenergy'
|
||||
|
||||
end associate
|
||||
|
||||
enddo
|
||||
|
||||
rewind(fileUnit)
|
||||
|
@ -180,29 +198,11 @@ subroutine source_damage_isoBrittle_init(fileUnit)
|
|||
case ('isobrittle_criticalstrainenergy')
|
||||
source_damage_isoBrittle_critStrainEnergy(instance) = IO_floatValue(line,chunkPos,2_pInt)
|
||||
|
||||
case ('isobrittle_n')
|
||||
source_damage_isoBrittle_N(instance) = IO_floatValue(line,chunkPos,2_pInt)
|
||||
|
||||
case ('isobrittle_atol')
|
||||
source_damage_isoBrittle_aTol(instance) = IO_floatValue(line,chunkPos,2_pInt)
|
||||
|
||||
end select
|
||||
endif; endif
|
||||
enddo parsingFile
|
||||
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
! sanity checks
|
||||
sanityChecks: do phase = 1_pInt, material_Nphase
|
||||
myPhase: if (any(phase_source(:,phase) == SOURCE_damage_isoBrittle_ID)) then
|
||||
instance = source_damage_isoBrittle_instance(phase)
|
||||
if (source_damage_isoBrittle_aTol(instance) < 0.0_pReal) &
|
||||
source_damage_isoBrittle_aTol(instance) = 1.0e-3_pReal ! default absolute tolerance 1e-3
|
||||
if (source_damage_isoBrittle_critStrainEnergy(instance) <= 0.0_pReal) &
|
||||
call IO_error(211_pInt,el=instance,ext_msg='criticalStrainEnergy ('//SOURCE_damage_isoBrittle_LABEL//')')
|
||||
endif myPhase
|
||||
enddo sanityChecks
|
||||
|
||||
initializeInstances: do phase = 1_pInt, material_Nphase
|
||||
if (any(phase_source(:,phase) == SOURCE_damage_isoBrittle_ID)) then
|
||||
NofMyPhase=count(material_phase==phase)
|
||||
|
@ -231,7 +231,7 @@ subroutine source_damage_isoBrittle_init(fileUnit)
|
|||
sourceState(phase)%p(sourceOffset)%sizeDeltaState = sizeDeltaState
|
||||
sourceState(phase)%p(sourceOffset)%sizePostResults = source_damage_isoBrittle_sizePostResults(instance)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%aTolState (sizeState), &
|
||||
source=source_damage_isoBrittle_aTol(instance))
|
||||
source=param(instance)%aTol)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%state0 (sizeState,NofMyPhase), source=.0_pReal)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%partionedState0 (sizeState,NofMyPhase), source=0.0_pReal)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%subState0 (sizeState,NofMyPhase), source=0.0_pReal)
|
||||
|
@ -330,10 +330,10 @@ subroutine source_damage_isoBrittle_getRateAndItsTangent(localphiDot, dLocalphiD
|
|||
instance = source_damage_isoBrittle_instance(phase)
|
||||
sourceOffset = source_damage_isoBrittle_offset(phase)
|
||||
|
||||
localphiDot = (1.0_pReal - phi)**(source_damage_isoBrittle_N(instance) - 1.0_pReal) - &
|
||||
localphiDot = (1.0_pReal - phi)**(param(instance)%N - 1.0_pReal) - &
|
||||
phi*sourceState(phase)%p(sourceOffset)%state(1,constituent)
|
||||
dLocalphiDot_dPhi = - (source_damage_isoBrittle_N(instance) - 1.0_pReal)* &
|
||||
(1.0_pReal - phi)**max(0.0_pReal,source_damage_isoBrittle_N(instance) - 2.0_pReal) &
|
||||
dLocalphiDot_dPhi = - (param(instance)%N - 1.0_pReal)* &
|
||||
(1.0_pReal - phi)**max(0.0_pReal,param(instance)%N - 2.0_pReal) &
|
||||
- sourceState(phase)%p(sourceOffset)%state(1,constituent)
|
||||
|
||||
end subroutine source_damage_isoBrittle_getRateAndItsTangent
|
||||
|
|
|
@ -26,9 +26,7 @@ module source_damage_isoDuctile
|
|||
source_damage_isoDuctile_Noutput !< number of outputs per instance of this damage
|
||||
|
||||
real(pReal), dimension(:), allocatable, private :: &
|
||||
source_damage_isoDuctile_aTol, &
|
||||
source_damage_isoDuctile_critPlasticStrain, &
|
||||
source_damage_isoDuctile_N
|
||||
source_damage_isoDuctile_critPlasticStrain
|
||||
|
||||
enum, bind(c)
|
||||
enumerator :: undefined_ID, &
|
||||
|
@ -68,6 +66,8 @@ subroutine source_damage_isoDuctile_init(fileUnit)
|
|||
compiler_version, &
|
||||
compiler_options
|
||||
#endif
|
||||
use prec, only: &
|
||||
pStringLen
|
||||
use debug, only: &
|
||||
debug_level,&
|
||||
debug_constitutive,&
|
||||
|
@ -108,6 +108,8 @@ subroutine source_damage_isoDuctile_init(fileUnit)
|
|||
integer(pInt) :: Ninstance,mySize=0_pInt,phase,instance,source,sourceOffset,o
|
||||
integer(pInt) :: sizeState, sizeDotState, sizeDeltaState
|
||||
integer(pInt) :: NofMyPhase,p
|
||||
character(len=pStringLen) :: &
|
||||
extmsg = ''
|
||||
character(len=65536) :: &
|
||||
tag = '', &
|
||||
line = ''
|
||||
|
@ -140,11 +142,27 @@ subroutine source_damage_isoDuctile_init(fileUnit)
|
|||
allocate(source_damage_isoDuctile_Noutput(Ninstance), source=0_pInt)
|
||||
|
||||
allocate(source_damage_isoDuctile_critPlasticStrain(Ninstance), source=0.0_pReal)
|
||||
allocate(source_damage_isoDuctile_N(Ninstance), source=0.0_pReal)
|
||||
allocate(source_damage_isoDuctile_aTol(Ninstance), source=0.0_pReal)
|
||||
|
||||
allocate(param(Ninstance))
|
||||
|
||||
do p=1, size(config_phase)
|
||||
if (all(phase_source(:,p) /= SOURCE_damage_isoDuctile_ID)) cycle
|
||||
if (all(phase_source(:,p) /= SOURCE_DAMAGE_ISODUCTILE_ID)) cycle
|
||||
associate(prm => param(source_damage_isoDuctile_instance(p)), &
|
||||
config => config_phase(p))
|
||||
|
||||
prm%aTol = config%getFloat('isoductile_atol',defaultVal = 1.0e-3_pReal)
|
||||
|
||||
prm%N = config%getFloat('isoductile_ratesensitivity')
|
||||
prm%critPlasticStrain = config%getFloat('isoductile_criticalplasticstrain')
|
||||
|
||||
! sanity checks
|
||||
if (prm%aTol < 0.0_pReal) extmsg = trim(extmsg)//' isoductile_atol'
|
||||
|
||||
if (prm%N <= 0.0_pReal) extmsg = trim(extmsg)//' isoductile_ratesensitivity'
|
||||
if (prm%critPlasticStrain <= 0.0_pReal) extmsg = trim(extmsg)//' isoductile_criticalplasticstrain'
|
||||
|
||||
end associate
|
||||
|
||||
enddo
|
||||
|
||||
rewind(fileUnit)
|
||||
|
@ -181,29 +199,10 @@ subroutine source_damage_isoDuctile_init(fileUnit)
|
|||
case ('isoductile_criticalplasticstrain')
|
||||
source_damage_isoDuctile_critPlasticStrain(instance) = IO_floatValue(line,chunkPos,2_pInt)
|
||||
|
||||
case ('isoductile_ratesensitivity')
|
||||
source_damage_isoDuctile_N(instance) = IO_floatValue(line,chunkPos,2_pInt)
|
||||
|
||||
case ('isoductile_atol')
|
||||
source_damage_isoDuctile_aTol(instance) = IO_floatValue(line,chunkPos,2_pInt)
|
||||
|
||||
end select
|
||||
endif; endif
|
||||
enddo parsingFile
|
||||
|
||||
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
! sanity checks
|
||||
sanityChecks: do phase = 1_pInt, material_Nphase
|
||||
myPhase: if (any(phase_source(:,phase) == SOURCE_damage_isoDuctile_ID)) then
|
||||
instance = source_damage_isoDuctile_instance(phase)
|
||||
if (source_damage_isoDuctile_aTol(instance) < 0.0_pReal) &
|
||||
source_damage_isoDuctile_aTol(instance) = 1.0e-3_pReal ! default absolute tolerance 1e-3
|
||||
if (source_damage_isoDuctile_critPlasticStrain(instance) <= 0.0_pReal) &
|
||||
call IO_error(211_pInt,el=instance,ext_msg='critical plastic strain ('//SOURCE_damage_isoDuctile_LABEL//')')
|
||||
endif myPhase
|
||||
enddo sanityChecks
|
||||
|
||||
initializeInstances: do phase = 1_pInt, material_Nphase
|
||||
if (any(phase_source(:,phase) == SOURCE_damage_isoDuctile_ID)) then
|
||||
NofMyPhase=count(material_phase==phase)
|
||||
|
@ -232,7 +231,7 @@ subroutine source_damage_isoDuctile_init(fileUnit)
|
|||
sourceState(phase)%p(sourceOffset)%sizeDeltaState = sizeDeltaState
|
||||
sourceState(phase)%p(sourceOffset)%sizePostResults = source_damage_isoDuctile_sizePostResults(instance)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%aTolState (sizeState), &
|
||||
source=source_damage_isoDuctile_aTol(instance))
|
||||
source=param(instance)%aTol)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%state0 (sizeState,NofMyPhase), source=.0_pReal)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%partionedState0 (sizeState,NofMyPhase), source=0.0_pReal)
|
||||
allocate(sourceState(phase)%p(sourceOffset)%subState0 (sizeState,NofMyPhase), source=0.0_pReal)
|
||||
|
@ -283,7 +282,7 @@ subroutine source_damage_isoDuctile_dotState(ipc, ip, el)
|
|||
|
||||
sourceState(phase)%p(sourceOffset)%dotState(1,constituent) = &
|
||||
sum(plasticState(phase)%slipRate(:,constituent))/ &
|
||||
((damage(homog)%p(damageOffset))**source_damage_isoDuctile_N(instance))/ &
|
||||
((damage(homog)%p(damageOffset))**param(instance)%N)/ &
|
||||
source_damage_isoDuctile_critPlasticStrain(instance)
|
||||
|
||||
end subroutine source_damage_isoDuctile_dotState
|
||||
|
|
Loading…
Reference in New Issue