From 5eb44969cc6d52a3458c90f27a815cd8b4197b44 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 7 Apr 2021 11:48:04 +0200 Subject: [PATCH] no need to do this globally --- src/homogenization.f90 | 14 ------------ src/homogenization_mechanical.f90 | 36 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 49addd098..f08b62560 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -515,14 +515,12 @@ end function damage_nonlocal_getDiffusion !-------------------------------------------------------------------------------------------------- !> @brief parses the homogenization part from the material configuration -! ToDo: This should be done in homogenization !-------------------------------------------------------------------------------------------------- subroutine material_parseHomogenization class(tNode), pointer :: & material_homogenization, & homog, & - homogMech, & homogThermal, & homogDamage @@ -530,23 +528,11 @@ subroutine material_parseHomogenization material_homogenization => config_material%get('homogenization') - allocate(homogenization_type(size(material_name_homogenization)), source=HOMOGENIZATION_undefined_ID) allocate(thermal_type(size(material_name_homogenization)), source=THERMAL_isothermal_ID) allocate(damage_type (size(material_name_homogenization)), source=DAMAGE_none_ID) do h=1, size(material_name_homogenization) homog => material_homogenization%get(h) - homogMech => homog%get('mechanical') - select case (homogMech%get_asString('type')) - case('pass') - homogenization_type(h) = HOMOGENIZATION_NONE_ID - case('isostrain') - homogenization_type(h) = HOMOGENIZATION_ISOSTRAIN_ID - case('RGC') - homogenization_type(h) = HOMOGENIZATION_RGC_ID - case default - call IO_error(500,ext_msg=homogMech%get_asString('type')) - end select if (homog%contains('thermal')) then homogThermal => homog%get('thermal') diff --git a/src/homogenization_mechanical.f90 b/src/homogenization_mechanical.f90 index 954aac403..3b75a66f0 100644 --- a/src/homogenization_mechanical.f90 +++ b/src/homogenization_mechanical.f90 @@ -86,6 +86,8 @@ module subroutine mechanical_init(num_homog) print'(/,a)', ' <<<+- homogenization:mechanical init -+>>>' + call material_parseHomogenization2() + allocate(homogenization_dPdF(3,3,3,3,discretization_nIPs*discretization_Nelems), source=0.0_pReal) homogenization_F0 = spread(math_I3,3,discretization_nIPs*discretization_Nelems) ! initialize to identity homogenization_F = homogenization_F0 ! initialize to identity @@ -244,4 +246,38 @@ module subroutine mechanical_results(group_base,ho) end subroutine mechanical_results +!-------------------------------------------------------------------------------------------------- +!> @brief parses the homogenization part from the material configuration +!-------------------------------------------------------------------------------------------------- +subroutine material_parseHomogenization2() + + class(tNode), pointer :: & + material_homogenization, & + homog, & + homogMech + + integer :: h + + material_homogenization => config_material%get('homogenization') + + allocate(homogenization_type(size(material_name_homogenization)), source=HOMOGENIZATION_undefined_ID) + + do h=1, size(material_name_homogenization) + homog => material_homogenization%get(h) + homogMech => homog%get('mechanical') + select case (homogMech%get_asString('type')) + case('pass') + homogenization_type(h) = HOMOGENIZATION_NONE_ID + case('isostrain') + homogenization_type(h) = HOMOGENIZATION_ISOSTRAIN_ID + case('RGC') + homogenization_type(h) = HOMOGENIZATION_RGC_ID + case default + call IO_error(500,ext_msg=homogMech%get_asString('type')) + end select + enddo + +end subroutine material_parseHomogenization2 + + end submodule mechanical