From c2ae2c919be1896d670b940ac2703a1c0f3c8490 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 24 Jan 2021 15:19:57 +0100 Subject: [PATCH] use new structure --- src/grid/grid_thermal_spectral.f90 | 4 +--- src/homogenization.f90 | 13 +++++++++---- src/homogenization_thermal.f90 | 16 ++++++++++++---- src/thermal_conduction.f90 | 13 +------------ src/thermal_isothermal.f90 | 13 +------------ 5 files changed, 24 insertions(+), 35 deletions(-) diff --git a/src/grid/grid_thermal_spectral.f90 b/src/grid/grid_thermal_spectral.f90 index 44d9e22b1..4b80c1d72 100644 --- a/src/grid/grid_thermal_spectral.f90 +++ b/src/grid/grid_thermal_spectral.f90 @@ -132,7 +132,7 @@ subroutine grid_thermal_spectral_init ce = 0 do k = 1, grid3; do j = 1, grid(2); do i = 1,grid(1) ce = ce + 1 - T_current(i,j,k) = temperature(material_homogenizationAt(ce))%p(material_homogenizationMemberAt(1,ce)) + T_current(i,j,k) = homogenization_thermal_T(ce) T_lastInc(i,j,k) = T_current(i,j,k) T_stagInc(i,j,k) = T_current(i,j,k) enddo; enddo; enddo @@ -194,7 +194,6 @@ function grid_thermal_spectral_solution(timeinc) result(solution) call homogenization_thermal_setField(T_current(i,j,k), & (T_current(i,j,k)-T_lastInc(i,j,k))/params%timeinc, & ce) - homogenization_T(ce) = T_current(i,j,k) enddo; enddo; enddo call VecMin(solution_vec,devNull,T_min,ierr); CHKERRQ(ierr) @@ -239,7 +238,6 @@ subroutine grid_thermal_spectral_forward(cutBack) call homogenization_thermal_setField(T_current(i,j,k), & (T_current(i,j,k)-T_lastInc(i,j,k))/params%timeinc, & ce) - homogenization_T(ce) = T_current(i,j,k) enddo; enddo; enddo else T_lastInc = T_current diff --git a/src/homogenization.f90 b/src/homogenization.f90 index f316d3969..51d339da9 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -28,8 +28,6 @@ module homogenization !-------------------------------------------------------------------------------------------------- ! General variables for the homogenization at a material point real(pReal), dimension(:), allocatable, public :: & - homogenization_T, & - homogenization_dot_T, & homogenization_phi, & homogenization_dot_phi real(pReal), dimension(:,:,:), allocatable, public :: & @@ -136,6 +134,12 @@ module homogenization real(pReal), intent(in) :: T, dot_T end subroutine homogenization_thermal_setField + + module function homogenization_thermal_T(ce) result(T) + integer, intent(in) :: ce + real(pReal) :: T + end function homogenization_thermal_T + end interface public :: & @@ -145,6 +149,7 @@ module homogenization thermal_conduction_getConductivity, & thermal_conduction_getMassDensity, & homogenization_thermal_setfield, & + homogenization_thermal_T, & homogenization_forward, & homogenization_results, & homogenization_restartRead, & @@ -182,8 +187,8 @@ subroutine homogenization_init() call thermal_init() call damage_init() - if (any(thermal_type == THERMAL_isothermal_ID)) call thermal_isothermal_init(homogenization_T) - if (any(thermal_type == THERMAL_conduction_ID)) call thermal_conduction_init(homogenization_T) + if (any(thermal_type == THERMAL_isothermal_ID)) call thermal_isothermal_init() + if (any(thermal_type == THERMAL_conduction_ID)) call thermal_conduction_init() if (any(damage_type == DAMAGE_none_ID)) call damage_none_init if (any(damage_type == DAMAGE_nonlocal_ID)) call damage_nonlocal_init diff --git a/src/homogenization_thermal.f90 b/src/homogenization_thermal.f90 index 80137f13a..b9cbccc66 100644 --- a/src/homogenization_thermal.f90 +++ b/src/homogenization_thermal.f90 @@ -37,9 +37,6 @@ module subroutine thermal_init() print'(/,a)', ' <<<+- homogenization_thermal init -+>>>' - allocate(homogenization_T(discretization_nIPs*discretization_Nelems)) - allocate(homogenization_dot_T(discretization_nIPs*discretization_Nelems)) - configHomogenizations => config_material%get('homogenization') allocate(param(configHomogenizations%length)) allocate(current(configHomogenizations%length)) @@ -92,7 +89,7 @@ module subroutine thermal_homogenize(ip,el) integer, intent(in) :: ip,el - call constitutive_thermal_getRate(homogenization_dot_T((el-1)*discretization_nIPs+ip), ip,el) + !call constitutive_thermal_getRate(homogenization_dot_T((el-1)*discretization_nIPs+ip), ip,el) end subroutine thermal_homogenize @@ -182,4 +179,15 @@ module subroutine homogenization_thermal_setField(T,dot_T, ce) end subroutine homogenization_thermal_setField + +module function homogenization_thermal_T(ce) result(T) + + integer, intent(in) :: ce + real(pReal) :: T + + T = current(material_homogenizationAt2(ce))%T(material_homogenizationMemberAt2(ce)) + +end function homogenization_thermal_T + + end submodule homogenization_thermal diff --git a/src/thermal_conduction.f90 b/src/thermal_conduction.f90 index ccca75026..84521afde 100644 --- a/src/thermal_conduction.f90 +++ b/src/thermal_conduction.f90 @@ -36,9 +36,7 @@ contains !> @brief module initialization !> @details reads in material parameters, allocates arrays, and does sanity checks !-------------------------------------------------------------------------------------------------- -subroutine thermal_conduction_init(T) - - real(pReal), dimension(:), intent(inout) :: T +subroutine thermal_conduction_init() integer :: Ninstances,Nmaterialpoints,ho,ip,el,ce class(tNode), pointer :: & @@ -73,15 +71,6 @@ subroutine thermal_conduction_init(T) end associate enddo - ce = 0 - do el = 1, discretization_Nelems - do ip = 1, discretization_nIPs - ce = ce + 1 - ho = material_homogenizationAt(el) - if (thermal_type(ho) == THERMAL_conduction_ID) T(ce) = thermal_initialT(ho) - enddo - enddo - end subroutine thermal_conduction_init diff --git a/src/thermal_isothermal.f90 b/src/thermal_isothermal.f90 index 09e35931e..e3dee2901 100644 --- a/src/thermal_isothermal.f90 +++ b/src/thermal_isothermal.f90 @@ -16,9 +16,7 @@ contains !-------------------------------------------------------------------------------------------------- !> @brief allocates fields, reads information from material configuration file !-------------------------------------------------------------------------------------------------- -subroutine thermal_isothermal_init(T) - - real(pReal), dimension(:), intent(inout) :: T +subroutine thermal_isothermal_init() integer :: Ninstances,Nmaterialpoints,ho,ip,el,ce @@ -34,15 +32,6 @@ subroutine thermal_isothermal_init(T) enddo - ce = 0 - do el = 1, discretization_Nelems - do ip = 1, discretization_nIPs - ce = ce + 1 - ho = material_homogenizationAt(el) - if (thermal_type(ho) == THERMAL_isothermal_ID) T(ce) = thermal_initialT(ho) - enddo - enddo - end subroutine thermal_isothermal_init end module thermal_isothermal