moved field initialization from homogenization to material since it is needed in crystallite

This commit is contained in:
Pratheek Shanthraj 2014-09-22 20:36:55 +00:00
parent 6ace12be0c
commit f6c0f7062e
2 changed files with 44 additions and 47 deletions

View File

@ -118,7 +118,7 @@ subroutine homogenization_init()
implicit none implicit none
integer(pInt), parameter :: FILEUNIT = 200_pInt integer(pInt), parameter :: FILEUNIT = 200_pInt
integer(pInt) :: e,i,p,myInstance, NofMyField integer(pInt) :: e,i,p,myInstance
integer(pInt), dimension(:,:), pointer :: thisSize integer(pInt), dimension(:,:), pointer :: thisSize
character(len=64), dimension(:,:), pointer :: thisOutput character(len=64), dimension(:,:), pointer :: thisOutput
character(len=32) :: outputName !< name of output, intermediate fix until HDF5 output is ready character(len=32) :: outputName !< name of output, intermediate fix until HDF5 output is ready
@ -173,44 +173,6 @@ subroutine homogenization_init()
endif endif
enddo enddo
close(FILEUNIT) close(FILEUNIT)
do p = 1,material_Nhomogenization
NofMyField=count(material_homog==p)
select case(field_damage_type(p))
case (FIELD_DAMAGE_LOCAL_ID)
fieldDamage(p)%sizeField = 0_pInt
fieldDamage(p)%sizePostResults = 0_pInt
allocate(fieldDamage(p)%field(fieldDamage(p)%sizeField,NofMyField), source = 1.0_pReal)
case (FIELD_DAMAGE_NONLOCAL_ID)
fieldDamage(p)%sizeField = 1_pInt
fieldDamage(p)%sizePostResults = 1_pInt
allocate(fieldDamage(p)%field(fieldDamage(p)%sizeField,NofMyField), source = 1.0_pReal)
end select
enddo
do p = 1,material_Nhomogenization
NofMyField=count(material_homog==p)
select case(field_thermal_type(p))
case (FIELD_THERMAL_ADIABATIC_ID)
fieldThermal(p)%sizeField = 0_pInt
fieldThermal(p)%sizePostResults = 0_pInt
allocate(fieldThermal(p)%field(fieldThermal(p)%sizeField,NofMyField), &
source = 273.0_pReal) ! ToDo: temporary fix for now
case (FIELD_THERMAL_CONDUCTION_ID)
fieldThermal(p)%sizeField = 1_pInt
fieldThermal(p)%sizePostResults = 1_pInt
allocate(fieldThermal(p)%field(fieldThermal(p)%sizeField,NofMyField), &
source = 273.0_pReal) ! ToDo: temporary fix for now
end select
enddo
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate and initialize global variables ! allocate and initialize global variables

View File

@ -199,11 +199,6 @@ module material
integer(pInt), dimension(:,:,:), allocatable, public, protected :: mappingCrystallite integer(pInt), dimension(:,:,:), allocatable, public, protected :: mappingCrystallite
integer(pInt), dimension(:,:,:), allocatable, public, protected :: mappingHomogenization integer(pInt), dimension(:,:,:), allocatable, public, protected :: mappingHomogenization
integer(pInt), dimension(:), allocatable :: ConstitutivePosition
integer(pInt), dimension(:), allocatable :: CrystallitePosition
integer(pInt), dimension(:), allocatable :: HomogenizationPosition
public :: & public :: &
material_init, & material_init, &
ELASTICITY_hooke_ID ,& ELASTICITY_hooke_ID ,&
@ -271,7 +266,13 @@ subroutine material_init
g, & !< grain number g, & !< grain number
i, & !< integration point number i, & !< integration point number
e, & !< element number e, & !< element number
phase phase, &
homog, &
NofMyField
integer(pInt), dimension(:), allocatable :: ConstitutivePosition
integer(pInt), dimension(:), allocatable :: CrystallitePosition
integer(pInt), dimension(:), allocatable :: HomogenizationPosition
myDebug = debug_level(debug_material) myDebug = debug_level(debug_material)
write(6,'(/,a)') ' <<<+- material init -+>>>' write(6,'(/,a)') ' <<<+- material init -+>>>'
@ -359,6 +360,40 @@ subroutine material_init
enddo IPloop enddo IPloop
enddo ElemLoop enddo ElemLoop
do homog = 1,material_Nhomogenization
NofMyField=count(material_homog==homog)
select case(field_damage_type(homog))
case (FIELD_DAMAGE_LOCAL_ID)
fieldDamage(homog)%sizeField = 0_pInt
fieldDamage(homog)%sizePostResults = 0_pInt
allocate(fieldDamage(homog)%field(fieldDamage(homog)%sizeField,NofMyField), source = 1.0_pReal)
case (FIELD_DAMAGE_NONLOCAL_ID)
fieldDamage(homog)%sizeField = 1_pInt
fieldDamage(homog)%sizePostResults = 1_pInt
allocate(fieldDamage(homog)%field(fieldDamage(homog)%sizeField,NofMyField), source = 1.0_pReal)
end select
enddo
do homog = 1,material_Nhomogenization
NofMyField=count(material_homog==homog)
select case(field_thermal_type(homog))
case (FIELD_THERMAL_ADIABATIC_ID)
fieldThermal(homog)%sizeField = 0_pInt
fieldThermal(homog)%sizePostResults = 0_pInt
allocate(fieldThermal(homog)%field(fieldThermal(homog)%sizeField,NofMyField), &
source = 300.0_pReal) ! ToDo: temporary fix for now
case (FIELD_THERMAL_CONDUCTION_ID)
fieldThermal(homog)%sizeField = 1_pInt
fieldThermal(homog)%sizePostResults = 1_pInt
allocate(fieldThermal(homog)%field(fieldThermal(homog)%sizeField,NofMyField), &
source = 300.0_pReal) ! ToDo: temporary fix for now
end select
enddo
end subroutine material_init end subroutine material_init
@ -989,9 +1024,9 @@ subroutine material_populateGrains
real(pReal), dimension (3) :: orientation real(pReal), dimension (3) :: orientation
real(pReal), dimension (3,3) :: symOrientation real(pReal), dimension (3,3) :: symOrientation
integer(pInt), dimension (:), allocatable :: phaseOfGrain, textureOfGrain integer(pInt), dimension (:), allocatable :: phaseOfGrain, textureOfGrain
integer(pInt) :: t,e,i,ii,g,j,m,c,r,homog,micro,sgn,hme, myDebug, & integer(pInt) :: t,e,i,g,j,m,c,r,homog,micro,sgn,hme, myDebug, &
phaseID,textureID,dGrains,myNgrains,myNorientations,myNconstituents, & phaseID,textureID,dGrains,myNgrains,myNorientations,myNconstituents, &
grain,constituentGrain,ipGrain,symExtension, ip, HomogInstType grain,constituentGrain,ipGrain,symExtension, ip
real(pReal) :: extreme,rnd real(pReal) :: extreme,rnd
integer(pInt), dimension (:,:), allocatable :: Nelems ! counts number of elements in homog, micro array integer(pInt), dimension (:,:), allocatable :: Nelems ! counts number of elements in homog, micro array
type(p_intvec), dimension (:,:), allocatable :: elemsOfHomogMicro ! lists element number in homog, micro array type(p_intvec), dimension (:,:), allocatable :: elemsOfHomogMicro ! lists element number in homog, micro array