From a1468b2693c80c1c7471e7f4cf9b6702fbda9b0c Mon Sep 17 00:00:00 2001 From: Luv Sharma Date: Fri, 4 Jul 2014 09:22:57 +0000 Subject: [PATCH] for consistency, pushed assignment of sizePostResults from aggregators to individual thermal/damage label. Also fixed wrong index while use of mapping --- code/constitutive.f90 | 2 +- code/constitutive_damage.f90 | 9 --------- code/constitutive_thermal.f90 | 10 +--------- code/damage_gradient.f90 | 1 + code/damage_none.f90 | 1 + code/thermal_adiabatic.f90 | 1 + code/thermal_conduction.f90 | 1 + code/thermal_none.f90 | 1 + 8 files changed, 7 insertions(+), 19 deletions(-) diff --git a/code/constitutive.f90 b/code/constitutive.f90 index e3865f337..b47a8590f 100644 --- a/code/constitutive.f90 +++ b/code/constitutive.f90 @@ -704,7 +704,7 @@ function constitutive_postResults(Tstar_v, FeArray, temperature, ipc, ip, el) ipc, & !< grain number ip, & !< integration point number el !< element number - real(pReal), dimension(plasticState(mappingConstitutive(1,ipc,ip,el))%sizePostResults) :: & + real(pReal), dimension(plasticState(mappingConstitutive(2,ipc,ip,el))%sizePostResults) :: & constitutive_postResults real(pReal), intent(in) :: & temperature diff --git a/code/constitutive_damage.f90 b/code/constitutive_damage.f90 index 1395f726f..c9ead4fc2 100644 --- a/code/constitutive_damage.f90 +++ b/code/constitutive_damage.f90 @@ -120,15 +120,6 @@ use damage_gradient constitutive_damage_maxSizePostResults = 0_pInt constitutive_damage_maxSizeDotState = 0_pInt PhaseLoop:do ph = 1_pInt,material_Nphase ! loop over phases - instance = phase_damageInstance(ph) - select case(phase_damage(ph)) - case (DAMAGE_none_ID) - damageState(ph)%sizePostResults = damage_none_sizePostResults(instance) - - case (DAMAGE_gradient_ID) - damageState(ph)%sizePostResults = damage_gradient_sizePostResults(instance) - - end select constitutive_damage_maxSizeDotState = max(constitutive_damage_maxSizeDotState, damageState(ph)%sizeDotState) constitutive_damage_maxSizePostResults = max(constitutive_damage_maxSizePostResults, damageState(ph)%sizePostResults) enddo PhaseLoop diff --git a/code/constitutive_thermal.f90 b/code/constitutive_thermal.f90 index 37f8f3ab0..f5803115d 100644 --- a/code/constitutive_thermal.f90 +++ b/code/constitutive_thermal.f90 @@ -119,16 +119,8 @@ subroutine constitutive_thermal_init ! allocation of states constitutive_thermal_maxSizePostResults = 0_pInt constitutive_thermal_maxSizeDotState = 0_pInt - PhaseLoop:do ph = 1_pInt,material_Nphase ! loop over phases - instance = phase_thermalInstance(ph) - select case(phase_thermal(ph)) - case (THERMAL_none_ID) - thermalState(ph)%sizePostResults = thermal_none_sizePostResults(instance) - case (THERMAL_conduction_ID) - thermalState(ph)%sizePostResults = thermal_conduction_sizePostResults(instance) - - end select + PhaseLoop:do ph = 1_pInt,material_Nphase ! loop over phases constitutive_thermal_maxSizeDotState = max(constitutive_thermal_maxSizeDotState, thermalState(ph)%sizeDotState) constitutive_thermal_maxSizePostResults = max(constitutive_thermal_maxSizePostResults, thermalState(ph)%sizePostResults) enddo PhaseLoop diff --git a/code/damage_gradient.f90 b/code/damage_gradient.f90 index 4684e706b..3afcc7b39 100644 --- a/code/damage_gradient.f90 +++ b/code/damage_gradient.f90 @@ -186,6 +186,7 @@ subroutine damage_gradient_init(fileUnit) damageState(phase)%sizeState = sizeState damageState(phase)%sizeDotState = sizeDotState + damageState(phase)%sizePostResults = damage_gradient_sizePostResults(instance) allocate(damageState(phase)%aTolState (sizeState), source=0.0_pReal) allocate(damageState(phase)%state0 (sizeState,NofMyPhase), source=0.0_pReal) allocate(damageState(phase)%partionedState0 (sizeState,NofMyPhase), source=0.0_pReal) diff --git a/code/damage_none.f90 b/code/damage_none.f90 index 0f4d54e29..37320cd50 100644 --- a/code/damage_none.f90 +++ b/code/damage_none.f90 @@ -74,6 +74,7 @@ subroutine damage_none_init(fileUnit) damageState(phase)%sizeState = sizeState sizeDotState = sizeState damageState(phase)%sizeDotState = sizeDotState + damageState(phase)%sizePostResults = 0_pInt allocate(damageState(phase)%state0 (sizeState,NofMyPhase)) allocate(damageState(phase)%partionedState0(sizeState,NofMyPhase)) allocate(damageState(phase)%subState0 (sizeState,NofMyPhase)) diff --git a/code/thermal_adiabatic.f90 b/code/thermal_adiabatic.f90 index 0fa907bb1..4fbc31110 100644 --- a/code/thermal_adiabatic.f90 +++ b/code/thermal_adiabatic.f90 @@ -180,6 +180,7 @@ subroutine thermal_adiabatic_init(fileUnit) sizeState = 1_pInt thermalState(phase)%sizeState = sizeState thermalState(phase)%sizeDotState = sizeDotState + thermalState(phase)%sizePostResults = thermal_adiabatic_sizePostResults(instance) allocate(thermalState(phase)%aTolState (sizeState), source=0.0_pReal) allocate(thermalState(phase)%state0 (sizeState,NofMyPhase), source=0.0_pReal) allocate(thermalState(phase)%partionedState0 (sizeState,NofMyPhase), source=0.0_pReal) diff --git a/code/thermal_conduction.f90 b/code/thermal_conduction.f90 index 546a6e4c6..c4eca1a58 100644 --- a/code/thermal_conduction.f90 +++ b/code/thermal_conduction.f90 @@ -181,6 +181,7 @@ subroutine thermal_conduction_init(fileUnit) thermalState(phase)%sizeState = sizeState thermalState(phase)%sizeDotState = sizeDotState + thermalState(phase)%sizePostResults = thermal_conduction_sizePostResults(instance) allocate(thermalState(phase)%aTolState (sizeState), source=0.0_pReal) allocate(thermalState(phase)%state0 (sizeState,NofMyPhase), source=0.0_pReal) allocate(thermalState(phase)%partionedState0 (sizeState,NofMyPhase), source=0.0_pReal) diff --git a/code/thermal_none.f90 b/code/thermal_none.f90 index 82c7859eb..661af9273 100644 --- a/code/thermal_none.f90 +++ b/code/thermal_none.f90 @@ -74,6 +74,7 @@ subroutine thermal_none_init(fileUnit) thermalState(phase)%sizeState = sizeState sizeDotState = sizeState thermalState(phase)%sizeDotState = sizeDotState + thermalState(phase)%sizePostResults = 0_pInt allocate(thermalState(phase)%state0 (sizeState,NofMyPhase)) allocate(thermalState(phase)%partionedState0(sizeState,NofMyPhase)) allocate(thermalState(phase)%subState0 (sizeState,NofMyPhase))