From 02ee64bce4d54d2f7a2aa89c6a8b777dcc7e980c Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Wed, 1 Jul 2020 22:51:21 +0200 Subject: [PATCH] make use of submodule property --- src/constitutive.f90 | 26 ++++++++++++++++++ src/constitutive_plastic_isotropic.f90 | 25 ----------------- src/constitutive_plastic_kinehardening.f90 | 26 ------------------ src/constitutive_plastic_nonlocal.f90 | 32 ++-------------------- src/crystallite.f90 | 5 ---- src/grid/grid_mech_spectral_basic.f90 | 2 +- src/homogenization.f90 | 5 ---- 7 files changed, 29 insertions(+), 92 deletions(-) diff --git a/src/constitutive.f90 b/src/constitutive.f90 index cf7f5fa94..fa2424754 100644 --- a/src/constitutive.f90 +++ b/src/constitutive.f90 @@ -317,6 +317,20 @@ module constitutive end interface + + type :: tDebugOptions + logical :: & + basic, & + extensive, & + selective + integer :: & + element, & + ip, & + grain + end type tDebugOptions + + type(tDebugOptions) :: debug + public :: & plastic_nonlocal_updateCompatibility, & constitutive_init, & @@ -341,6 +355,18 @@ subroutine constitutive_init integer :: & ph, & !< counter in phase loop s !< counter in source loop + class (tNode), pointer :: & + debug_constitutive + + debug_constitutive => debug_root%get('constitutuve', defaultVal=emptyList) + debug%basic = debug_constitutive%contains('basic') + debug%extensive = debug_constitutive%contains('extensive') + debug%selective = debug_constitutive%contains('selective') + debug%element = debug_root%get_asInt('element',defaultVal = 1) + debug%ip = debug_root%get_asInt('integrationpoint',defaultVal = 1) + debug%grain = debug_root%get_asInt('grain',defaultVal = 1) + + !-------------------------------------------------------------------------------------------------- ! initialized plasticity if (any(phase_plasticity == PLASTICITY_NONE_ID)) call plastic_none_init diff --git a/src/constitutive_plastic_isotropic.f90 b/src/constitutive_plastic_isotropic.f90 index d8b799363..820454d5c 100644 --- a/src/constitutive_plastic_isotropic.f90 +++ b/src/constitutive_plastic_isotropic.f90 @@ -36,20 +36,6 @@ submodule(constitutive) plastic_isotropic gamma end type tIsotropicState -#ifdef DEBUG - type :: tDebugOptions - logical :: & - extensive, & - selective - integer :: & - element, & - ip, & - grain - end type tDebugOptions - - type(tDebugOptions) :: debug - -#endif !-------------------------------------------------------------------------------------------------- ! containers for parameters and state type(tParameters), allocatable, dimension(:) :: param @@ -74,8 +60,6 @@ module subroutine plastic_isotropic_init xi_0 !< initial critical stress character(len=pStringLen) :: & extmsg = '' - class(tNode), pointer :: & - debug_constitutive write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_ISOTROPIC_LABEL//' init -+>>>' @@ -85,15 +69,6 @@ module subroutine plastic_isotropic_init Ninstance = count(phase_plasticity == PLASTICITY_ISOTROPIC_ID) write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6) -#ifdef DEBUG - debug_constitutive => debug_root%get('constitutuve', defaultVal=emptyList) - debug%extensive = debug_constitutive%contains('extensive') - debug%selective = debug_constitutive%contains('selective') - debug%element = debug_root%get_asInt('element',defaultVal = 1) - debug%ip = debug_root%get_asInt('integrationpoint',defaultVal = 1) - debug%grain = debug_root%get_asInt('grain',defaultVal = 1) -#endif - allocate(param(Ninstance)) allocate(state(Ninstance)) allocate(dotState(Ninstance)) diff --git a/src/constitutive_plastic_kinehardening.f90 b/src/constitutive_plastic_kinehardening.f90 index f82b84641..cf77f5545 100644 --- a/src/constitutive_plastic_kinehardening.f90 +++ b/src/constitutive_plastic_kinehardening.f90 @@ -43,21 +43,6 @@ submodule(constitutive) plastic_kinehardening accshear !< accumulated (absolute) shear end type tKinehardeningState -#ifdef DEBUG - type :: tDebugOptions - logical :: & - extensive, & - selective - integer :: & - element, & - ip, & - grain - end type tDebugOptions - - type(tDebugOptions) :: debug - -#endif - !-------------------------------------------------------------------------------------------------- ! containers for parameters and state type(tParameters), allocatable, dimension(:) :: param @@ -88,23 +73,12 @@ module subroutine plastic_kinehardening_init a !< non-Schmid coefficients character(len=pStringLen) :: & extmsg = '' - class(tNode), pointer :: & - debug_constitutive write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_KINEHARDENING_LABEL//' init -+>>>' Ninstance = count(phase_plasticity == PLASTICITY_KINEHARDENING_ID) write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6) -#ifdef DEBUG - debug_constitutive => debug_root%get('constitutuve', defaultVal=emptyList) - debug%extensive = debug_constitutive%contains('extensive') - debug%selective = debug_constitutive%contains('selective') - debug%element = debug_root%get_asInt('element',defaultVal = 1) - debug%ip = debug_root%get_asInt('integrationpoint',defaultVal = 1) - debug%grain = debug_root%get_asInt('grain',defaultVal = 1) -#endif - allocate(param(Ninstance)) allocate(state(Ninstance)) allocate(dotState(Ninstance)) diff --git a/src/constitutive_plastic_nonlocal.f90 b/src/constitutive_plastic_nonlocal.f90 index 6469a0f87..3e0142af3 100644 --- a/src/constitutive_plastic_nonlocal.f90 +++ b/src/constitutive_plastic_nonlocal.f90 @@ -146,24 +146,8 @@ submodule(constitutive) plastic_nonlocal v_scr_pos, & v_scr_neg end type tNonlocalState - -#ifdef DEBUG - type :: tDebugOptions - logical :: & - basic, & - extensive, & - selective - integer :: & - element, & - ip, & - grain - end type tDebugOptions - - type(tDebugOptions) :: debug - -#endif - - type(tNonlocalState), allocatable, dimension(:) :: & + + type(tNonlocalState), allocatable, dimension(:) :: & deltaState, & dotState, & state, & @@ -194,8 +178,6 @@ module subroutine plastic_nonlocal_init extmsg = '' type(tInitialParameters) :: & ini - class(tNode), pointer :: & - debug_constitutive write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_NONLOCAL_LABEL//' init -+>>>' @@ -208,16 +190,6 @@ module subroutine plastic_nonlocal_init Ninstance = count(phase_plasticity == PLASTICITY_NONLOCAL_ID) write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6) -#ifdef DEBUG - debug_constitutive => debug_root%get('constitutuve', defaultVal=emptyList) - debug%basic = debug_constitutive%contains('basic') - debug%extensive = debug_constitutive%contains('extensive') - debug%selective = debug_constitutive%contains('selective') - debug%element = debug_root%get_asInt('element',defaultVal = 1) - debug%ip = debug_root%get_asInt('integrationpoint',defaultVal = 1) - debug%grain = debug_root%get_asInt('grain',defaultVal = 1) -#endif - allocate(param(Ninstance)) allocate(state(Ninstance)) allocate(state0(Ninstance)) diff --git a/src/crystallite.f90 b/src/crystallite.f90 index a3130cb7e..b7d51c1cc 100644 --- a/src/crystallite.f90 +++ b/src/crystallite.f90 @@ -98,7 +98,6 @@ module crystallite type(tNumerics) :: num ! numerics parameters. Better name? -#ifdef DEBUG type :: tDebugOptions logical :: & basic, & @@ -112,7 +111,6 @@ module crystallite type(tDebugOptions) :: debug -#endif procedure(integrateStateFPI), pointer :: integrateState @@ -151,7 +149,6 @@ subroutine crystallite_init write(6,'(/,a)') ' <<<+- crystallite init -+>>>' -#ifdef DEBUG debug_crystallite => debug_root%get('crystallite', defaultVal=emptyList) debug%basic = debug_crystallite%contains('basic') debug%extensive = debug_crystallite%contains('extensive') @@ -159,8 +156,6 @@ subroutine crystallite_init debug%element = debug_root%get_asInt('element', defaultVal=1) debug%ip = debug_root%get_asInt('integrationpoint', defaultVal=1) debug%grain = debug_root%get_asInt('grain', defaultVal=1) - -#endif cMax = homogenization_maxNgrains iMax = discretization_nIP diff --git a/src/grid/grid_mech_spectral_basic.f90 b/src/grid/grid_mech_spectral_basic.f90 index d1aa67283..a0392e452 100644 --- a/src/grid/grid_mech_spectral_basic.f90 +++ b/src/grid/grid_mech_spectral_basic.f90 @@ -478,7 +478,7 @@ subroutine formResidual(in, F, & newIteration: if (totalIter <= PETScIter) then totalIter = totalIter + 1 write(6,'(1x,a,3(a,i0))') trim(incInfo), ' @ Iteration ', num%itmin, '≤',totalIter, '≤', num%itmax - if (debug%rotation) & + if (debug_rotation) & write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') & ' deformation gradient aim (lab) =', transpose(params%rotation_BC%rotate(F_aim,active=.true.)) write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') & diff --git a/src/homogenization.f90 b/src/homogenization.f90 index e9aabf4b6..deeb87843 100644 --- a/src/homogenization.f90 +++ b/src/homogenization.f90 @@ -52,7 +52,6 @@ module homogenization type(tNumerics) :: num -#ifdef DEBUG type :: tDebugOptions logical :: & basic, & @@ -66,8 +65,6 @@ module homogenization type(tDebugOptions) :: debug -#endif - interface module subroutine mech_none_init @@ -155,7 +152,6 @@ subroutine homogenization_init num_homogGeneric, & debug_homogenization -#ifdef DEBUG debug_homogenization => debug_root%get('homogenization', defaultVal=emptyList) debug%basic = debug_homogenization%contains('basic') debug%extensive = debug_homogenization%contains('extensive') @@ -166,7 +162,6 @@ subroutine homogenization_init if (debug%grain < 1 .or. debug%grain > homogenization_Ngrains(material_homogenizationAt(debug%element))) & call IO_error(602,ext_msg='constituent', el=debug%element, g=debug%grain) -#endif num_homog => numerics_root%get('homogenization',defaultVal=emptyDict)