prepare for more sensible separation of functionality

This commit is contained in:
Martin Diehl 2020-10-24 14:23:00 +02:00
parent 68017e49b2
commit 5f2512e4d5
1 changed files with 40 additions and 16 deletions

View File

@ -67,10 +67,10 @@ module material
material_Nhomogenization !< number of homogenizations material_Nhomogenization !< number of homogenizations
integer, public, protected :: & integer, public, protected :: &
homogenization_maxNconstituent !< max number of grains in any USED homogenization homogenization_maxNconstituent !< max number of grains in any USED homogenization
integer, dimension(:), allocatable, public, protected :: & integer, dimension(:), allocatable, public, protected :: &
homogenization_Nconstituent, & !< number of grains in each homogenization homogenization_Nconstituent, & !< number of grains in each homogenization
homogenization_typeInstance, & !< instance of particular type of each homogenization homogenization_typeInstance, & !< instance of particular type of each homogenization
thermal_typeInstance, & !< instance of particular type of each thermal transport thermal_typeInstance, & !< instance of particular type of each thermal transport
damage_typeInstance !< instance of particular type of each nonlocal damage damage_typeInstance !< instance of particular type of each nonlocal damage
@ -85,7 +85,7 @@ module material
material_homogenizationMemberAt !< position of the element within its homogenization instance material_homogenizationMemberAt !< position of the element within its homogenization instance
integer, dimension(:,:), allocatable, public, protected :: & ! (constituent,elem) integer, dimension(:,:), allocatable, public, protected :: & ! (constituent,elem)
material_phaseAt !< phase ID of each element material_phaseAt !< phase ID of each element
integer, dimension(:,:,:), allocatable, public, protected :: & ! (constituent,elem) integer, dimension(:,:,:), allocatable, public, protected :: & ! (constituent,IP,elem)
material_phaseMemberAt !< position of the element within its phase instance material_phaseMemberAt !< position of the element within its phase instance
type(tState), allocatable, dimension(:), public :: & type(tState), allocatable, dimension(:), public :: &
@ -183,6 +183,7 @@ subroutine material_init(restart)
call material_parseMaterial call material_parseMaterial
print*, 'Material parsed' print*, 'Material parsed'
call material_parseNconstituent
call material_parseHomogenization call material_parseHomogenization
print*, 'Homogenization parsed' print*, 'Homogenization parsed'
@ -225,6 +226,34 @@ subroutine material_init(restart)
end subroutine material_init end subroutine material_init
!--------------------------------------------------------------------------------------------------
!> @brief Determine Nconstituent in homogenization
!--------------------------------------------------------------------------------------------------
subroutine material_parseNconstituent
class(tNode), pointer :: &
material_homogenization, &
homog
integer :: h
material_homogenization => config_material%get('homogenization')
material_Nhomogenization = material_homogenization%length
allocate(homogenization_Nconstituent(material_Nhomogenization))
do h=1, material_Nhomogenization
homog => material_homogenization%get(h)
homogenization_Nconstituent(h) = homog%get_asInt('N_constituents')
enddo
homogenization_maxNconstituent = maxval(homogenization_Nconstituent)
end subroutine material_parseNconstituent
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief parses the homogenization part from the material configuration !> @brief parses the homogenization part from the material configuration
! ToDo: This should be done in homogenization ! ToDo: This should be done in homogenization
@ -241,7 +270,6 @@ subroutine material_parseHomogenization
integer :: h integer :: h
material_homogenization => config_material%get('homogenization') material_homogenization => config_material%get('homogenization')
material_Nhomogenization = material_homogenization%length
allocate(homogenization_type(material_Nhomogenization), source=HOMOGENIZATION_undefined_ID) allocate(homogenization_type(material_Nhomogenization), source=HOMOGENIZATION_undefined_ID)
allocate(thermal_type(material_Nhomogenization), source=THERMAL_isothermal_ID) allocate(thermal_type(material_Nhomogenization), source=THERMAL_isothermal_ID)
@ -249,7 +277,6 @@ subroutine material_parseHomogenization
allocate(homogenization_typeInstance(material_Nhomogenization), source=0) allocate(homogenization_typeInstance(material_Nhomogenization), source=0)
allocate(thermal_typeInstance(material_Nhomogenization), source=0) allocate(thermal_typeInstance(material_Nhomogenization), source=0)
allocate(damage_typeInstance(material_Nhomogenization), source=0) allocate(damage_typeInstance(material_Nhomogenization), source=0)
allocate(homogenization_Nconstituent(material_Nhomogenization), source=0)
allocate(thermal_initialT(material_Nhomogenization), source=300.0_pReal) allocate(thermal_initialT(material_Nhomogenization), source=300.0_pReal)
allocate(damage_initialPhi(material_Nhomogenization), source=1.0_pReal) allocate(damage_initialPhi(material_Nhomogenization), source=1.0_pReal)
@ -308,9 +335,6 @@ subroutine material_parseHomogenization
damage_typeInstance(h) = count(damage_type (1:h) == damage_type (h)) damage_typeInstance(h) = count(damage_type (1:h) == damage_type (h))
enddo enddo
homogenization_maxNconstituent = maxval(homogenization_Nconstituent)
end subroutine material_parseHomogenization end subroutine material_parseHomogenization