From 7c4afe06c9cfe9db116d0ab75b949a50b44202a3 Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Fri, 19 Jun 2020 02:32:33 +0200 Subject: [PATCH] less generic variables --- PRIVATE | 2 +- src/grid/DAMASK_grid.f90 | 11 ++++----- src/grid/grid_damage_spectral.f90 | 12 +++++----- src/grid/grid_mech_FEM.f90 | 22 ++++++++---------- src/grid/grid_mech_spectral_basic.f90 | 24 ++++++++------------ src/grid/grid_mech_spectral_polarisation.f90 | 24 +++++++------------- src/grid/grid_thermal_spectral.f90 | 12 +++++----- src/grid/spectral_utilities.f90 | 9 +++----- src/mesh/DAMASK_mesh.f90 | 8 +++---- src/mesh/FEM_utilities.f90 | 7 ++---- src/mesh/mesh_mech_FEM.f90 | 13 +++++------ 11 files changed, 60 insertions(+), 84 deletions(-) diff --git a/PRIVATE b/PRIVATE index 6f818e871..f391a36c2 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 6f818e871d6415fa4ebe2a5781920bad614d02e8 +Subproject commit f391a36c2e829f2cb4db2297271941168f7fd7d8 diff --git a/src/grid/DAMASK_grid.f90 b/src/grid/DAMASK_grid.f90 index c2ac2ea58..e151222c2 100644 --- a/src/grid/DAMASK_grid.f90 +++ b/src/grid/DAMASK_grid.f90 @@ -92,8 +92,7 @@ program DAMASK_grid external :: & quit class (tNode), pointer :: & - num_grid, & - num_generic + num_grid !-------------------------------------------------------------------------------------------------- ! init DAMASK (all modules) @@ -114,9 +113,9 @@ program DAMASK_grid !------------------------------------------------------------------------------------------------- ! reading field paramters from numerics file and do sanity checks - num_generic => numerics_root%get('generic', defaultVal=emptyDict) - stagItMax = num_generic%get_asInt('maxStaggeredIter',defaultVal=10) - maxCutBack = num_generic%get_asInt('maxCutBack',defaultVal=3) + num_grid => numerics_root%get('grid', defaultVal=emptyDict) + stagItMax = num_grid%get_asInt('maxStaggeredIter',defaultVal=10) + maxCutBack = num_grid%get_asInt('maxCutBack',defaultVal=3) if (stagItMax < 0) call IO_error(301,ext_msg='maxStaggeredIter') if (maxCutBack < 0) call IO_error(301,ext_msg='maxCutBack') @@ -124,8 +123,6 @@ program DAMASK_grid !-------------------------------------------------------------------------------------------------- ! assign mechanics solver depending on selected type - num_grid => numerics_root%get('grid',defaultVal=emptyDict) - select case (trim(num_grid%get_asString('solver', defaultVal = 'Basic'))) case ('Basic') mech_init => grid_mech_spectral_basic_init diff --git a/src/grid/grid_damage_spectral.f90 b/src/grid/grid_damage_spectral.f90 index ffc3b4cc2..659b111a3 100644 --- a/src/grid/grid_damage_spectral.f90 +++ b/src/grid/grid_damage_spectral.f90 @@ -61,7 +61,7 @@ subroutine grid_damage_spectral_init Vec :: uBound, lBound PetscErrorCode :: ierr class(tNode), pointer :: & - num_generic + num_grid character(len=pStringLen) :: & snes_type, & petsc_options @@ -73,8 +73,8 @@ subroutine grid_damage_spectral_init !------------------------------------------------------------------------------------------------- ! read numerical parameter - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - petsc_options = num_generic%get_asString('petsc_options',defaultVal='') + num_grid => numerics_root%get('grid',defaultVal=emptyDict) + petsc_options = num_grid%get_asString('petsc_options',defaultVal='') !-------------------------------------------------------------------------------------------------- ! set default and user defined options for PETSc @@ -150,7 +150,7 @@ function grid_damage_spectral_solution(timeinc,timeinc_old) result(solution) itmax !< maximum number of iterations type(tSolutionState) :: solution class(tNode), pointer :: & - num_generic + num_grid PetscInt :: devNull PetscReal :: phi_min, phi_max, stagNorm, solnNorm @@ -159,8 +159,8 @@ function grid_damage_spectral_solution(timeinc,timeinc_old) result(solution) !------------------------------------------------------------------- ! reading numerical parameter and do sanity check - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - itmax = num_generic%get_asInt('itmax',defaultVal=250) + num_grid => numerics_root%get('grid',defaultVal=emptyDict) + itmax = num_grid%get_asInt('itmax',defaultVal=250) if (itmax <= 1) call IO_error(301,ext_msg='itmax') solution%converged =.false. diff --git a/src/grid/grid_mech_FEM.f90 b/src/grid/grid_mech_FEM.f90 index 03709040f..bdd76b423 100644 --- a/src/grid/grid_mech_FEM.f90 +++ b/src/grid/grid_mech_FEM.f90 @@ -100,7 +100,7 @@ subroutine grid_mech_FEM_init fileName, & petsc_options class(tNode), pointer :: & - num_generic + num_grid real(pReal), dimension(3,3,3,3) :: devNull PetscScalar, pointer, dimension(:,:,:,:) :: & u_current,u_lastInc @@ -109,8 +109,8 @@ subroutine grid_mech_FEM_init !------------------------------------------------------------------------------------------------- ! read numerical parameter - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - petsc_options = num_generic%get_asString('petsc_options',defaultVal='') + num_grid => numerics_root%get('grid',defaultVal=emptyDict) + petsc_options = num_grid%get_asString('petsc_options',defaultVal='') !-------------------------------------------------------------------------------------------------- ! set default and user defined options for PETSc @@ -431,8 +431,7 @@ subroutine converged(snes_local,PETScIter,devNull1,devNull2,fnorm,reason,dummy,i eps_stress_atol, & !< absolute tolerance for fullfillment of stress BC eps_stress_rtol !< relative tolerance for fullfillment of stress BC class(tNode), pointer :: & - num_grid, & - num_generic + num_grid !----------------------------------------------------------------------------------- ! reading numerical parameters and do sanity check @@ -442,9 +441,8 @@ subroutine converged(snes_local,PETScIter,devNull1,devNull2,fnorm,reason,dummy,i eps_stress_atol = num_grid%get_asFloat('eps_stress_atol',defaultVal=1.0e3_pReal) eps_stress_rtol = num_grid%get_asFloat('eps_stress_rtol',defaultVal=0.01_pReal) - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - itmin = num_generic%get_asInt('itmin',defaultVal=1) - itmax = num_generic%get_asInt('itmax',defaultVal=250) + itmin = num_grid%get_asInt('itmin',defaultVal=1) + itmax = num_grid%get_asInt('itmax',defaultVal=250) if (eps_div_atol <= 0.0_pReal) call IO_error(301,ext_msg='eps_div_atol') if (eps_div_rtol < 0.0_pReal) call IO_error(301,ext_msg='eps_div_rtol') @@ -505,13 +503,13 @@ subroutine formResidual(da_local,x_local, & itmin, & itmax class(tNode), pointer :: & - num_generic + num_grid !---------------------------------------------------------------------- ! read numerical paramteters and do sanity checks - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - itmin = num_generic%get_asInt('itmin',defaultVal=1) - itmax = num_generic%get_asInt('itmax',defaultVal=250) + num_grid => numerics_root%get('grid',defaultVal=emptyDict) + itmin = num_grid%get_asInt('itmin',defaultVal=1) + itmax = num_grid%get_asInt('itmax',defaultVal=250) if (itmax <= 1) call IO_error(301,ext_msg='itmax') if (itmin > itmax .or. itmin < 1) call IO_error(301,ext_msg='itmin') diff --git a/src/grid/grid_mech_spectral_basic.f90 b/src/grid/grid_mech_spectral_basic.f90 index e754b0d64..61ac18779 100644 --- a/src/grid/grid_mech_spectral_basic.f90 +++ b/src/grid/grid_mech_spectral_basic.f90 @@ -89,8 +89,7 @@ subroutine grid_mech_spectral_basic_init real(pReal), dimension(3,3) :: & temp33_Real = 0.0_pReal class (tNode), pointer :: & - num_grid, & - num_generic + num_grid PetscErrorCode :: ierr PetscScalar, pointer, dimension(:,:,:,:) :: & @@ -112,10 +111,8 @@ subroutine grid_mech_spectral_basic_init !------------------------------------------------------------------------------------------------- ! read numerical parameters - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - petsc_options = num_generic%get_asString('petsc_options',defaultVal='') - num_grid => numerics_root%get('grid',defaultVal=emptyDict) + petsc_options = num_grid%get_asString('petsc_options',defaultVal='') num%update_gamma = num_grid%get_asBool('update_gamma',defaultVal=.false.) !-------------------------------------------------------------------------------------------------- @@ -403,8 +400,8 @@ subroutine converged(snes_local,PETScIter,devNull1,devNull2,devNull3,reason,dumm eps_stress_atol, & !< absolute tolerance for fullfillment of stress BC eps_stress_rtol !< relative tolerance for fullfillment of stress BC class(tNode), pointer :: & - num_grid, & - num_generic + num_grid + !----------------------------------------------------------------------------------- ! reading numerical parameters and do sanity check num_grid => numerics_root%get('grid',defaultVal=emptyDict) @@ -413,9 +410,8 @@ subroutine converged(snes_local,PETScIter,devNull1,devNull2,devNull3,reason,dumm eps_stress_atol = num_grid%get_asFloat('eps_stress_atol',defaultVal=1.0e3_pReal) eps_stress_rtol = num_grid%get_asFloat('eps_stress_rtol',defaultVal=0.01_pReal) - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - itmin = num_generic%get_asInt('itmin',defaultVal=1) - itmax = num_generic%get_asInt('itmax',defaultVal=250) + itmin = num_grid%get_asInt('itmin',defaultVal=1) + itmax = num_grid%get_asInt('itmax',defaultVal=250) if (eps_div_atol <= 0.0_pReal) call IO_error(301,ext_msg='eps_div_atol') if (eps_div_rtol < 0.0_pReal) call IO_error(301,ext_msg='eps_div_rtol') @@ -474,13 +470,13 @@ subroutine formResidual(in, F, & itmin, & itmax class(tNode), pointer :: & - num_generic + num_grid !---------------------------------------------------------------------- ! read numerical paramteter and do sanity checks - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - itmin = num_generic%get_asInt('itmin',defaultVal=1) - itmax = num_generic%get_asInt('itmax',defaultVal=250) + num_grid => numerics_root%get('grid',defaultVal=emptyDict) + itmin = num_grid%get_asInt('itmin',defaultVal=1) + itmax = num_grid%get_asInt('itmax',defaultVal=250) if (itmax <= 1) call IO_error(301,ext_msg='itmax') if (itmin > itmax .or. itmin < 1) call IO_error(301,ext_msg='itmin') diff --git a/src/grid/grid_mech_spectral_polarisation.f90 b/src/grid/grid_mech_spectral_polarisation.f90 index 33b84c340..a32216615 100644 --- a/src/grid/grid_mech_spectral_polarisation.f90 +++ b/src/grid/grid_mech_spectral_polarisation.f90 @@ -96,8 +96,7 @@ subroutine grid_mech_spectral_polarisation_init real(pReal), dimension(3,3) :: & temp33_Real = 0.0_pReal class (tNode), pointer :: & - num_grid, & - num_generic + num_grid PetscErrorCode :: ierr PetscScalar, pointer, dimension(:,:,:,:) :: & @@ -118,10 +117,8 @@ subroutine grid_mech_spectral_polarisation_init !------------------------------------------------------------------------------------------------- ! read numerical parameters - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - petsc_options = num_generic%get_asString('petsc_options',defaultVal='') - num_grid => numerics_root%get('grid',defaultVal=emptyDict) + petsc_options = num_grid%get_asString('petsc_options',defaultVal='') num%update_gamma = num_grid%get_asBool('update_gamma',defaultVal=.false.) !-------------------------------------------------------------------------------------------------- @@ -453,8 +450,7 @@ subroutine converged(snes_local,PETScIter,devNull1,devNull2,devNull3,reason,dumm eps_stress_atol, & !< absolute tolerance for fullfillment of stress BC eps_stress_rtol !< relative tolerance for fullfillment of stress BC class(tNode), pointer :: & - num_grid, & - num_generic + num_grid !----------------------------------------------------------------------------------- ! reading numerical parameters and do sanity check @@ -466,9 +462,8 @@ subroutine converged(snes_local,PETScIter,devNull1,devNull2,devNull3,reason,dumm eps_stress_atol = num_grid%get_asFloat('eps_stress_atol',defaultVal=1.0e3_pReal) eps_stress_rtol = num_grid%get_asFloat('eps_stress_rtol',defaultVal=0.01_pReal) - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - itmin = num_generic%get_asInt('itmin',defaultVal=1) - itmax = num_generic%get_asInt('itmax',defaultVal=250) + itmin = num_grid%get_asInt('itmin',defaultVal=1) + itmax = num_grid%get_asInt('itmax',defaultVal=250) if (eps_div_atol <= 0.0_pReal) call IO_error(301,ext_msg='eps_div_atol') if (eps_div_rtol < 0.0_pReal) call IO_error(301,ext_msg='eps_div_rtol') @@ -533,8 +528,7 @@ subroutine formResidual(in, FandF_tau, & PetscObject :: dummy PetscErrorCode :: ierr class(tNode), pointer :: & - num_grid, & - num_generic + num_grid real(pReal) :: & polarAlpha, & !< polarization scheme parameter 0.0 < alpha < 2.0. alpha = 1.0 ==> AL scheme, alpha = 2.0 ==> accelerated scheme polarBeta !< polarization scheme parameter 0.0 < beta < 2.0. beta = 1.0 ==> AL scheme, beta = 2.0 ==> accelerated scheme @@ -547,10 +541,8 @@ subroutine formResidual(in, FandF_tau, & num_grid => numerics_root%get('grid',defaultVal = emptyDict) polarAlpha = num_grid%get_asFloat('polaralpha',defaultVal=1.0_pReal) polarBeta = num_grid%get_asFloat('polarbeta', defaultVal=1.0_pReal) - - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - itmin = num_generic%get_asInt('itmin',defaultVal=1) - itmax = num_generic%get_asInt('itmax',defaultVal=250) + itmin = num_grid%get_asInt('itmin',defaultVal=1) + itmax = num_grid%get_asInt('itmax',defaultVal=250) if (itmax <= 1) call IO_error(301,ext_msg='itmax') if (itmin > itmax .or. itmin < 1) call IO_error(301,ext_msg='itmin') diff --git a/src/grid/grid_thermal_spectral.f90 b/src/grid/grid_thermal_spectral.f90 index 418330411..ee64566a6 100644 --- a/src/grid/grid_thermal_spectral.f90 +++ b/src/grid/grid_thermal_spectral.f90 @@ -63,7 +63,7 @@ subroutine grid_thermal_spectral_init PetscScalar, dimension(:,:,:), pointer :: x_scal PetscErrorCode :: ierr class(tNode), pointer :: & - num_generic + num_grid character(len=pStringLen) :: & petsc_options @@ -74,8 +74,8 @@ subroutine grid_thermal_spectral_init !------------------------------------------------------------------------------------------------- ! read numerical parameter - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - petsc_options = num_generic%get_asString('petsc_options',defaultVal='') + num_grid => numerics_root%get('grid',defaultVal=emptyDict) + petsc_options = num_grid%get_asString('petsc_options',defaultVal='') !-------------------------------------------------------------------------------------------------- ! set default and user defined options for PETSc @@ -147,7 +147,7 @@ function grid_thermal_spectral_solution(timeinc,timeinc_old) result(solution) itmax !< maximum number of iterations type(tSolutionState) :: solution class(tNode), pointer :: & - num_generic + num_grid PetscInt :: devNull PetscReal :: T_min, T_max, stagNorm, solnNorm @@ -156,8 +156,8 @@ function grid_thermal_spectral_solution(timeinc,timeinc_old) result(solution) !------------------------------------------------------------------- ! reading numerical parameter and do sanity check - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - itmax = num_generic%get_asInt('itmax',defaultVal=250) + num_grid => numerics_root%get('grid',defaultVal=emptyDict) + itmax = num_grid%get_asInt('itmax',defaultVal=250) if (itmax <= 1) call IO_error(301,ext_msg='itmax') solution%converged =.false. diff --git a/src/grid/spectral_utilities.f90 b/src/grid/spectral_utilities.f90 index d8e922343..f09759009 100644 --- a/src/grid/spectral_utilities.f90 +++ b/src/grid/spectral_utilities.f90 @@ -192,8 +192,7 @@ subroutine spectral_utilities_init character(len=pStringLen) :: & petsc_options class (tNode) , pointer :: & - num_grid, & - num_generic + num_grid write(6,'(/,a)') ' <<<+- spectral_utilities init -+>>>' @@ -220,8 +219,8 @@ subroutine spectral_utilities_init trim(PETScDebug), & ' add more using the PETSc_Options keyword in numerics.config '; flush(6) - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - petsc_options = num_generic%get_asString('petsc_options',defaultVal='') + num_grid => numerics_root%get('grid',defaultVal=emptyDict) + petsc_options = num_grid%get_asString('petsc_options',defaultVal='') call PETScOptionsClear(PETSC_NULL_OPTIONS,ierr) CHKERRQ(ierr) @@ -236,8 +235,6 @@ subroutine spectral_utilities_init write(6,'(/,a,3(i12 ))') ' grid a b c: ', grid write(6,'(a,3(es12.5))') ' size x y z: ', geomSize - num_grid => numerics_root%get('grid',defaultVal=emptyDict) - num%memory_efficient = num_grid%get_asInt ('memory_efficient', defaultVal=1) > 0 num%FFTW_timelimit = num_grid%get_asFloat ('fftw_timelimit', defaultVal=-1.0_pReal) num%divergence_correction = num_grid%get_asInt ('divergence_correction', defaultVal=2) diff --git a/src/mesh/DAMASK_mesh.f90 b/src/mesh/DAMASK_mesh.f90 index 0e4a02cf2..72fa53566 100644 --- a/src/mesh/DAMASK_mesh.f90 +++ b/src/mesh/DAMASK_mesh.f90 @@ -60,7 +60,7 @@ program DAMASK_mesh stagItMax, & !< max number of field level staggered iterations component class(tNode), pointer :: & - num_generic + num_mesh character(len=pStringLen), dimension(:), allocatable :: fileContent character(len=pStringLen) :: & incInfo, & @@ -80,9 +80,9 @@ program DAMASK_mesh !--------------------------------------------------------------------- ! reading field information from numerics file and do sanity checks - num_generic => numerics_root%get('generic', defaultVal=emptyDict) - stagItMax = num_generic%get_asInt('maxStaggeredIter',defaultVal=10) - maxCutBack = num_generic%get_asInt('maxCutBack',defaultVal=3) + num_mesh => numerics_root%get('mesh', defaultVal=emptyDict) + stagItMax = num_mesh%get_asInt('maxStaggeredIter',defaultVal=10) + maxCutBack = num_mesh%get_asInt('maxCutBack',defaultVal=3) if (stagItMax < 0) call IO_error(301,ext_msg='maxStaggeredIter') if (maxCutBack < 0) call IO_error(301,ext_msg='maxCutBack') diff --git a/src/mesh/FEM_utilities.f90 b/src/mesh/FEM_utilities.f90 index f7e00f42c..a8479913e 100644 --- a/src/mesh/FEM_utilities.f90 +++ b/src/mesh/FEM_utilities.f90 @@ -103,8 +103,7 @@ subroutine FEM_utilities_init character(len=pStringLen) :: petsc_optionsOrder class(tNode), pointer :: & - num_mesh, & - num_generic + num_mesh integer :: structOrder !< order of displacement shape functions character(len=pStringLen) :: & petsc_options @@ -114,9 +113,7 @@ subroutine FEM_utilities_init num_mesh => numerics_root%get('mesh',defaultVal=emptyDict) structOrder = num_mesh%get_asInt('structOrder',defaultVal = 2) - - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - petsc_options = num_generic%get_asString('petsc_options', defaultVal='') + petsc_options = num_mesh%get_asString('petsc_options', defaultVal='') !-------------------------------------------------------------------------------------------------- ! set debugging parameters diff --git a/src/mesh/mesh_mech_FEM.f90 b/src/mesh/mesh_mech_FEM.f90 index a094a4d38..715b02c0d 100644 --- a/src/mesh/mesh_mech_FEM.f90 +++ b/src/mesh/mesh_mech_FEM.f90 @@ -96,8 +96,7 @@ subroutine FEM_mech_init(fieldBC) PetscErrorCode :: ierr class(tNode), pointer :: & - num_mesh, & - num_generic + num_mesh integer :: & integrationOrder, & !< order of quadrature rule required itmax @@ -109,8 +108,8 @@ subroutine FEM_mech_init(fieldBC) num_mesh => numerics_root%get('mesh',defaultVal=emptyDict) integrationOrder = num_mesh%get_asInt('integrationorder',defaultVal = 2) - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - itmax = num_generic%get_asInt('itmax',defaultVal=250) + num_mesh => numerics_root%get('mesh',defaultVal=emptyDict) + itmax = num_mesh%get_asInt('itmax',defaultVal=250) if (itmax <= 1) call IO_error(301,ext_msg='itmax') !-------------------------------------------------------------------------------------------------- @@ -286,15 +285,15 @@ type(tSolutionState) function FEM_mech_solution( & integer :: & itmax class(tNode), pointer :: & - num_generic + num_mesh PetscErrorCode :: ierr SNESConvergedReason :: reason !-------------------------------------------------------------------------------------------------- ! read numerical parameter and do sanity check - num_generic => numerics_root%get('generic',defaultVal=emptyDict) - itmax = num_generic%get_asInt('itmax',defaultVal=250) + num_mesh => numerics_root%get('mesh',defaultVal=emptyDict) + itmax = num_mesh%get_asInt('itmax',defaultVal=250) if (itmax <= 1) call IO_error(301,ext_msg='itmax') !-------------------------------------------------------------------------------------------------