added some sanity checks in damage modules.

This commit is contained in:
Luv Sharma 2014-11-20 13:48:07 +00:00
parent 1e4beb08ac
commit 36c2cc4347
4 changed files with 78 additions and 7 deletions

View File

@ -108,7 +108,8 @@ subroutine damage_anisoBrittle_init(fileUnit)
worldrank, & worldrank, &
numerics_integrator numerics_integrator
use lattice, only: & use lattice, only: &
lattice_maxNcleavageFamily lattice_maxNcleavageFamily, &
lattice_NcleavageSystem
implicit none implicit none
integer(pInt), intent(in) :: fileUnit integer(pInt), intent(in) :: fileUnit
@ -199,7 +200,6 @@ subroutine damage_anisoBrittle_init(fileUnit)
do j = 1_pInt, Nchunks_CleavageFamilies do j = 1_pInt, Nchunks_CleavageFamilies
damage_anisoBrittle_Ncleavage(j,instance) = IO_intValue(line,positions,1_pInt+j) damage_anisoBrittle_Ncleavage(j,instance) = IO_intValue(line,positions,1_pInt+j)
enddo enddo
damage_anisoBrittle_totalNcleavage(instance) = sum(damage_anisoBrittle_Ncleavage(:,instance))
case ('critical_displacement') case ('critical_displacement')
do j = 1_pInt, Nchunks_CleavageFamilies do j = 1_pInt, Nchunks_CleavageFamilies
@ -215,6 +215,30 @@ subroutine damage_anisoBrittle_init(fileUnit)
endif; endif endif; endif
enddo parsingFile enddo parsingFile
sanityChecks: do phase = 1_pInt, size(phase_damage)
myPhase: if (phase_damage(phase) == LOCAL_damage_anisoBrittle_ID) then
NofMyPhase=count(material_phase==phase)
instance = phase_damageInstance(phase)
! sanity checks
damage_anisoBrittle_Ncleavage(1:lattice_maxNcleavageFamily,instance) = &
min(lattice_NcleavageSystem(1:lattice_maxNcleavageFamily,phase),& ! limit active cleavage systems per family to min of available and requested
damage_anisoBrittle_Ncleavage(1:lattice_maxNcleavageFamily,instance))
damage_anisoBrittle_totalNcleavage(instance) = sum(damage_anisoBrittle_Ncleavage(:,instance)) ! how many cleavage systems altogether
if (damage_anisoBrittle_aTol_damage(instance) >= 1.0e-3_pReal) &
damage_anisoBrittle_aTol_damage(instance) = 1.0e-3_pReal ! default absolute tolerance 1e-3
if (damage_anisoBrittle_aTol_disp(instance) >= 1.0e-3_pReal) &
damage_anisoBrittle_aTol_disp(instance) = 1.0e-3_pReal ! default absolute tolerance 1e-3
if (damage_anisoBrittle_sdot_0(instance) <= 0.0_pReal) &
call IO_error(211_pInt,el=instance,ext_msg='sdot_0 ('//LOCAL_DAMAGE_anisoBrittle_LABEL//')')
if (any(damage_anisoBrittle_critDisp(:,instance) <= 0.0_pReal)) &
call IO_error(211_pInt,el=instance,ext_msg='critical_displacement ('//LOCAL_DAMAGE_anisoBrittle_LABEL//')')
if (any(damage_anisoBrittle_critLoad(:,instance) <= 0.0_pReal)) &
call IO_error(211_pInt,el=instance,ext_msg='critical_load ('//LOCAL_DAMAGE_anisoBrittle_LABEL//')')
if (damage_anisoBrittle_N(instance) <= 0.0_pReal) &
call IO_error(211_pInt,el=instance,ext_msg='rate_sensitivity_damage ('//LOCAL_DAMAGE_anisoBrittle_LABEL//')')
endif myPhase
enddo sanityChecks
initializeInstances: do phase = 1_pInt, size(phase_damage) initializeInstances: do phase = 1_pInt, size(phase_damage)
if (phase_damage(phase) == LOCAL_damage_anisoBrittle_ID) then if (phase_damage(phase) == LOCAL_damage_anisoBrittle_ID) then
NofMyPhase=count(material_phase==phase) NofMyPhase=count(material_phase==phase)

View File

@ -101,7 +101,8 @@ subroutine damage_anisoDuctile_init(fileUnit)
worldrank, & worldrank, &
numerics_integrator numerics_integrator
use lattice, only: & use lattice, only: &
lattice_maxNslipFamily lattice_maxNslipFamily, &
lattice_NslipSystem
implicit none implicit none
integer(pInt), intent(in) :: fileUnit integer(pInt), intent(in) :: fileUnit
@ -183,7 +184,6 @@ subroutine damage_anisoDuctile_init(fileUnit)
do j = 1_pInt, Nchunks_SlipFamilies do j = 1_pInt, Nchunks_SlipFamilies
damage_anisoDuctile_Nslip(j,instance) = IO_intValue(line,positions,1_pInt+j) damage_anisoDuctile_Nslip(j,instance) = IO_intValue(line,positions,1_pInt+j)
enddo enddo
damage_anisoDuctile_totalNslip(instance) = sum(damage_anisoDuctile_Nslip(:,instance))
case ('critical_accshear') case ('critical_accshear')
do j = 1_pInt, Nchunks_SlipFamilies do j = 1_pInt, Nchunks_SlipFamilies
@ -194,6 +194,25 @@ subroutine damage_anisoDuctile_init(fileUnit)
endif; endif endif; endif
enddo parsingFile enddo parsingFile
sanityChecks: do phase = 1_pInt, size(phase_damage)
myPhase: if (phase_damage(phase) == LOCAL_damage_anisoDuctile_ID) then
NofMyPhase=count(material_phase==phase)
instance = phase_damageInstance(phase)
! sanity checks
damage_anisoDuctile_Nslip(1:lattice_maxNslipFamily,instance) = &
min(lattice_NslipSystem(1:lattice_maxNslipFamily,phase),& ! limit active cleavage systems per family to min of available and requested
damage_anisoDuctile_Nslip(1:lattice_maxNslipFamily,instance))
damage_anisoDuctile_totalNslip(instance) = sum(damage_anisoDuctile_Nslip(:,instance))
if (damage_anisoDuctile_aTol_damage(instance) >= 1.0e-3_pReal) &
damage_anisoDuctile_aTol_damage(instance) = 1.0e-3_pReal ! default absolute tolerance 1e-3
if (any(damage_anisoDuctile_critAccShear(:,instance) <= 0.0_pReal)) &
call IO_error(211_pInt,el=instance,ext_msg='critical_accshear ('//LOCAL_DAMAGE_anisoDuctile_LABEL//')')
if (damage_anisoDuctile_N(instance) <= 0.0_pReal) &
call IO_error(211_pInt,el=instance,ext_msg='rate_sensitivity_damage ('//LOCAL_DAMAGE_anisoDuctile_LABEL//')')
endif myPhase
enddo sanityChecks
initializeInstances: do phase = 1_pInt, size(phase_damage) initializeInstances: do phase = 1_pInt, size(phase_damage)
if (phase_damage(phase) == LOCAL_damage_anisoDuctile_ID) then if (phase_damage(phase) == LOCAL_damage_anisoDuctile_ID) then
NofMyPhase=count(material_phase==phase) NofMyPhase=count(material_phase==phase)

View File

@ -173,11 +173,25 @@ subroutine damage_isoBrittle_init(fileUnit)
endif; endif endif; endif
enddo parsingFile enddo parsingFile
sanityChecks: do phase = 1_pInt, size(phase_damage)
myPhase: if (phase_damage(phase) == LOCAL_damage_isoBrittle_ID) then
NofMyPhase=count(material_phase==phase)
instance = phase_damageInstance(phase)
! sanity checks
if (damage_isoBrittle_aTol(instance) >= 1.0e-3_pReal) &
damage_isoBrittle_aTol(instance) = 1.0e-3_pReal ! default absolute tolerance 1e-3
if (damage_isoBrittle_critStrainEnergy(instance) <= 0.0_pReal) &
call IO_error(211_pInt,el=instance,ext_msg='critical_strain_energy ('//LOCAL_DAMAGE_isoBrittle_LABEL//')')
if (damage_isoBrittle_N(instance) <= 0.0_pReal) &
call IO_error(211_pInt,el=instance,ext_msg='rate_sensitivity_damage ('//LOCAL_DAMAGE_isoBrittle_LABEL//')')
endif myPhase
enddo sanityChecks
initializeInstances: do phase = 1_pInt, size(phase_damage) initializeInstances: do phase = 1_pInt, size(phase_damage)
if (phase_damage(phase) == LOCAL_damage_isoBrittle_ID) then if (phase_damage(phase) == LOCAL_damage_isoBrittle_ID) then
NofMyPhase=count(material_phase==phase) NofMyPhase=count(material_phase==phase)
instance = phase_damageInstance(phase) instance = phase_damageInstance(phase)
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! Determine size of postResults array ! Determine size of postResults array
outputsLoop: do o = 1_pInt,damage_isoBrittle_Noutput(instance) outputsLoop: do o = 1_pInt,damage_isoBrittle_Noutput(instance)

View File

@ -172,6 +172,20 @@ subroutine damage_isoDuctile_init(fileUnit)
endif; endif endif; endif
enddo parsingFile enddo parsingFile
sanityChecks: do phase = 1_pInt, size(phase_damage)
myPhase: if (phase_damage(phase) == LOCAL_damage_isoDuctile_ID) then
NofMyPhase=count(material_phase==phase)
instance = phase_damageInstance(phase)
! sanity checks
if (damage_isoDuctile_aTol(instance) >= 1.0e-3_pReal) &
damage_isoDuctile_aTol(instance) = 1.0e-3_pReal ! default absolute tolerance 1e-3
if (damage_isoDuctile_critpStrain(instance) <= 0.0_pReal) &
call IO_error(211_pInt,el=instance,ext_msg='critical_plastic_strain ('//LOCAL_DAMAGE_isoDuctile_LABEL//')')
if (damage_isoDuctile_N(instance) <= 0.0_pReal) &
call IO_error(211_pInt,el=instance,ext_msg='rate_sensitivity_damage ('//LOCAL_DAMAGE_isoDuctile_LABEL//')')
endif myPhase
enddo sanityChecks
initializeInstances: do phase = 1_pInt, size(phase_damage) initializeInstances: do phase = 1_pInt, size(phase_damage)
if (phase_damage(phase) == LOCAL_damage_isoDuctile_ID) then if (phase_damage(phase) == LOCAL_damage_isoDuctile_ID) then
NofMyPhase=count(material_phase==phase) NofMyPhase=count(material_phase==phase)