From 4a445a9f5462e787443284551aa377c133fbbfcb Mon Sep 17 00:00:00 2001
From: Pratheek Shanthraj
Date: Thu, 16 Oct 2014 01:50:47 +0000
Subject: [PATCH] fracture strain energy and plastic strain indexed by instance
and not phase
---
code/damage_brittle.f90 | 7 ++++---
code/damage_ductile.f90 | 9 +++++----
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/code/damage_brittle.f90 b/code/damage_brittle.f90
index 05537d218..398321a27 100644
--- a/code/damage_brittle.f90
+++ b/code/damage_brittle.f90
@@ -307,16 +307,17 @@ subroutine damage_brittle_microstructure(Tstar_v, Fe, ipc, ip, el)
real(pReal), intent(in), dimension(3,3) :: &
Fe
integer(pInt) :: &
- phase, constituent
+ phase, constituent, instance
real(pReal) :: &
strain(3,3)
phase = mappingConstitutive(2,ipc,ip,el)
constituent = mappingConstitutive(1,ipc,ip,el)
- strain = 0.5_pReal*(math_mul33x33(math_transpose33(Fe),Fe)-math_I3)
+ instance = phase_damageInstance(phase)
+ strain = 0.5_pReal*(math_mul33x33(math_transpose33(Fe),Fe)-math_I3)
damageState(phase)%state(2,constituent) = min(damageState(phase)%state(2,constituent), &
- damage_brittle_critStrainEnergy(phase)/ &
+ damage_brittle_critStrainEnergy(instance)/ &
sum(abs(math_Mandel6to33(Tstar_v)*strain)))
end subroutine damage_brittle_microstructure
diff --git a/code/damage_ductile.f90 b/code/damage_ductile.f90
index 9ee245c91..7de493872 100644
--- a/code/damage_ductile.f90
+++ b/code/damage_ductile.f90
@@ -122,7 +122,7 @@ subroutine damage_ductile_init(fileUnit)
damage_ductile_output = ''
allocate(damage_ductile_outputID(maxval(phase_Noutput),maxNinstance), source=undefined_ID)
allocate(damage_ductile_Noutput(maxNinstance), source=0_pInt)
- allocate(damage_ductile_critpStrain(maxNinstance), source=0.0_pReal)
+ allocate(damage_ductile_critpStrain(maxNinstance), source=0.0_pReal)
allocate(damage_ductile_aTol(maxNinstance), source=0.0_pReal)
rewind(fileUnit)
@@ -309,13 +309,14 @@ subroutine damage_ductile_microstructure(nSlip,accumulatedSlip,ipc, ip, el)
real(pReal), dimension(nSlip), intent(in) :: &
accumulatedSlip
integer(pInt) :: &
- phase, constituent
+ phase, constituent, instance
phase = mappingConstitutive(2,ipc,ip,el)
constituent = mappingConstitutive(1,ipc,ip,el)
+ instance = phase_damageInstance(phase)
damageState(phase)%state(2,constituent) = min(damageState(phase)%state(2,constituent), &
- damage_ductile_critpStrain(phase)/ &
- sum(accumulatedSlip)) !< akin to damage surface
+ damage_ductile_critpStrain(instance)/ &
+ sum(accumulatedSlip)) !< akin to damage surface
end subroutine damage_ductile_microstructure