moved mappings for new state layout to material

This commit is contained in:
Pratheek Shanthraj 2014-06-22 18:58:29 +00:00
parent 27970bb760
commit d3356bde4e
5 changed files with 127 additions and 44 deletions

View File

@ -295,15 +295,13 @@ subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature, dt, el
microstructure_elemhomo, &
#ifdef NEWSTATE
plasticState,&
mappingConstitutive, &
#endif
material_phase
#ifndef NEWSTATE
use constitutive, only: &
constitutive_state0, &
constitutive_state
#else
use constitutive, only: &
mappingConstitutive
#endif
use crystallite, only: &

View File

@ -60,13 +60,6 @@ module constitutive
private :: &
constitutive_hooke_TandItsTangent
#if defined(HDF) || defined(NEWSTATE)
integer(pInt), dimension(:,:,:,:), allocatable, public, protected :: mappingConstitutive
integer(pInt), dimension(:,:,:), allocatable, public, protected :: mappingCrystallite
integer(pInt), dimension(:), allocatable :: ConstitutivePosition
integer(pInt), dimension(:), allocatable :: CrystallitePosition
#endif
contains
@ -129,6 +122,9 @@ subroutine constitutive_init
PLASTICITY_TITANMOD_label, &
#ifdef NEWSTATE
plasticState, &
#endif
#if defined(HDF) || defined(NEWSTATE)
mappingConstitutive, &
#endif
PLASTICITY_NONLOCAL_label
use constitutive_none
@ -156,12 +152,6 @@ subroutine constitutive_init
character(len=64), dimension(:,:), pointer :: thisOutput
character(len=32) :: outputName !< name of output, intermediate fix until HDF5 output is ready
logical :: knownPlasticity, nonlocalConstitutionPresent
#if defined(HDF) || defined(NEWSTATE)
allocate(mappingConstitutive(2,homogenization_maxngrains,mesh_maxNips,mesh_ncpelems),source=0_pInt)
allocate(mappingCrystallite (2,homogenization_maxngrains,mesh_ncpelems),source=0_pInt)
allocate(ConstitutivePosition(material_nphase),source=0_pInt)
allocate(CrystallitePosition(material_nphase),source=0_pInt)
#endif
nonlocalConstitutionPresent = .false.
!--------------------------------------------------------------------------------------------------
@ -269,10 +259,6 @@ subroutine constitutive_init
end select
phase = material_phase(g,i,e)
instance = phase_plasticityInstance(phase)
#if defined(HDF) || defined(NEWSTATE)
ConstitutivePosition(phase) = ConstitutivePosition(phase)+1_pInt ! not distinguishing between instances of same phase
mappingConstitutive(1:2,g,i,e) = [ConstitutivePosition(phase),phase]
#endif
select case(phase_plasticity(material_phase(g,i,e)))
case (PLASTICITY_NONE_ID)
#ifndef NEWSTATE
@ -533,6 +519,7 @@ pure function constitutive_homogenizedC(ipc,ip,el)
PLASTICITY_TITANMOD_ID, &
#ifdef NEWSTATE
plasticState,&
mappingConstitutive, &
#endif
PLASTICITY_DISLOTWIN_ID
use constitutive_titanmod, only: &
@ -589,6 +576,7 @@ subroutine constitutive_microstructure(temperature, Fe, Fp, ipc, ip, el)
PLASTICITY_DISLOTWIN_ID, &
#ifdef NEWSTATE
plasticState, &
mappingConstitutive, &
#endif
PLASTICITY_TITANMOD_ID, &
PLASTICITY_NONLOCAL_ID
@ -653,6 +641,7 @@ subroutine constitutive_LpAndItsTangent(Lp, dLp_dTstar, Tstar_v, temperature, ip
material_phase, &
#ifdef NEWSTATE
plasticState,&
mappingConstitutive, &
#endif
PLASTICITY_NONE_ID, &
PLASTICITY_J2_ID, &
@ -826,6 +815,7 @@ subroutine constitutive_collectDotState(Tstar_v, FeArray, FpArray, Temperature,
phase_plasticity, &
#ifdef NEWSTATE
plasticState, &
mappingConstitutive, &
#endif
material_phase, &
homogenization_maxNgrains, &
@ -953,6 +943,7 @@ logical function constitutive_collectDeltaState(Tstar_v, ipc, ip, el)
material_phase, &
#ifdef NEWSTATE
plasticState, &
mappingConstitutive, &
#endif
PLASTICITY_NONLOCAL_ID
use constitutive_nonlocal, only: &
@ -1013,6 +1004,7 @@ function constitutive_postResults(Tstar_v, FeArray, temperature, ipc, ip, el)
use material, only: &
#ifdef NEWSTATE
plasticState, &
mappingConstitutive, &
#endif
phase_plasticity, &
material_phase, &

View File

@ -536,6 +536,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco,rate_sensitivity)
homogenization_Ngrains, &
#ifdef NEWSTATE
plasticState, &
mappingConstitutive, &
#endif
homogenization_maxNgrains
use constitutive, only: &
@ -548,8 +549,6 @@ subroutine crystallite_stressAndItsTangent(updateJaco,rate_sensitivity)
constitutive_partionedState0, &
constitutive_dotState, &
constitutive_dotState_backup, &
#else
mappingConstitutive, &
#endif
constitutive_TandItsTangent, &
constitutive_localDamage, &
@ -1414,11 +1413,11 @@ subroutine crystallite_integrateStateRK4()
homogenization_Ngrains, &
#ifdef NEWSTATE
plasticState, &
mappingConstitutive, &
#endif
homogenization_maxNgrains
use constitutive, only: &
constitutive_collectDotState, &
constitutive_microstructure, &
#ifndef NEWSTATE
constitutive_sizeDotState, &
constitutive_state, &
@ -1427,9 +1426,8 @@ subroutine crystallite_integrateStateRK4()
constitutive_RK4dotState, &
constitutive_deltaState, &
constitutive_collectDeltaState
#else
mappingConstitutive
#endif
constitutive_microstructure
implicit none
real(pReal), dimension(4), parameter :: &
@ -1744,6 +1742,7 @@ subroutine crystallite_integrateStateRKCK45()
homogenization_Ngrains, &
#ifdef NEWSTATE
plasticState, &
mappingConstitutive, &
#endif
homogenization_maxNgrains
use constitutive, only: &
@ -1758,8 +1757,6 @@ subroutine crystallite_integrateStateRKCK45()
constitutive_RKCK45dotState, &
constitutive_deltaState, &
constitutive_collectDeltaState, &
#else
mappingConstitutive, &
#endif
constitutive_microstructure
@ -2297,21 +2294,20 @@ subroutine crystallite_integrateStateAdaptiveEuler()
homogenization_Ngrains, &
#ifdef NEWSTATE
plasticState, &
mappingConstitutive, &
#endif
homogenization_maxNgrains
use constitutive, only: &
constitutive_collectDotState, &
constitutive_microstructure, &
constitutive_maxSizeDotState, &
#ifndef NEWSTATE
constitutive_subState0, &
constitutive_state, &
constitutive_sizeDotState, &
constitutive_dotState, &
constitutive_aTolState
#else
mappingConstitutive
#endif
constitutive_maxSizeDotState
implicit none
@ -2676,20 +2672,19 @@ subroutine crystallite_integrateStateEuler()
use material, only: &
#ifdef NEWSTATE
plasticState, &
mappingConstitutive, &
#endif
homogenization_Ngrains
use constitutive, only: &
constitutive_collectDotState, &
constitutive_microstructure, &
#ifndef NEWSTATE
constitutive_subState0, &
constitutive_state, &
constitutive_sizeDotState, &
constitutive_maxSizeDotState, &
constitutive_dotState
#else
mappingConstitutive
#endif
constitutive_microstructure
implicit none
@ -2902,12 +2897,12 @@ subroutine crystallite_integrateStateFPI()
use material, only: &
#ifdef NEWSTATE
plasticState, &
mappingConstitutive, &
#endif
homogenization_Ngrains
use constitutive, only: &
constitutive_collectDotState, &
constitutive_microstructure, &
constitutive_maxSizeDotState, &
#ifndef NEWSTATE
constitutive_subState0, &
constitutive_state, &
@ -2916,9 +2911,8 @@ subroutine crystallite_integrateStateFPI()
constitutive_previousDotState, &
constitutive_previousDotState2, &
constitutive_aTolState
#else
mappingConstitutive
#endif
constitutive_maxSizeDotState
implicit none
@ -3359,17 +3353,16 @@ logical function crystallite_stateJump(g,i,e)
use material, only: &
#ifdef NEWSTATE
plasticState, &
mappingConstitutive, &
#endif
homogenization_Ngrains
use constitutive, only: &
constitutive_collectDeltaState, &
#ifndef NEWSTATE
constitutive_sizeDotState, &
constitutive_state, &
constitutive_deltaState
#else
mappingConstitutive
#endif
constitutive_collectDeltaState
implicit none

View File

@ -294,6 +294,7 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt)
use material, only: &
#ifdef NEWSTATE
plasticState, &
mappingConstitutive, &
#endif
homogenization_Ngrains
#ifndef NEWSTATE
@ -301,9 +302,6 @@ subroutine materialpoint_stressAndItsTangent(updateJaco,dt)
constitutive_state0, &
constitutive_partionedState0, &
constitutive_state
#else
use constitutive, only: &
mappingConstitutive
#endif
use crystallite, only: &

