From 99c2f5855332885a2bf8ead476f1824ed9748fd8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 12 Feb 2022 22:38:58 +0100 Subject: [PATCH] ensure that data is read --- src/phase_mechanical_elastic.f90 | 2 +- src/phase_thermal.f90 | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/phase_mechanical_elastic.f90 b/src/phase_mechanical_elastic.f90 index 7f30c8165..84ad7a20e 100644 --- a/src/phase_mechanical_elastic.f90 +++ b/src/phase_mechanical_elastic.f90 @@ -48,7 +48,7 @@ module subroutine elastic_init(phases) prm%C_11 = polynomial(elastic%asDict(),'C_11','T') prm%C_12 = polynomial(elastic%asDict(),'C_12','T') prm%C_44 = polynomial(elastic%asDict(),'C_44','T') - + if (any(phase_lattice(ph) == ['hP','tI'])) then prm%C_13 = polynomial(elastic%asDict(),'C_13','T') prm%C_33 = polynomial(elastic%asDict(),'C_33','T') diff --git a/src/phase_thermal.f90 b/src/phase_thermal.f90 index bc464d35a..11314531e 100644 --- a/src/phase_thermal.f90 +++ b/src/phase_thermal.f90 @@ -96,17 +96,24 @@ module subroutine thermal_init(phases) do ph = 1, phases%length Nmembers = count(material_phaseID == ph) - allocate(current(ph)%T(Nmembers),source=300.0_pReal) + allocate(current(ph)%T(Nmembers),source=T_ROOM) allocate(current(ph)%dot_T(Nmembers),source=0.0_pReal) phase => phases%get(ph) thermal => phase%get('thermal',defaultVal=emptyDict) - param(ph)%C_p = thermal%get_asFloat('C_p',defaultVal=0.0_pReal) ! ToDo: make mandatory? - param(ph)%K(1,1) = thermal%get_asFloat('K_11',defaultVal=0.0_pReal) ! ToDo: make mandatory? - param(ph)%K(3,3) = thermal%get_asFloat('K_33',defaultVal=0.0_pReal) ! ToDo: depends on symmtery - param(ph)%K = lattice_symmetrize_33(param(ph)%K,phase_lattice(ph)) - sources => thermal%get('source',defaultVal=emptyList) - thermal_Nsources(ph) = sources%length + ! ToDo: temperature dependency of K and C_p + if (thermal%length > 0) then + param(ph)%C_p = thermal%get_asFloat('C_p') + param(ph)%K(1,1) = thermal%get_asFloat('K_11') + if (any(phase_lattice(ph) == ['hP','tI'])) param(ph)%K(3,3) = thermal%get_asFloat('K_33') + param(ph)%K = lattice_symmetrize_33(param(ph)%K,phase_lattice(ph)) + + sources => thermal%get('source',defaultVal=emptyList) + thermal_Nsources(ph) = sources%length + else + thermal_Nsources(ph) = 0 + end if + allocate(thermalstate(ph)%p(thermal_Nsources(ph))) enddo