sanity checks

This commit is contained in:
Sharan Roongta 2020-06-17 15:21:51 +02:00
parent 1e2df54bb0
commit e455dd4b9a
5 changed files with 22 additions and 7 deletions

View File

@ -138,6 +138,11 @@ subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyS
num_commercialFEM => numerics_root%get('commercialFEM',defaultVal=emptyDict)
iJacoStiffness = num_commercialFEM%get_asInt('ijacostiffness',defaultVal=1)
!----------------------------------------------------------------------
! sanity check
if (iJacoStiffness < 1) call IO_error(301,ext_msg='iJacoStiffness')
!----------------------------------------------------------------------
elCP = mesh_FEM2DAMASK_elem(elFE)
if (iand(debug_level(debug_CPFEM), debug_levelBasic) /= 0_pInt &

View File

@ -7,6 +7,7 @@ module damage_nonlocal
use material
use config
use numerics
use YAML_types
use crystallite
use lattice
use source_damage_isoBrittle
@ -138,6 +139,13 @@ function damage_nonlocal_getDiffusion(ip,el)
integer :: &
homog, &
grain
real(pReal) :: &
charLength !< characteristic length scale for gradient problems
class(tNode), pointer :: &
num_generic
num_generic => numerics_root%get('generic',defaultVal= emptyDict)
charLength = num_generic%get_asFloat('charLength',defaultVal=1.0_pReal)
homog = material_homogenizationAt(el)
damage_nonlocal_getDiffusion = 0.0_pReal

View File

@ -108,7 +108,7 @@ subroutine grid_mech_spectral_basic_init
write(6,'(a)') ' https://doi.org/10.1016/j.ijplas.2014.02.006'
num_grid => numerics_root%get('grid',defaultVal=emptyDict)
num%update_gamma = num_grid%get_asInt('update_gamma',defaultVal=0) > 0 !ToDo: Make boolean
num%update_gamma = num_grid%get_asBool('update_gamma',defaultVal=.false.)
!--------------------------------------------------------------------------------------------------
! set default and user defined options for PETSc

View File

@ -114,7 +114,7 @@ subroutine grid_mech_spectral_polarisation_init
write(6,'(a)') ' https://doi.org/10.1016/j.ijplas.2014.02.006'
num_grid => numerics_root%get('grid',defaultVal=emptyDict)
num%update_gamma = num_grid%get_asInt('update_gamma',defaultVal=0) > 0
num%update_gamma = num_grid%get_asBool('update_gamma',defaultVal=.false.)
!--------------------------------------------------------------------------------------------------
! set default and user defined options for PETSc
@ -517,6 +517,12 @@ subroutine formResidual(in, FandF_tau, &
polarAlpha = num_grid%get_asFloat('polaralpha',defaultVal=1.0_pReal)
polarBeta = num_grid%get_asFloat('polarbeta', defaultVal=1.0_pReal)
!-----------------------------------------------------------------------------------------------
! sanity checks
if (polarAlpha <= 0.0_pReal .or. polarAlpha > 2.0_pReal) call IO_error(301,ext_msg='polarAlpha')
if (polarBeta < 0.0_pReal .or. polarBeta > 2.0_pReal) call IO_error(301,ext_msg='polarBeta')
!------------------------------------------------------------------------------------------------
F => FandF_tau(1:3,1:3,1,&
XG_RANGE,YG_RANGE,ZG_RANGE)
F_tau => FandF_tau(1:3,1:3,2,&

View File

@ -27,7 +27,6 @@ module numerics
DAMASK_NumThreadsInt = 0 !< value stored in environment variable DAMASK_NUM_THREADS, set to zero if no OpenMP directive
real(pReal), protected, public :: &
numerics_unitlength = 1.0_pReal, & !< determines the physical length of one computational length unit
charLength = 1.0_pReal, & !< characteristic length scale for gradient problems
residualStiffness = 1.0e-6_pReal !< non-zero residual damage
!--------------------------------------------------------------------------------------------------
@ -63,7 +62,7 @@ contains
!--------------------------------------------------------------------------------------------------
subroutine numerics_init
!$ integer :: gotDAMASK_NUM_THREADS = 1
integer :: i,j, ierr
integer :: i, ierr
character(len=:), allocatable :: &
numerics_input, &
numerics_inFlow, &
@ -129,8 +128,6 @@ subroutine numerics_init
!--------------------------------------------------------------------------------------------------
! gradient parameter
case ('charLength')
charLength = num_generic%get_asFloat(key)
case ('residualStiffness')
residualStiffness = num_generic%get_asFloat(key)
endselect
@ -147,7 +144,6 @@ subroutine numerics_init
!--------------------------------------------------------------------------------------------------
! gradient parameter
write(6,'(a24,1x,es8.1)') ' charLength: ',charLength
write(6,'(a24,1x,es8.1)') ' residualStiffness: ',residualStiffness
!--------------------------------------------------------------------------------------------------