From 9cc20ad751651466ddbb9176667625b779b493f2 Mon Sep 17 00:00:00 2001 From: Pratheek Shanthraj Date: Fri, 4 Jul 2014 08:26:59 +0000 Subject: [PATCH] fixed bug in counting outputs and changed damage formulation --- code/damage_gradient.f90 | 19 ++++++------------- code/thermal_adiabatic.f90 | 2 +- code/thermal_conduction.f90 | 6 +++--- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/code/damage_gradient.f90 b/code/damage_gradient.f90 index 71de21a09..4684e706b 100644 --- a/code/damage_gradient.f90 +++ b/code/damage_gradient.f90 @@ -25,7 +25,7 @@ module damage_gradient integer(pInt), dimension(:), allocatable, private :: & damage_gradient_Noutput !< number of outputs per instance of this damage - real(pReal), dimension(:), allocatable, private :: & + real(pReal), dimension(:), allocatable, public :: & damage_gradient_crack_mobility enum, bind(c) @@ -143,13 +143,13 @@ subroutine damage_gradient_init(fileUnit) case ('(output)') select case(IO_lc(IO_stringValue(line,positions,2_pInt))) case ('local_damage') - damage_gradient_outputID(damage_gradient_Noutput(instance),instance) = local_damage_ID damage_gradient_Noutput(instance) = damage_gradient_Noutput(instance) + 1_pInt + damage_gradient_outputID(damage_gradient_Noutput(instance),instance) = local_damage_ID damage_gradient_output(damage_gradient_Noutput(instance),instance) = & IO_lc(IO_stringValue(line,positions,2_pInt)) case ('gradient_damage') - damage_gradient_outputID(damage_gradient_Noutput(instance),instance) = gradient_damage_ID damage_gradient_Noutput(instance) = damage_gradient_Noutput(instance) + 1_pInt + damage_gradient_outputID(damage_gradient_Noutput(instance),instance) = gradient_damage_ID damage_gradient_output(damage_gradient_Noutput(instance),instance) = & IO_lc(IO_stringValue(line,positions,2_pInt)) end select @@ -245,7 +245,7 @@ subroutine damage_gradient_aTolState(phase,instance) instance ! number specifying the current instance of the damage real(pReal), dimension(damageState(phase)%sizeState) :: tempTol - tempTol = 0.0_pReal + tempTol = 1.0_pReal damageState(phase)%aTolState = tempTol end subroutine damage_gradient_aTolState @@ -257,15 +257,11 @@ subroutine damage_gradient_microstructure(Tstar_v, Fe, ipc, ip, el) mappingConstitutive, & phase_damageInstance, & damageState - use numerics, only: & - charLength use math, only: & math_Mandel6to33, & math_mul33x33, & math_transpose33, & math_I3 - use lattice, only: & - lattice_surfaceEnergy33 implicit none integer(pInt), intent(in) :: & @@ -287,11 +283,8 @@ subroutine damage_gradient_microstructure(Tstar_v, Fe, ipc, ip, el) damage = damageState(phase)%state(3,constituent)*damageState(phase)%state(3,constituent) damageState(phase)%state(2,constituent) = & - min(1.0_pReal, & - 2.0_pReal*charLength*maxval(lattice_surfaceEnergy33(1:3,1:3,phase))/ & - (0.125_pReal*sum(math_Mandel6to33(Tstar_v/damage)*(math_mul33x33(math_transpose33(Fe),Fe)-math_I3)) + & - 0.5_pReal*damageState(phase)%state(1,constituent)) & - ) + 0.5_pReal*sum(math_Mandel6to33(Tstar_v/damage)*(math_mul33x33(math_transpose33(Fe),Fe)-math_I3)) - & + 0.5_pReal*damageState(phase)%state(1,constituent) end subroutine damage_gradient_microstructure diff --git a/code/thermal_adiabatic.f90 b/code/thermal_adiabatic.f90 index 2b598b726..0fa907bb1 100644 --- a/code/thermal_adiabatic.f90 +++ b/code/thermal_adiabatic.f90 @@ -143,8 +143,8 @@ subroutine thermal_adiabatic_init(fileUnit) case ('(output)') select case(IO_lc(IO_stringValue(line,positions,2_pInt))) case ('temperature') - thermal_adiabatic_outputID(thermal_adiabatic_Noutput(instance),instance) = temperature_ID thermal_adiabatic_Noutput(instance) = thermal_adiabatic_Noutput(instance) + 1_pInt + thermal_adiabatic_outputID(thermal_adiabatic_Noutput(instance),instance) = temperature_ID thermal_adiabatic_output(thermal_adiabatic_Noutput(instance),instance) = & IO_lc(IO_stringValue(line,positions,2_pInt)) end select diff --git a/code/thermal_conduction.f90 b/code/thermal_conduction.f90 index 4789ff097..546a6e4c6 100644 --- a/code/thermal_conduction.f90 +++ b/code/thermal_conduction.f90 @@ -25,7 +25,7 @@ module thermal_conduction integer(pInt), dimension(:), allocatable, private :: & thermal_conduction_Noutput !< number of outputs per instance of this damage - real(pReal), dimension(:), allocatable, private :: & + real(pReal), dimension(:), allocatable, public :: & thermal_conduction_specific_heat, & thermal_conduction_density @@ -143,8 +143,8 @@ subroutine thermal_conduction_init(fileUnit) case ('(output)') select case(IO_lc(IO_stringValue(line,positions,2_pInt))) case ('temperature') - thermal_conduction_outputID(thermal_conduction_Noutput(instance),instance) = temperature_ID thermal_conduction_Noutput(instance) = thermal_conduction_Noutput(instance) + 1_pInt + thermal_conduction_outputID(thermal_conduction_Noutput(instance),instance) = temperature_ID thermal_conduction_output(thermal_conduction_Noutput(instance),instance) = & IO_lc(IO_stringValue(line,positions,2_pInt)) end select @@ -242,7 +242,7 @@ subroutine thermal_conduction_aTolState(phase,instance) instance ! number specifying the current instance of the thermal real(pReal), dimension(thermalState(phase)%sizeState) :: tempTol - tempTol = 0.0_pReal + tempTol = 1.0_pReal thermalState(phase)%aTolState = tempTol end subroutine thermal_conduction_aTolState