View File

@ -27,6 +27,13 @@ module material
PLASTICITY_DISLOTWIN_label = 'dislotwin', &
PLASTICITY_TITANMOD_label = 'titanmod', &
PLASTICITY_NONLOCAL_label = 'nonlocal', &
DAMAGE_NONE_label = 'none', &
DAMAGE_LOCAL_label = 'local', &
DAMAGE_GRADIENT_label = 'gradient', &
THERMAL_NONE_label = 'none', &
THERMAL_ISO_label = 'isothermal', &
THERMAL_CONDUCTION_label = 'conduction', &
THERMAL_ADIABATIC_label = 'adiabatic', &
HOMOGENIZATION_NONE_label = 'none', &
HOMOGENIZATION_ISOSTRAIN_label = 'isostrain', &
HOMOGENIZATION_RGC_label = 'rgc'
@ -44,6 +51,19 @@ module material
PLASTICITY_titanmod_ID, &
PLASTICITY_nonlocal_ID
end enum
enum, bind(c)
enumerator :: DAMAGE_undefined_ID, &
DAMAGE_none_ID, &
DAMAGE_local_ID, &
DAMAGE_gradient_ID
end enum
enum, bind(c)
enumerator :: THERMAL_undefined_ID, &
THERMAL_none_ID, &
THERMAL_iso_ID, &
THERMAL_conduction_ID, &
THERMAL_adiabatic_ID
end enum
enum, bind(c)
enumerator :: HOMOGENIZATION_undefined_ID, &
HOMOGENIZATION_none_ID, &
@ -64,6 +84,10 @@ module material
phase_elasticity !< elasticity of each phase
integer(kind(PLASTICITY_undefined_ID)), dimension(:), allocatable, public, protected :: &
phase_plasticity !< plasticity of each phase
integer(kind(DAMAGE_undefined_ID)), dimension(:), allocatable, public, protected :: &
phase_damage !< damage of each phase
integer(kind(THERMAL_undefined_ID)), dimension(:), allocatable, public, protected :: &
phase_thermal !< thermal of each phase
integer(kind(HOMOGENIZATION_undefined_ID)), dimension(:), allocatable, public, protected :: &
homogenization_type !< type of each homogenization
@ -85,6 +109,8 @@ module material
phase_Noutput, & !< number of '(output)' items per phase
phase_elasticityInstance, & !< instance of particular elasticity of each phase
phase_plasticityInstance, & !< instance of particular plasticity of each phase
phase_damageInstance, & !< instance of particular plasticity of each phase
phase_thermalInstance, & !< instance of particular plasticity of each phase
crystallite_Noutput, & !< number of '(output)' items per crystallite setting
homogenization_typeInstance, & !< instance of particular type of each homogenization
microstructure_crystallite !< crystallite setting ID of each microstructure
@ -95,7 +121,9 @@ module material
#ifdef NEWSTATE
type(tState), allocatable, dimension(:), public :: &
plasticState, &
elasticState
elasticState, &
damageState, &
thermalState
#endif
integer(pInt), dimension(:,:,:), allocatable, public, protected :: &
@ -148,7 +176,13 @@ module material
logical, dimension(:), allocatable, private :: &
homogenization_active
#if defined(HDF) || defined(NEWSTATE)
integer(pInt), dimension(:,:,:,:), allocatable, public, protected :: mappingConstitutive
integer(pInt), dimension(:,:,:), allocatable, public, protected :: mappingCrystallite
integer(pInt), dimension(:), allocatable :: ConstitutivePosition
integer(pInt), dimension(:), allocatable :: CrystallitePosition
#endif
public :: &
material_init, &
@ -159,6 +193,15 @@ module material
PLASTICITY_dislotwin_ID, &
PLASTICITY_titanmod_ID, &
PLASTICITY_nonlocal_ID, &
DAMAGE_undefined_ID, &
DAMAGE_none_ID, &
DAMAGE_local_ID, &
DAMAGE_gradient_ID, &
THERMAL_undefined_ID, &
THERMAL_none_ID, &
THERMAL_iso_ID, &
THERMAL_conduction_ID, &
THERMAL_adiabatic_ID, &
HOMOGENIZATION_none_ID, &
HOMOGENIZATION_isostrain_ID, &
#ifdef HDF
@ -194,10 +237,21 @@ subroutine material_init
debug_material, &
debug_levelBasic, &
debug_levelExtensive
use mesh, only: &
mesh_maxNips, &
mesh_NcpElems, &
mesh_element, &
FE_Nips, &
FE_geomtype
implicit none
integer(pInt), parameter :: FILEUNIT = 200_pInt
integer(pInt) :: m,c,h, myDebug
integer(pInt) :: &
g, & !< grain number
i, & !< integration point number
e, & !< element number
phase
myDebug = debug_level(debug_material)
write(6,'(/,a)') ' <<<+- material init -+>>>'
@ -221,6 +275,24 @@ subroutine material_init
#ifdef NEWSTATE
allocate(plasticState(material_Nphase))
allocate(elasticState(material_Nphase))
allocate(damageState (material_Nphase))
allocate(thermalState(material_Nphase))
#endif
#if defined(HDF) || defined(NEWSTATE)
allocate(mappingConstitutive(2,homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems),source=0_pInt)
allocate(mappingCrystallite (2,homogenization_maxNgrains,mesh_NcpElems),source=0_pInt)
allocate(ConstitutivePosition(material_Nphase),source=0_pInt)
allocate(CrystallitePosition(material_Nphase),source=0_pInt)
ElemLoop:do e = 1_pInt,mesh_NcpElems ! loop over elements
IPloop:do i = 1_pInt,FE_Nips(FE_geomtype(mesh_element(2,e))) ! loop over IPs
GrainLoop:do g = 1_pInt,homogenization_Ngrains(mesh_element(3,e)) ! loop over grains
phase = material_phase(g,i,e)
ConstitutivePosition(phase) = ConstitutivePosition(phase)+1_pInt ! not distinguishing between instances of same phase
mappingConstitutive(1:2,g,i,e) = [ConstitutivePosition(phase),phase]
enddo GrainLoop
enddo IPloop
enddo ElemLoop
#endif
do m = 1_pInt,material_Nmicrostructure
@ -556,6 +628,10 @@ subroutine material_parsePhase(fileUnit,myPart)
allocate(phase_elasticityInstance(Nsections), source=0_pInt)
allocate(phase_plasticity(Nsections) , source=PLASTICITY_undefined_ID)
allocate(phase_plasticityInstance(Nsections), source=0_pInt)
allocate(phase_damage(Nsections) , source=DAMAGE_undefined_ID)
allocate(phase_damageInstance(Nsections), source=0_pInt)
allocate(phase_thermal(Nsections) , source=THERMAL_undefined_ID)
allocate(phase_thermalInstance(Nsections), source=0_pInt)
allocate(phase_Noutput(Nsections), source=0_pInt)
allocate(phase_localPlasticity(Nsections), source=.false.)
@ -612,6 +688,32 @@ subroutine material_parsePhase(fileUnit,myPart)
call IO_error(201_pInt,ext_msg=trim(IO_stringValue(line,positions,2_pInt)))
end select
phase_plasticityInstance(section) = count(phase_plasticity == phase_plasticity(section)) ! count instances
case ('damage')
select case (IO_lc(IO_stringValue(line,positions,2_pInt)))
case (DAMAGE_NONE_label)
phase_damage(section) = DAMAGE_none_ID
case (DAMAGE_LOCAL_label)
phase_damage(section) = DAMAGE_local_ID
case (DAMAGE_GRADIENT_label)
phase_damage(section) = DAMAGE_gradient_ID
case default
call IO_error(200_pInt,ext_msg=trim(IO_stringValue(line,positions,2_pInt)))
end select
phase_damageInstance(section) = count(phase_damage == phase_damage(section)) ! count instances
case ('thermal')
select case (IO_lc(IO_stringValue(line,positions,2_pInt)))
case (THERMAL_NONE_label)
phase_thermal(section) = THERMAL_none_ID
case (THERMAL_ISO_label)
phase_thermal(section) = THERMAL_iso_ID
case (THERMAL_CONDUCTION_label)
phase_thermal(section) = THERMAL_conduction_ID
case (THERMAL_ADIABATIC_label)
phase_thermal(section) = THERMAL_adiabatic_ID
case default
call IO_error(200_pInt,ext_msg=trim(IO_stringValue(line,positions,2_pInt)))
end select
phase_thermalInstance(section) = count(phase_thermal == phase_thermal(section)) ! count instances
end select
endif
enddo