From 339d081dd5d8ce07bf7ac1770975b38ad0ae02fc Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 23 Feb 2022 05:42:44 +0100 Subject: [PATCH] simplified logic to reflect what we are doing --- src/homogenization.f90 | 45 +++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/src/homogenization.f90 b/src/homogenization.f90 index 85c5fefce..70e8256f6 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -23,10 +23,6 @@ module homogenization enum, bind(c); enumerator :: & - THERMAL_ISOTHERMAL_ID, & - THERMAL_CONDUCTION_ID, & - DAMAGE_NONE_ID, & - DAMAGE_NONLOCAL_ID, & HOMOGENIZATION_UNDEFINED_ID, & HOMOGENIZATION_NONE_ID, & HOMOGENIZATION_ISOSTRAIN_ID, & @@ -37,10 +33,9 @@ module homogenization homogState, & damageState_h - integer(kind(THERMAL_isothermal_ID)), dimension(:), allocatable :: & - thermal_type !< thermal transport model - integer(kind(DAMAGE_none_ID)), dimension(:), allocatable :: & - damage_type !< nonlocal damage model + logical, allocatable, dimension(:) :: & + thermal_active, & + damage_active logical, public :: & terminallyIll = .false. !< at least one material point is terminally ill @@ -182,9 +177,7 @@ module homogenization homogenization_forward, & homogenization_results, & homogenization_restartRead, & - homogenization_restartWrite, & - THERMAL_CONDUCTION_ID, & - DAMAGE_NONLOCAL_ID + homogenization_restartWrite contains @@ -351,19 +344,17 @@ subroutine homogenization_results call mechanical_results(group_base,ho) - select case(damage_type(ho)) - case(DAMAGE_NONLOCAL_ID) - group = trim(group_base)//'/damage' - call results_closeGroup(results_addGroup(group)) - call damage_results(ho,group) - end select + if (damage_active(ho)) then + group = trim(group_base)//'/damage' + call results_closeGroup(results_addGroup(group)) + call damage_results(ho,group) + end if - select case(thermal_type(ho)) - case(THERMAL_CONDUCTION_ID) - group = trim(group_base)//'/thermal' - call results_closeGroup(results_addGroup(group)) - call thermal_results(ho,group) - end select + if (thermal_active(ho)) then + group = trim(group_base)//'/thermal' + call results_closeGroup(results_addGroup(group)) + call thermal_results(ho,group) + end if enddo @@ -457,8 +448,8 @@ subroutine parseHomogenization material_homogenization => config_material%get('homogenization') - allocate(thermal_type(size(material_name_homogenization)),source=THERMAL_isothermal_ID) - allocate(damage_type (size(material_name_homogenization)),source=DAMAGE_none_ID) + allocate(thermal_active(size(material_name_homogenization)),source=.false.) + allocate(damage_active(size(material_name_homogenization)),source=.false.) do h=1, size(material_name_homogenization) homog => material_homogenization%get(h) @@ -467,7 +458,7 @@ subroutine parseHomogenization homogThermal => homog%get('thermal') select case (homogThermal%get_asString('type')) case('pass','isotemperature') - thermal_type(h) = THERMAL_conduction_ID + thermal_active(h) = .true. case default call IO_error(500,ext_msg=homogThermal%get_asString('type')) end select @@ -477,7 +468,7 @@ subroutine parseHomogenization homogDamage => homog%get('damage') select case (homogDamage%get_asString('type')) case('pass') - damage_type(h) = DAMAGE_nonlocal_ID + damage_active(h) = .true. case default call IO_error(500,ext_msg=homogDamage%get_asString('type')) end select