concatenated error reporting

This commit is contained in:
Philip Eisenlohr 2023-07-17 11:31:05 -04:00
parent 2bd216ab3a
commit 223d321a94
5 changed files with 42 additions and 40 deletions

View File

@ -88,6 +88,7 @@ subroutine grid_damage_spectral_init(num_grid)
character(len=pSTRLEN) :: &
snes_type
character(len=:), allocatable :: &
extmsg, &
petsc_options
@ -103,15 +104,17 @@ subroutine grid_damage_spectral_init(num_grid)
num_grid_damage => num_grid%get_dict('damage',defaultVal=emptyDict)
num%itmax = num_grid_damage%get_asInt('N_iter_max', defaultVal=100)
num%eps_damage_atol = num_grid_damage%get_asReal('eps_abs_phi',defaultVal=1.0e-2_pREAL)
num%eps_damage_rtol = num_grid_damage%get_asReal('eps_rel_phi',defaultVal=1.0e-6_pREAL)
num%phi_min = num_grid_damage%get_asReal('phi_min', defaultVal=1.0e-6_pREAL)
if (num%phi_min < 0.0_pREAL) call IO_error(301,ext_msg='phi_min')
if (num%itmax < 1) call IO_error(301,ext_msg='N_iter_max')
if (num%eps_damage_atol <= 0.0_pREAL) call IO_error(301,ext_msg='eps_abs_phi')
if (num%eps_damage_rtol <= 0.0_pREAL) call IO_error(301,ext_msg='eps_rel_phi')
extmsg = ''
if (num%eps_damage_atol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_abs_phi'
if (num%eps_damage_rtol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_rel_phi'
if (num%phi_min < 0.0_pReal) extmsg = trim(extmsg)//' phi_min'
if (num%itmax < 1) extmsg = trim(extmsg)//' N_iter_max'
if (extmsg /= '') call IO_error(301,ext_msg=trim(extmsg))
!--------------------------------------------------------------------------------------------------
! set default and user defined options for PETSc

View File

@ -121,9 +121,8 @@ subroutine grid_mechanical_FEM_init(num_grid)
integer(HID_T) :: fileHandle, groupHandle
type(tDict), pointer :: &
num_grid_mech
character(len=pSTRLEN) :: &
extmsg = ''
character(len=:), allocatable :: &
extmsg, &
petsc_options
@ -133,18 +132,18 @@ subroutine grid_mechanical_FEM_init(num_grid)
! read numerical parameters and do sanity checks
num_grid_mech => num_grid%get_dict('mechanical',defaultVal=emptyDict)
num%itmin = num_grid_mech%get_asInt('N_iter_min',defaultVal=1)
num%itmax = num_grid_mech%get_asInt('N_iter_max',defaultVal=100)
num%eps_div_atol = num_grid_mech%get_asReal('eps_abs_div(P)',defaultVal=1.0e-4_pREAL)
num%eps_div_rtol = num_grid_mech%get_asReal('eps_rel_div(P)',defaultVal=5.0e-4_pREAL)
num%eps_stress_atol = num_grid_mech%get_asReal('eps_abs_P', defaultVal=1.0e3_pREAL)
num%eps_stress_rtol = num_grid_mech%get_asReal('eps_rel_P', defaultVal=1.0e-3_pREAL)
num%itmin = num_grid_mech%get_asInt('N_iter_min',defaultVal=1)
num%itmax = num_grid_mech%get_asInt('N_iter_max',defaultVal=100)
if (num%eps_div_atol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_abs_div(P)'
if (num%eps_div_rtol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_rel_div(P)'
if (num%eps_stress_atol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_abs_P'
if (num%eps_stress_rtol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_rel_P'
extmsg = ''
if (num%eps_div_atol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_abs_div(P)'
if (num%eps_div_rtol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_rel_div(P)'
if (num%eps_stress_atol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_abs_P'
if (num%eps_stress_rtol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_rel_P'
if (num%itmax < 1) extmsg = trim(extmsg)//' N_iter_max'
if (num%itmin > num%itmax .or. num%itmin < 1) extmsg = trim(extmsg)//' N_iter_min'

View File

@ -117,9 +117,8 @@ subroutine grid_mechanical_spectral_basic_init(num_grid)
type(tDict), pointer :: &
num_grid_fft, &
num_grid_mech
character(len=pSTRLEN) :: &
extmsg = ''
character(len=:), allocatable :: &
extmsg, &
petsc_options
@ -139,16 +138,16 @@ subroutine grid_mechanical_spectral_basic_init(num_grid)
num%itmin = num_grid_mech%get_asInt ('N_iter_min',defaultVal=1)
num%itmax = num_grid_mech%get_asInt ('N_iter_max',defaultVal=100)
num%update_gamma = num_grid_mech%get_asBool ('update_gamma',defaultVal=.false.)
num%eps_div_atol = num_grid_mech%get_asReal('eps_abs_div(P)', defaultVal=1.0e-4_pREAL)
num%eps_div_rtol = num_grid_mech%get_asReal('eps_rel_div(P)', defaultVal=5.0e-4_pREAL)
num%eps_stress_atol = num_grid_mech%get_asReal('eps_abs_P', defaultVal=1.0e3_pREAL)
num%eps_stress_rtol = num_grid_mech%get_asReal('eps_rel_P', defaultVal=1.0e-3_pREAL)
if (num%eps_div_atol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_abs_div(P)'
if (num%eps_div_rtol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_rel_div(P)'
if (num%eps_stress_atol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_abs_P'
if (num%eps_stress_rtol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_rel_P'
extmsg = ''
if (num%eps_div_atol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_abs_div(P)'
if (num%eps_div_rtol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_rel_div(P)'
if (num%eps_stress_atol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_abs_P'
if (num%eps_stress_rtol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_rel_P'
if (num%itmax < 1) extmsg = trim(extmsg)//' N_iter_max'
if (num%itmin > num%itmax .or. num%itmin < 1) extmsg = trim(extmsg)//' N_iter_min'

View File

@ -131,9 +131,8 @@ subroutine grid_mechanical_spectral_polarization_init(num_grid)
type(tDict), pointer :: &
num_grid_fft,&
num_grid_mech
character(len=pSTRLEN) :: &
extmsg = ''
character(len=:), allocatable :: &
extmsg, &
petsc_options
@ -147,6 +146,8 @@ subroutine grid_mechanical_spectral_polarization_init(num_grid)
num_grid_fft => num_grid%get_dict('FFT',defaultVal=emptyDict)
num_grid_mech => num_grid%get_dict('mechanical',defaultVal=emptyDict)
num%itmin = num_grid_mech%get_asInt ('N_iter_min',defaultVal=1)
num%itmax = num_grid_mech%get_asInt ('N_iter_max',defaultVal=100)
num%update_gamma = num_grid_mech%get_asBool ('update_gamma',defaultVal=.false.)
num%eps_div_atol = num_grid_mech%get_asReal('eps_abs_div(P)', defaultVal=1.0e-4_pREAL)
num%eps_div_rtol = num_grid_mech%get_asReal('eps_rel_div(P)', defaultVal=5.0e-4_pREAL)
@ -157,19 +158,17 @@ subroutine grid_mechanical_spectral_polarization_init(num_grid)
num%alpha = num_grid_mech%get_asReal('alpha', defaultVal=1.0_pREAL)
num%beta = num_grid_mech%get_asReal('beta', defaultVal=1.0_pREAL)
num%itmin = num_grid_mech%get_asInt ('N_iter_min',defaultVal=1)
num%itmax = num_grid_mech%get_asInt ('N_iter_max',defaultVal=100)
if (num%eps_div_atol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_abs_div(P)'
if (num%eps_div_rtol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_rel_div(P)'
if (num%eps_curl_atol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_abs_curl(F)'
if (num%eps_curl_rtol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_rel_curl(F)'
if (num%eps_stress_atol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_abs_P'
if (num%eps_stress_rtol <= 0.0_pREAL) extmsg = trim(extmsg)//' eps_rel_P'
if (num%itmax < 1) extmsg = trim(extmsg)//' N_iter_max'
if (num%itmin > num%itmax .or. num%itmin < 1) extmsg = trim(extmsg)//' N_iter_min'
extmsg = ''
if (num%eps_div_atol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_abs_div(P)'
if (num%eps_div_rtol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_rel_div(P)'
if (num%eps_curl_atol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_abs_curl(F)'
if (num%eps_curl_rtol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_rel_curl(F)'
if (num%eps_stress_atol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_abs_P'
if (num%eps_stress_rtol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_rel_P'
if (num%alpha <= 0.0_pREAL .or. num%alpha > 2.0_pREAL) extmsg = trim(extmsg)//' alpha'
if (num%beta < 0.0_pREAL .or. num%beta > 2.0_pREAL) extmsg = trim(extmsg)//' beta'
if (num%itmax < 1) extmsg = trim(extmsg)//' N_iter_max'
if (num%itmin > num%itmax .or. num%itmin < 1) extmsg = trim(extmsg)//' N_iter_min'
if (extmsg /= '') call IO_error(301,ext_msg=trim(extmsg))

View File

@ -84,6 +84,7 @@ subroutine grid_thermal_spectral_init(num_grid)
type(tDict), pointer :: &
num_grid_thermal
character(len=:), allocatable :: &
extmsg, &
petsc_options
@ -99,14 +100,15 @@ subroutine grid_thermal_spectral_init(num_grid)
num_grid_thermal => num_grid%get_dict('thermal',defaultVal=emptyDict)
num%itmax = num_grid_thermal%get_asInt('N_iter_max', defaultVal=100)
num%eps_thermal_atol = num_grid_thermal%get_asReal('eps_abs_T', defaultVal=1.0e-2_pReal)
num%eps_thermal_rtol = num_grid_thermal%get_asReal('eps_rel_T', defaultVal=1.0e-6_pReal)
num%eps_thermal_atol = num_grid_thermal%get_asReal('eps_abs_T', defaultVal=1.0e-2_pREAL)
num%eps_thermal_rtol = num_grid_thermal%get_asReal('eps_rel_T', defaultVal=1.0e-6_pREAL)
if (num%itmax < 1) call IO_error(301,ext_msg='N_iter_max')
if (num%eps_thermal_atol <= 0.0_pREAL) call IO_error(301,ext_msg='eps_abs_T')
if (num%eps_thermal_rtol <= 0.0_pREAL) call IO_error(301,ext_msg='eps_rel_T')
extmsg = ''
if (num%eps_thermal_atol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_abs_T'
if (num%eps_thermal_rtol <= 0.0_pReal) extmsg = trim(extmsg)//' eps_rel_T'
if (num%itmax < 1) extmsg = trim(extmsg)//' N_iter_max'
if (extmsg /= '') call IO_error(301,ext_msg=trim(extmsg))
!--------------------------------------------------------------------------------------------------
! set default and user defined options for PETSc
petsc_options = IO_postfix('-snes_type newtonls -snes_mf -snes_ksp_ew -ksp_type fgmres '// &