distributing responsibility

This commit is contained in:
Martin Diehl 2021-04-11 08:46:31 +02:00
parent 4b89e2f40c
commit 34bb4c65a9
2 changed files with 24 additions and 1 deletions

View File

@ -2,6 +2,12 @@
!> @brief internal microstructure state for all damage sources and kinematics constitutive models
!----------------------------------------------------------------------------------------------------
submodule(phase) damage
type :: tDamageParameters
real(pReal) :: mu = 0.0_pReal !< viscosity
real(pReal), dimension(3,3) :: K = 0.0_pReal !< conductivity/diffusivity
end type tDamageParameters
enum, bind(c); enumerator :: &
DAMAGE_UNDEFINED_ID, &
DAMAGE_ISOBRITTLE_ID, &
@ -16,13 +22,15 @@ submodule(phase) damage
end type tDataContainer
integer(kind(DAMAGE_UNDEFINED_ID)), dimension(:), allocatable :: &
phase_source !< active sources mechanisms of each phase
phase_source !< active sources mechanisms of each phase
integer, dimension(:), allocatable :: &
phase_Nsources
type(tDataContainer), dimension(:), allocatable :: current
type(tDamageParameters), dimension(:), allocatable :: param
interface
module function anisobrittle_init() result(mySources)
@ -111,6 +119,7 @@ module subroutine damage_init
allocate(damageState (phases%length))
allocate(phase_Nsources(phases%length),source = 0)
allocate(param(phases%length))
do ph = 1,phases%length
@ -121,6 +130,9 @@ module subroutine damage_init
phase => phases%get(ph)
sources => phase%get('damage',defaultVal=emptyList)
param(ph)%K(1,1) = sources%get_asFloat('K_11',defaultVal=0.0_pReal)
param(ph)%K(2,2) = sources%get_asFloat('K_22',defaultVal=0.0_pReal)
param(ph)%K(3,3) = sources%get_asFloat('K_33',defaultVal=0.0_pReal)
if (sources%length > 1) error stop
phase_Nsources(ph) = sources%length

View File

@ -3,6 +3,11 @@
!----------------------------------------------------------------------------------------------------
submodule(phase) thermal
type :: tThermalParameters
real(pReal) :: C_p = 0.0_pReal !< heat capacity
real(pReal), dimension(3,3) :: K = 0.0_pReal !< thermal conductivity
end type tThermalParameters
integer, dimension(:), allocatable :: &
thermal_Nsources
@ -23,6 +28,8 @@ submodule(phase) thermal
type(tDataContainer), dimension(:), allocatable :: current ! ?? not very telling name. Better: "field" ?? MD: current(ho)%T(me) reads quite good
type(tThermalParameters), dimension(:), allocatable :: param
integer :: thermal_source_maxSizeDotState
@ -85,6 +92,7 @@ module subroutine thermal_init(phases)
allocate(thermalState(phases%length))
allocate(thermal_Nsources(phases%length),source = 0)
allocate(param(phases%length))
do ph = 1, phases%length
Nmembers = count(material_phaseID == ph)
@ -93,6 +101,9 @@ module subroutine thermal_init(phases)
phase => phases%get(ph)
thermal => phase%get('thermal',defaultVal=emptyDict)
sources => thermal%get('source',defaultVal=emptyList)
param(ph)%K(1,1) = thermal%get_asFloat('K_11',defaultVal=0.0_pReal)
param(ph)%K(2,2) = thermal%get_asFloat('K_22',defaultVal=0.0_pReal)
param(ph)%K(3,3) = thermal%get_asFloat('K_33',defaultVal=0.0_pReal)
thermal_Nsources(ph) = sources%length
allocate(thermalstate(ph)%p(thermal_Nsources(ph)))
enddo