From a42fd0608af5f81673594208cc21af2466000c23 Mon Sep 17 00:00:00 2001
From: Pratheek Shanthraj
Date: Fri, 26 Sep 2014 10:25:26 +0000
Subject: [PATCH] use constitutive_xxx_Noutput instead of phase_Noutput as
number of outputs for more consistency with constitutive multi physics output
---
code/constitutive.f90 | 18 +++++++++++++++---
code/constitutive_dislokmc.f90 | 2 +-
code/constitutive_dislotwin.f90 | 2 +-
code/constitutive_j2.f90 | 2 +-
code/constitutive_nonlocal.f90 | 2 +-
code/constitutive_phenopowerlaw.f90 | 4 +++-
code/constitutive_titanmod.f90 | 2 +-
code/damage_brittle.f90 | 2 +-
8 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/code/constitutive.f90 b/code/constitutive.f90
index d6627283d..10cfbcbb1 100644
--- a/code/constitutive.f90
+++ b/code/constitutive.f90
@@ -139,6 +139,7 @@ subroutine constitutive_init
instance
integer(pInt), dimension(:,:), pointer :: thisSize
+ integer(pInt), dimension(:) , pointer :: thisNoutput
character(len=64), dimension(:,:), pointer :: thisOutput
character(len=32) :: outputName !< name of output, intermediate fix until HDF5 output is ready
logical :: knownPlasticity, knownDamage, knownThermal, nonlocalConstitutionPresent
@@ -190,30 +191,37 @@ subroutine constitutive_init
select case(phase_plasticity(phase)) ! split per constititution
case (PLASTICITY_NONE_ID)
outputName = PLASTICITY_NONE_label
+ thisNoutput => null()
thisOutput => null() ! constitutive_none_output
thisSize => null() ! constitutive_none_sizePostResult
case (PLASTICITY_J2_ID)
outputName = PLASTICITY_J2_label
+ thisNoutput => constitutive_j2_Noutput
thisOutput => constitutive_j2_output
thisSize => constitutive_j2_sizePostResult
case (PLASTICITY_PHENOPOWERLAW_ID)
outputName = PLASTICITY_PHENOPOWERLAW_label
+ thisNoutput => constitutive_phenopowerlaw_Noutput
thisOutput => constitutive_phenopowerlaw_output
thisSize => constitutive_phenopowerlaw_sizePostResult
case (PLASTICITY_DISLOTWIN_ID)
outputName = PLASTICITY_DISLOTWIN_label
+ thisNoutput => constitutive_dislotwin_Noutput
thisOutput => constitutive_dislotwin_output
thisSize => constitutive_dislotwin_sizePostResult
case (PLASTICITY_DISLOKMC_ID)
outputName = PLASTICITY_DISLOKMC_label
+ thisNoutput => constitutive_dislokmc_Noutput
thisOutput => constitutive_dislokmc_output
thisSize => constitutive_dislokmc_sizePostResult
case (PLASTICITY_TITANMOD_ID)
outputName = PLASTICITY_TITANMOD_label
+ thisNoutput => constitutive_titanmod_Noutput
thisOutput => constitutive_titanmod_output
thisSize => constitutive_titanmod_sizePostResult
case (PLASTICITY_NONLOCAL_ID)
outputName = PLASTICITY_NONLOCAL_label
+ thisNoutput => constitutive_nonlocal_Noutput
thisOutput => constitutive_nonlocal_output
thisSize => constitutive_nonlocal_sizePostResult
case default
@@ -223,7 +231,7 @@ subroutine constitutive_init
if (knownPlasticity) then
write(FILEUNIT,'(a)') '(plasticity)'//char(9)//trim(outputName)
if (phase_plasticity(phase) /= PLASTICITY_NONE_ID) then
- do e = 1_pInt,phase_Noutput(phase)
+ do e = 1_pInt,thisNoutput(instance)
write(FILEUNIT,'(a,i4)') trim(thisOutput(e,instance))//char(9),thisSize(e,instance)
enddo
endif
@@ -234,10 +242,12 @@ subroutine constitutive_init
select case(phase_damage(phase)) ! split per constititution
case (LOCAL_DAMAGE_none_ID)
outputName = LOCAL_DAMAGE_NONE_label
+ thisNoutput => null()
thisOutput => null()
thisSize => null()
case (LOCAL_DAMAGE_BRITTLE_ID)
outputName = LOCAL_DAMAGE_BRITTLE_label
+ thisNoutput => damage_brittle_Noutput
thisOutput => damage_brittle_output
thisSize => damage_brittle_sizePostResult
case default
@@ -246,7 +256,7 @@ subroutine constitutive_init
if (knownDamage) then
write(FILEUNIT,'(a)') '(damage)'//char(9)//trim(outputName)
if (phase_damage(phase) /= LOCAL_DAMAGE_none_ID) then
- do e = 1_pInt,phase_Noutput(phase)
+ do e = 1_pInt,thisNoutput(instance)
write(FILEUNIT,'(a,i4)') trim(thisOutput(e,instance))//char(9),thisSize(e,instance)
enddo
endif
@@ -256,10 +266,12 @@ subroutine constitutive_init
select case(phase_thermal(phase)) ! split per constititution
case (LOCAL_THERMAL_none_ID)
outputName = LOCAL_THERMAL_NONE_label
+ thisNoutput => null()
thisOutput => null()
thisSize => null()
case (LOCAL_THERMAL_heatgen_ID)
outputName = LOCAL_THERMAL_HEATGEN_label
+ thisNoutput => null()
thisOutput => null()
thisSize => null()
case default
@@ -268,7 +280,7 @@ subroutine constitutive_init
if (knownThermal) then
write(FILEUNIT,'(a)') '(thermal)'//char(9)//trim(outputName)
if (phase_thermal(phase) /= LOCAL_THERMAL_none_ID) then
- do e = 1_pInt,phase_Noutput(phase)
+ do e = 1_pInt,thisNoutput(instance)
write(FILEUNIT,'(a,i4)') trim(thisOutput(e,instance))//char(9),thisSize(e,instance)
enddo
endif
diff --git a/code/constitutive_dislokmc.f90 b/code/constitutive_dislokmc.f90
index 03fbc3926..85264a61e 100644
--- a/code/constitutive_dislokmc.f90
+++ b/code/constitutive_dislokmc.f90
@@ -43,7 +43,7 @@ module constitutive_dislokmc
real(pReal), parameter, private :: &
kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin
- integer(pInt), dimension(:), allocatable, private :: &
+ integer(pInt), dimension(:), allocatable, target, public :: &
constitutive_dislokmc_Noutput !< number of outputs per instance of this plasticity
integer(pInt), dimension(:), allocatable, private :: &
diff --git a/code/constitutive_dislotwin.f90 b/code/constitutive_dislotwin.f90
index adc5a54b9..3e191f0e0 100644
--- a/code/constitutive_dislotwin.f90
+++ b/code/constitutive_dislotwin.f90
@@ -45,7 +45,7 @@ module constitutive_dislotwin
real(pReal), parameter, private :: &
kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin
- integer(pInt), dimension(:), allocatable, private :: &
+ integer(pInt), dimension(:), allocatable, target, public :: &
constitutive_dislotwin_Noutput !< number of outputs per instance of this plasticity
integer(pInt), dimension(:), allocatable, private :: &
diff --git a/code/constitutive_j2.f90 b/code/constitutive_j2.f90
index 04a1ae7af..1f71410c3 100644
--- a/code/constitutive_j2.f90
+++ b/code/constitutive_j2.f90
@@ -29,7 +29,7 @@ module constitutive_j2
character(len=64), dimension(:,:), allocatable, target, public :: &
constitutive_j2_output !< name of each post result output
- integer(pInt), dimension(:), allocatable, private :: &
+ integer(pInt), dimension(:), allocatable, target, public :: &
constitutive_j2_Noutput !< number of outputs per instance
real(pReal), dimension(:), allocatable, private :: &
constitutive_j2_fTaylor, & !< Taylor factor
diff --git a/code/constitutive_nonlocal.f90 b/code/constitutive_nonlocal.f90
index eeeca2027..982925168 100644
--- a/code/constitutive_nonlocal.f90
+++ b/code/constitutive_nonlocal.f90
@@ -55,7 +55,7 @@ module constitutive_nonlocal
character(len=64), dimension(:,:), allocatable, target, public :: &
constitutive_nonlocal_output !< name of each post result output
- integer(pInt), dimension(:), allocatable, private :: &
+ integer(pInt), dimension(:), allocatable, target, public :: &
constitutive_nonlocal_Noutput !< number of outputs per instance of this plasticity
integer(pInt), dimension(:,:), allocatable, private :: &
diff --git a/code/constitutive_phenopowerlaw.f90 b/code/constitutive_phenopowerlaw.f90
index 0894c0c50..d93810800 100644
--- a/code/constitutive_phenopowerlaw.f90
+++ b/code/constitutive_phenopowerlaw.f90
@@ -22,8 +22,10 @@ module constitutive_phenopowerlaw
character(len=64), dimension(:,:), allocatable, target, public :: &
constitutive_phenopowerlaw_output !< name of each post result output
+ integer(pInt), dimension(:), allocatable, target, public :: &
+ constitutive_phenopowerlaw_Noutput !< number of outputs per instance of this constitution
+
integer(pInt), dimension(:), allocatable, private :: &
- constitutive_phenopowerlaw_Noutput, & !< number of outputs per instance of this constitution
constitutive_phenopowerlaw_totalNslip, & !< no. of slip system used in simulation
constitutive_phenopowerlaw_totalNtwin !< no. of twin system used in simulation
diff --git a/code/constitutive_titanmod.f90 b/code/constitutive_titanmod.f90
index 961de4323..099267918 100644
--- a/code/constitutive_titanmod.f90
+++ b/code/constitutive_titanmod.f90
@@ -42,7 +42,7 @@ module constitutive_titanmod
character(len=64), dimension(:,:), allocatable, target, public :: &
constitutive_titanmod_output !< name of each post result output
- integer(pInt), dimension(:), allocatable, private :: &
+ integer(pInt), dimension(:), allocatable, target, public :: &
constitutive_titanmod_Noutput !< number of outputs per instance of this plasticity !< ID of the lattice structure
integer(pInt), dimension(:), allocatable, private :: &
diff --git a/code/damage_brittle.f90 b/code/damage_brittle.f90
index 07a37a583..0d73a19b1 100644
--- a/code/damage_brittle.f90
+++ b/code/damage_brittle.f90
@@ -22,7 +22,7 @@ module damage_brittle
character(len=64), dimension(:,:), allocatable, target, public :: &
damage_brittle_output !< name of each post result output
- integer(pInt), dimension(:), allocatable, private :: &
+ integer(pInt), dimension(:), allocatable, target, public :: &
damage_brittle_Noutput !< number of outputs per instance of this damage
real(pReal), dimension(:), allocatable, private :: &