2012-03-09 01:55:28 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
|
2013-06-11 22:05:04 +05:30
|
|
|
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
|
2018-06-26 22:39:46 +05:30
|
|
|
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
|
2013-01-18 17:00:52 +05:30
|
|
|
!> @brief Parses material config file, either solverJobName.materialConfig or material.config
|
2012-03-09 01:55:28 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
module material
|
2019-06-05 13:32:55 +05:30
|
|
|
use prec
|
|
|
|
use math
|
|
|
|
use config
|
|
|
|
use results
|
|
|
|
use IO
|
2019-06-07 18:01:42 +05:30
|
|
|
use rotations
|
2019-06-07 09:48:42 +05:30
|
|
|
use discretization
|
2012-03-09 01:55:28 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
implicit none
|
|
|
|
private
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2020-03-17 12:47:14 +05:30
|
|
|
enum, bind(c); enumerator :: &
|
2020-08-15 19:32:10 +05:30
|
|
|
ELASTICITY_UNDEFINED_ID, &
|
|
|
|
ELASTICITY_HOOKE_ID, &
|
|
|
|
PLASTICITY_UNDEFINED_ID, &
|
2020-03-17 12:47:14 +05:30
|
|
|
PLASTICITY_NONE_ID, &
|
|
|
|
PLASTICITY_ISOTROPIC_ID, &
|
|
|
|
PLASTICITY_PHENOPOWERLAW_ID, &
|
|
|
|
PLASTICITY_KINEHARDENING_ID, &
|
|
|
|
PLASTICITY_DISLOTWIN_ID, &
|
2020-08-15 19:32:10 +05:30
|
|
|
PLASTICITY_DISLOTUNGSTEN_ID, &
|
2020-03-17 12:47:14 +05:30
|
|
|
PLASTICITY_NONLOCAL_ID, &
|
|
|
|
SOURCE_UNDEFINED_ID ,&
|
|
|
|
SOURCE_THERMAL_DISSIPATION_ID, &
|
|
|
|
SOURCE_THERMAL_EXTERNALHEAT_ID, &
|
|
|
|
SOURCE_DAMAGE_ISOBRITTLE_ID, &
|
|
|
|
SOURCE_DAMAGE_ISODUCTILE_ID, &
|
|
|
|
SOURCE_DAMAGE_ANISOBRITTLE_ID, &
|
|
|
|
SOURCE_DAMAGE_ANISODUCTILE_ID, &
|
|
|
|
KINEMATICS_UNDEFINED_ID ,&
|
|
|
|
KINEMATICS_CLEAVAGE_OPENING_ID, &
|
|
|
|
KINEMATICS_SLIPPLANE_OPENING_ID, &
|
|
|
|
KINEMATICS_THERMAL_EXPANSION_ID, &
|
|
|
|
STIFFNESS_DEGRADATION_UNDEFINED_ID, &
|
|
|
|
STIFFNESS_DEGRADATION_DAMAGE_ID, &
|
|
|
|
THERMAL_ISOTHERMAL_ID, &
|
|
|
|
THERMAL_ADIABATIC_ID, &
|
|
|
|
THERMAL_CONDUCTION_ID, &
|
|
|
|
DAMAGE_NONE_ID, &
|
|
|
|
DAMAGE_LOCAL_ID, &
|
|
|
|
DAMAGE_NONLOCAL_ID, &
|
|
|
|
HOMOGENIZATION_UNDEFINED_ID, &
|
|
|
|
HOMOGENIZATION_NONE_ID, &
|
|
|
|
HOMOGENIZATION_ISOSTRAIN_ID, &
|
|
|
|
HOMOGENIZATION_RGC_ID
|
2019-09-20 00:10:59 +05:30
|
|
|
end enum
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
character(len=pStringLen), public, protected, allocatable, dimension(:) :: &
|
|
|
|
material_name_phase, & !< name of each phase
|
|
|
|
material_name_homogenization !< name of each homogenization
|
2020-09-13 14:09:17 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
integer(kind(THERMAL_isothermal_ID)), dimension(:), allocatable, public, protected :: &
|
|
|
|
thermal_type !< thermal transport model
|
|
|
|
integer(kind(DAMAGE_none_ID)), dimension(:), allocatable, public, protected :: &
|
|
|
|
damage_type !< nonlocal damage model
|
2020-01-25 13:54:42 +05:30
|
|
|
integer(kind(HOMOGENIZATION_undefined_ID)), dimension(:), allocatable, public, protected :: &
|
|
|
|
homogenization_type !< type of each homogenization
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
integer, public, protected :: &
|
|
|
|
material_Nhomogenization !< number of homogenizations
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
integer, public, protected :: &
|
|
|
|
homogenization_maxNgrains !< max number of grains in any USED homogenization
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
integer, dimension(:), allocatable, public, protected :: &
|
|
|
|
homogenization_Ngrains, & !< number of grains in each homogenization
|
|
|
|
homogenization_typeInstance, & !< instance of particular type of each homogenization
|
|
|
|
thermal_typeInstance, & !< instance of particular type of each thermal transport
|
2019-11-25 13:14:44 +05:30
|
|
|
damage_typeInstance !< instance of particular type of each nonlocal damage
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
real(pReal), dimension(:), allocatable, public, protected :: &
|
|
|
|
thermal_initialT, & !< initial temperature per each homogenization
|
|
|
|
damage_initialPhi !< initial damage per each homogenization
|
2015-07-24 20:23:50 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
integer, dimension(:), allocatable, public, protected :: & ! (elem)
|
2020-08-29 20:15:18 +05:30
|
|
|
material_homogenizationAt !< homogenization ID of each element
|
2020-01-23 17:18:18 +05:30
|
|
|
integer, dimension(:,:), allocatable, public, target :: & ! (ip,elem) ToDo: ugly target for mapping hack
|
2019-09-20 00:10:59 +05:30
|
|
|
material_homogenizationMemberAt !< position of the element within its homogenization instance
|
|
|
|
integer, dimension(:,:), allocatable, public, protected :: & ! (constituent,elem)
|
|
|
|
material_phaseAt !< phase ID of each element
|
2019-10-19 23:25:00 +05:30
|
|
|
integer, dimension(:,:,:), allocatable, public, protected :: & ! (constituent,elem)
|
2019-09-20 00:10:59 +05:30
|
|
|
material_phaseMemberAt !< position of the element within its phase instance
|
2018-10-14 15:57:42 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
type(tState), allocatable, dimension(:), public :: &
|
|
|
|
homogState, &
|
|
|
|
thermalState, &
|
|
|
|
damageState
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2019-09-20 08:12:28 +05:30
|
|
|
type(Rotation), dimension(:,:,:), allocatable, public, protected :: &
|
|
|
|
material_orientation0 !< initial orientation of each grain,IP,element
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
integer, dimension(:), allocatable, private :: &
|
2020-10-01 17:31:50 +05:30
|
|
|
material_Nconstituents !< number of constituents in each material
|
2020-03-16 22:59:15 +05:30
|
|
|
|
|
|
|
|
2015-10-14 00:22:01 +05:30
|
|
|
|
2018-10-14 15:57:42 +05:30
|
|
|
! BEGIN DEPRECATED
|
2019-09-20 00:10:59 +05:30
|
|
|
integer, dimension(:,:), allocatable, private, target :: mappingHomogenizationConst !< mapping from material points to offset in constant state/field
|
2018-10-14 15:57:42 +05:30
|
|
|
! END DEPRECATED
|
2015-10-14 00:22:01 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
type(tHomogMapping), allocatable, dimension(:), public :: &
|
|
|
|
thermalMapping, & !< mapping for thermal state/fields
|
|
|
|
damageMapping !< mapping for damage state/fields
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
type(group_float), allocatable, dimension(:), public :: &
|
|
|
|
temperature, & !< temperature field
|
|
|
|
damage, & !< damage field
|
|
|
|
temperatureRate !< temperature change rate field
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
public :: &
|
|
|
|
material_init, &
|
2020-08-15 19:32:10 +05:30
|
|
|
ELASTICITY_UNDEFINED_ID, &
|
|
|
|
ELASTICITY_HOOKE_ID, &
|
|
|
|
PLASTICITY_UNDEFINED_ID, &
|
2020-03-17 12:47:14 +05:30
|
|
|
PLASTICITY_NONE_ID, &
|
|
|
|
PLASTICITY_ISOTROPIC_ID, &
|
|
|
|
PLASTICITY_PHENOPOWERLAW_ID, &
|
|
|
|
PLASTICITY_KINEHARDENING_ID, &
|
|
|
|
PLASTICITY_DISLOTWIN_ID, &
|
2020-08-15 19:32:10 +05:30
|
|
|
PLASTICITY_DISLOTUNGSTEN_ID, &
|
2020-03-17 12:47:14 +05:30
|
|
|
PLASTICITY_NONLOCAL_ID, &
|
2020-08-15 19:32:10 +05:30
|
|
|
SOURCE_UNDEFINED_ID ,&
|
2020-03-17 12:47:14 +05:30
|
|
|
SOURCE_THERMAL_DISSIPATION_ID, &
|
|
|
|
SOURCE_THERMAL_EXTERNALHEAT_ID, &
|
|
|
|
SOURCE_DAMAGE_ISOBRITTLE_ID, &
|
|
|
|
SOURCE_DAMAGE_ISODUCTILE_ID, &
|
|
|
|
SOURCE_DAMAGE_ANISOBRITTLE_ID, &
|
|
|
|
SOURCE_DAMAGE_ANISODUCTILE_ID, &
|
2020-08-15 19:32:10 +05:30
|
|
|
KINEMATICS_UNDEFINED_ID ,&
|
2020-03-17 12:47:14 +05:30
|
|
|
KINEMATICS_CLEAVAGE_OPENING_ID, &
|
|
|
|
KINEMATICS_SLIPPLANE_OPENING_ID, &
|
|
|
|
KINEMATICS_THERMAL_EXPANSION_ID, &
|
2020-08-15 19:32:10 +05:30
|
|
|
STIFFNESS_DEGRADATION_UNDEFINED_ID, &
|
2020-03-17 12:47:14 +05:30
|
|
|
STIFFNESS_DEGRADATION_DAMAGE_ID, &
|
|
|
|
THERMAL_ISOTHERMAL_ID, &
|
|
|
|
THERMAL_ADIABATIC_ID, &
|
|
|
|
THERMAL_CONDUCTION_ID, &
|
|
|
|
DAMAGE_NONE_ID, &
|
|
|
|
DAMAGE_LOCAL_ID, &
|
|
|
|
DAMAGE_NONLOCAL_ID, &
|
|
|
|
HOMOGENIZATION_NONE_ID, &
|
|
|
|
HOMOGENIZATION_ISOSTRAIN_ID, &
|
2019-09-20 00:10:59 +05:30
|
|
|
HOMOGENIZATION_RGC_ID
|
2013-10-16 18:34:59 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
contains
|
2020-01-25 13:54:42 +05:30
|
|
|
|
2013-01-18 17:00:52 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief parses material configuration file
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2020-05-06 21:20:59 +05:30
|
|
|
subroutine material_init(restart)
|
|
|
|
|
|
|
|
logical, intent(in) :: restart
|
2015-10-14 00:22:01 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
integer :: ph, myHomog
|
2020-06-18 19:36:11 +05:30
|
|
|
class(tNode), pointer :: &
|
2020-08-15 19:32:10 +05:30
|
|
|
phases, &
|
|
|
|
material_homogenization
|
|
|
|
character(len=pStringLen) :: sectionName
|
2020-09-13 14:09:17 +05:30
|
|
|
|
2020-09-22 16:39:12 +05:30
|
|
|
print'(/,a)', ' <<<+- material init -+>>>'; flush(IO_STDOUT)
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2020-09-13 14:09:17 +05:30
|
|
|
phases => config_material%get('phase')
|
2020-08-15 19:32:10 +05:30
|
|
|
allocate(material_name_phase(phases%length))
|
|
|
|
do ph = 1, phases%length
|
|
|
|
write(sectionName,'(i0,a)') ph,'_'
|
2020-09-13 14:09:17 +05:30
|
|
|
material_name_phase(ph) = trim(adjustl(sectionName))//phases%getKey(ph) !ToDO: No reason to do. Update damage tests
|
2020-08-15 19:32:10 +05:30
|
|
|
enddo
|
2020-09-13 14:09:17 +05:30
|
|
|
|
|
|
|
material_homogenization => config_material%get('homogenization')
|
2020-08-15 19:32:10 +05:30
|
|
|
allocate(material_name_homogenization(material_homogenization%length))
|
|
|
|
do myHomog = 1, material_homogenization%length
|
2020-09-13 14:09:17 +05:30
|
|
|
write(sectionName,'(i0,a)') myHomog,'_'
|
2020-08-15 19:32:10 +05:30
|
|
|
material_name_homogenization(myHomog) = trim(adjustl(sectionName))//material_homogenization%getKey(myHomog)
|
|
|
|
enddo
|
|
|
|
|
2020-09-17 22:58:41 +05:30
|
|
|
call material_parseMicrostructure
|
2020-09-19 12:54:27 +05:30
|
|
|
print*, 'Microstructure parsed'
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2020-09-17 22:58:41 +05:30
|
|
|
call material_parseHomogenization
|
2020-09-19 12:54:27 +05:30
|
|
|
print*, 'Homogenization parsed'
|
2020-03-16 22:59:15 +05:30
|
|
|
|
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
if(homogenization_maxNgrains > size(material_phaseAt,1)) call IO_error(148)
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
allocate(homogState (material_Nhomogenization))
|
|
|
|
allocate(thermalState (material_Nhomogenization))
|
|
|
|
allocate(damageState (material_Nhomogenization))
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
allocate(thermalMapping (material_Nhomogenization))
|
|
|
|
allocate(damageMapping (material_Nhomogenization))
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
allocate(temperature (material_Nhomogenization))
|
|
|
|
allocate(damage (material_Nhomogenization))
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
allocate(temperatureRate (material_Nhomogenization))
|
2020-02-22 15:44:11 +05:30
|
|
|
|
2019-06-13 03:01:46 +05:30
|
|
|
|
2020-05-06 21:20:59 +05:30
|
|
|
if (.not. restart) then
|
|
|
|
call results_openJobFile
|
2020-08-15 19:32:10 +05:30
|
|
|
call results_mapping_constituent(material_phaseAt,material_phaseMemberAt,material_name_phase)
|
|
|
|
call results_mapping_materialpoint(material_homogenizationAt,material_homogenizationMemberAt,material_name_homogenization)
|
2020-05-06 21:20:59 +05:30
|
|
|
call results_closeJobFile
|
|
|
|
endif
|
2019-04-04 16:55:29 +05:30
|
|
|
|
|
|
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
2018-10-14 15:57:42 +05:30
|
|
|
! BEGIN DEPRECATED
|
2019-09-20 00:10:59 +05:30
|
|
|
allocate(mappingHomogenizationConst( discretization_nIP,discretization_nElem),source=1)
|
2020-01-23 17:18:18 +05:30
|
|
|
|
2020-02-03 01:07:05 +05:30
|
|
|
! hack needed to initialize field values used during constitutive initialization
|
2020-08-15 19:32:10 +05:30
|
|
|
do myHomog = 1,material_Nhomogenization
|
2019-09-20 00:10:59 +05:30
|
|
|
thermalMapping (myHomog)%p => mappingHomogenizationConst
|
|
|
|
damageMapping (myHomog)%p => mappingHomogenizationConst
|
|
|
|
allocate(temperature (myHomog)%p(1), source=thermal_initialT(myHomog))
|
|
|
|
allocate(damage (myHomog)%p(1), source=damage_initialPhi(myHomog))
|
|
|
|
allocate(temperatureRate (myHomog)%p(1), source=0.0_pReal)
|
|
|
|
enddo
|
|
|
|
! END DEPRECATED
|
2018-10-14 15:57:42 +05:30
|
|
|
|
2012-03-09 01:55:28 +05:30
|
|
|
end subroutine material_init
|
2009-03-04 17:18:54 +05:30
|
|
|
|
2013-01-18 17:00:52 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2018-06-11 03:46:48 +05:30
|
|
|
!> @brief parses the homogenization part from the material configuration
|
2020-09-19 13:57:15 +05:30
|
|
|
! ToDo: This should be done in homogenization
|
2013-01-18 17:00:52 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2018-06-10 21:31:52 +05:30
|
|
|
subroutine material_parseHomogenization
|
2015-10-14 00:22:01 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
class(tNode), pointer :: &
|
|
|
|
material_homogenization, &
|
|
|
|
homog, &
|
|
|
|
homogMech, &
|
|
|
|
homogThermal, &
|
|
|
|
homogDamage
|
2020-01-23 18:30:56 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
integer :: h
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2020-09-13 14:09:17 +05:30
|
|
|
material_homogenization => config_material%get('homogenization')
|
2020-08-15 19:32:10 +05:30
|
|
|
material_Nhomogenization = material_homogenization%length
|
|
|
|
|
|
|
|
allocate(homogenization_type(material_Nhomogenization), source=HOMOGENIZATION_undefined_ID)
|
|
|
|
allocate(thermal_type(material_Nhomogenization), source=THERMAL_isothermal_ID)
|
|
|
|
allocate(damage_type (material_Nhomogenization), source=DAMAGE_none_ID)
|
|
|
|
allocate(homogenization_typeInstance(material_Nhomogenization), source=0)
|
|
|
|
allocate(thermal_typeInstance(material_Nhomogenization), source=0)
|
|
|
|
allocate(damage_typeInstance(material_Nhomogenization), source=0)
|
|
|
|
allocate(homogenization_Ngrains(material_Nhomogenization), source=0)
|
|
|
|
allocate(thermal_initialT(material_Nhomogenization), source=300.0_pReal)
|
|
|
|
allocate(damage_initialPhi(material_Nhomogenization), source=1.0_pReal)
|
|
|
|
|
|
|
|
do h=1, material_Nhomogenization
|
|
|
|
homog => material_homogenization%get(h)
|
|
|
|
homogMech => homog%get('mech')
|
|
|
|
select case (homogMech%get_asString('type'))
|
|
|
|
case('none')
|
2019-09-20 00:10:59 +05:30
|
|
|
homogenization_type(h) = HOMOGENIZATION_NONE_ID
|
|
|
|
homogenization_Ngrains(h) = 1
|
2020-08-15 19:32:10 +05:30
|
|
|
case('isostrain')
|
2019-09-20 00:10:59 +05:30
|
|
|
homogenization_type(h) = HOMOGENIZATION_ISOSTRAIN_ID
|
2020-08-15 19:32:10 +05:30
|
|
|
homogenization_Ngrains(h) = homogMech%get_asInt('N_constituents')
|
|
|
|
case('RGC')
|
2019-09-20 00:10:59 +05:30
|
|
|
homogenization_type(h) = HOMOGENIZATION_RGC_ID
|
2020-08-15 19:32:10 +05:30
|
|
|
homogenization_Ngrains(h) = homogMech%get_asInt('N_constituents')
|
2019-09-20 00:10:59 +05:30
|
|
|
case default
|
2020-08-15 19:32:10 +05:30
|
|
|
call IO_error(500,ext_msg=homogMech%get_asString('type'))
|
2019-09-20 00:10:59 +05:30
|
|
|
end select
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2019-09-20 00:10:59 +05:30
|
|
|
homogenization_typeInstance(h) = count(homogenization_type==homogenization_type(h))
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
if(homog%contains('thermal')) then
|
|
|
|
homogThermal => homog%get('thermal')
|
|
|
|
thermal_initialT(h) = homogThermal%get_asFloat('T_0',defaultVal=300.0_pReal)
|
|
|
|
|
|
|
|
select case (homogThermal%get_asString('type'))
|
|
|
|
case('isothermal')
|
|
|
|
thermal_type(h) = THERMAL_isothermal_ID
|
|
|
|
case('adiabatic')
|
|
|
|
thermal_type(h) = THERMAL_adiabatic_ID
|
|
|
|
case('conduction')
|
|
|
|
thermal_type(h) = THERMAL_conduction_ID
|
|
|
|
case default
|
|
|
|
call IO_error(500,ext_msg=homogThermal%get_asString('type'))
|
|
|
|
end select
|
2019-09-20 00:10:59 +05:30
|
|
|
endif
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
if(homog%contains('damage')) then
|
|
|
|
homogDamage => homog%get('damage')
|
|
|
|
damage_initialPhi(h) = homogDamage%get_asFloat('phi_0',defaultVal=1.0_pReal)
|
|
|
|
select case (homogDamage%get_asString('type'))
|
|
|
|
case('none')
|
|
|
|
damage_type(h) = DAMAGE_none_ID
|
|
|
|
case('local')
|
|
|
|
damage_type(h) = DAMAGE_local_ID
|
|
|
|
case('nonlocal')
|
|
|
|
damage_type(h) = DAMAGE_nonlocal_ID
|
|
|
|
case default
|
|
|
|
call IO_error(500,ext_msg=homogDamage%get_asString('type'))
|
|
|
|
end select
|
2019-09-20 00:10:59 +05:30
|
|
|
endif
|
|
|
|
enddo
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
do h=1, material_Nhomogenization
|
2019-09-20 02:10:03 +05:30
|
|
|
homogenization_typeInstance(h) = count(homogenization_type(1:h) == homogenization_type(h))
|
|
|
|
thermal_typeInstance(h) = count(thermal_type (1:h) == thermal_type (h))
|
|
|
|
damage_typeInstance(h) = count(damage_type (1:h) == damage_type (h))
|
2019-09-20 00:10:59 +05:30
|
|
|
enddo
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2020-08-29 20:04:19 +05:30
|
|
|
homogenization_maxNgrains = maxval(homogenization_Ngrains)
|
2009-03-04 17:18:54 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
|
2018-06-10 21:31:52 +05:30
|
|
|
end subroutine material_parseHomogenization
|
2009-03-04 17:18:54 +05:30
|
|
|
|
|
|
|
|
2013-01-18 17:00:52 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2020-10-01 16:13:05 +05:30
|
|
|
!> @brief parses the material part in the material configuration file
|
2013-01-18 17:00:52 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2018-06-10 21:31:52 +05:30
|
|
|
subroutine material_parseMicrostructure
|
2015-10-14 00:22:01 +05:30
|
|
|
|
2020-10-01 16:13:05 +05:30
|
|
|
class(tNode), pointer :: materials, & !> list of materials
|
|
|
|
material, & !> material definition
|
2020-09-19 13:57:15 +05:30
|
|
|
constituents, & !> list of constituents
|
|
|
|
constituent, & !> constituent definition
|
2020-08-15 19:32:10 +05:30
|
|
|
phases, &
|
|
|
|
homogenization
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
integer, dimension(:), allocatable :: &
|
2020-09-19 13:30:49 +05:30
|
|
|
counterPhase, &
|
|
|
|
counterHomogenization
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2020-09-19 13:30:49 +05:30
|
|
|
real(pReal) :: &
|
|
|
|
frac
|
2020-08-15 19:32:10 +05:30
|
|
|
integer :: &
|
|
|
|
e, &
|
|
|
|
i, &
|
|
|
|
m, &
|
|
|
|
c, &
|
2020-09-19 13:30:49 +05:30
|
|
|
maxNconstituents
|
2020-08-15 19:32:10 +05:30
|
|
|
|
2020-10-01 16:13:05 +05:30
|
|
|
materials => config_material%get('material')
|
|
|
|
if(any(discretization_materialAt > materials%length)) &
|
|
|
|
call IO_error(155,ext_msg='More materials requested than found in material.yaml')
|
2020-08-15 19:32:10 +05:30
|
|
|
|
2020-10-01 16:13:05 +05:30
|
|
|
allocate(material_Nconstituents(materials%length),source=0)
|
|
|
|
do m = 1, materials%length
|
|
|
|
material => materials%get(m)
|
|
|
|
constituents => material%get('constituents')
|
|
|
|
material_Nconstituents(m) = constituents%length
|
2019-09-20 00:10:59 +05:30
|
|
|
enddo
|
2020-10-01 16:13:05 +05:30
|
|
|
maxNconstituents = maxval(material_Nconstituents)
|
2020-09-19 13:30:49 +05:30
|
|
|
|
2020-09-19 12:54:27 +05:30
|
|
|
allocate(material_homogenizationAt(discretization_nElem),source=0)
|
2020-08-15 19:32:10 +05:30
|
|
|
allocate(material_homogenizationMemberAt(discretization_nIP,discretization_nElem),source=0)
|
2020-09-19 13:30:49 +05:30
|
|
|
allocate(material_phaseAt(maxNconstituents,discretization_nElem),source=0)
|
|
|
|
allocate(material_phaseMemberAt(maxNconstituents,discretization_nIP,discretization_nElem),source=0)
|
2020-03-16 22:59:15 +05:30
|
|
|
|
2020-09-19 13:57:15 +05:30
|
|
|
allocate(material_orientation0(maxNconstituents,discretization_nIP,discretization_nElem))
|
|
|
|
|
2020-09-19 13:30:49 +05:30
|
|
|
phases => config_material%get('phase')
|
|
|
|
allocate(counterPhase(phases%length),source=0)
|
|
|
|
homogenization => config_material%get('homogenization')
|
|
|
|
allocate(counterHomogenization(homogenization%length),source=0)
|
2020-09-13 14:09:17 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
do e = 1, discretization_nElem
|
2020-10-01 16:13:05 +05:30
|
|
|
material => materials%get(discretization_materialAt(e))
|
|
|
|
constituents => material%get('constituents')
|
2020-09-19 13:30:49 +05:30
|
|
|
|
2020-10-01 16:13:05 +05:30
|
|
|
material_homogenizationAt(e) = homogenization%getIndex(material%get_asString('homogenization'))
|
2020-08-15 19:32:10 +05:30
|
|
|
do i = 1, discretization_nIP
|
2020-09-19 13:30:49 +05:30
|
|
|
counterHomogenization(material_homogenizationAt(e)) = counterHomogenization(material_homogenizationAt(e)) + 1
|
|
|
|
material_homogenizationMemberAt(i,e) = counterHomogenization(material_homogenizationAt(e))
|
2020-08-15 19:32:10 +05:30
|
|
|
enddo
|
2020-09-19 13:11:48 +05:30
|
|
|
|
2020-09-19 13:30:49 +05:30
|
|
|
frac = 0.0_pReal
|
|
|
|
do c = 1, constituents%length
|
|
|
|
constituent => constituents%get(c)
|
|
|
|
frac = frac + constituent%get_asFloat('fraction')
|
|
|
|
|
|
|
|
material_phaseAt(c,e) = phases%getIndex(constituent%get_asString('phase'))
|
|
|
|
do i = 1, discretization_nIP
|
|
|
|
counterPhase(material_phaseAt(c,e)) = counterPhase(material_phaseAt(c,e)) + 1
|
|
|
|
material_phaseMemberAt(c,i,e) = counterPhase(material_phaseAt(c,e))
|
|
|
|
|
2020-10-01 17:31:50 +05:30
|
|
|
call material_orientation0(c,i,e)%fromQuaternion(constituent%get_asFloats('O',requiredSize=4))
|
2018-06-25 18:58:15 +05:30
|
|
|
enddo
|
2020-09-19 13:30:49 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
enddo
|
2020-09-19 13:30:49 +05:30
|
|
|
if (dNeq(frac,1.0_pReal)) call IO_error(153,ext_msg='constituent')
|
|
|
|
|
2020-03-16 22:59:15 +05:30
|
|
|
enddo
|
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
end subroutine material_parseMicrostructure
|
2018-10-14 23:46:30 +05:30
|
|
|
|
2020-09-13 14:09:17 +05:30
|
|
|
|
2013-02-20 03:42:05 +05:30
|
|
|
end module material
|