used for both grid & mesh; polishing

This commit is contained in:
Sharan Roongta 2020-06-17 23:00:03 +02:00
parent ac2539b305
commit 0fc482585b
10 changed files with 525 additions and 497 deletions

@ -1 +1 @@
Subproject commit 017b38d79deb4720368927b8a884527e2b331c23
Subproject commit bcc65dbb3557d6f154eb63b4651909a9e8fd7bb0

View File

@ -112,6 +112,15 @@ program DAMASK_grid
allocate(solres(nActiveFields))
allocate(newLoadCase%ID(nActiveFields))
!-------------------------------------------------------------------------------------------------
! 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)
if (stagItMax < 0) call IO_error(301,ext_msg='maxStaggeredIter')
if (maxCutBack < 0) call IO_error(301,ext_msg='maxCutBack')
!--------------------------------------------------------------------------------------------------
! assign mechanics solver depending on selected type
@ -148,14 +157,6 @@ program DAMASK_grid
end select
!-------------------------------------------------------------------------------------------------
! 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)
if (stagItMax < 0) call IO_error(301,ext_msg='maxStaggeredIter')
if (maxCutBack < 0) call IO_error(301,ext_msg='maxCutBack')
!--------------------------------------------------------------------------------------------------
! reading information from load case file and to sanity checks

View File

@ -60,13 +60,22 @@ subroutine grid_damage_spectral_init
DM :: damage_grid
Vec :: uBound, lBound
PetscErrorCode :: ierr
character(len=pStringLen) :: snes_type
class(tNode), pointer :: &
num_generic
character(len=pStringLen) :: &
snes_type, &
petsc_options
write(6,'(/,a)') ' <<<+- grid_spectral_damage init -+>>>'
write(6,'(/,a)') ' Shanthraj et al., Handbook of Mechanics of Materials, 2019'
write(6,'(a)') ' https://doi.org/10.1007/978-981-10-6855-3_80'
!-------------------------------------------------------------------------------------------------
! read numerical parameter
num_generic => numerics_root%get('generic',defaultVal=emptyDict)
petsc_options = num_generic%get_asString('petsc_options',defaultVal='')
!--------------------------------------------------------------------------------------------------
! set default and user defined options for PETSc
call PETScOptionsInsertString(PETSC_NULL_OPTIONS,'-damage_snes_type newtonls -damage_snes_mf &

View File

@ -96,13 +96,22 @@ subroutine grid_mech_FEM_init
1.0_pReal, 1.0_pReal, 1.0_pReal, 1.0_pReal], [4,8])
PetscErrorCode :: ierr
integer(HID_T) :: fileHandle, groupHandle
character(len=pStringLen) :: fileName
character(len=pStringLen) :: &
fileName, &
petsc_options
class(tNode), pointer :: &
num_generic
real(pReal), dimension(3,3,3,3) :: devNull
PetscScalar, pointer, dimension(:,:,:,:) :: &
u_current,u_lastInc
write(6,'(/,a)') ' <<<+- grid_mech_FEM init -+>>>'; flush(6)
!-------------------------------------------------------------------------------------------------
! read numerical parameter
num_generic => numerics_root%get('generic',defaultVal=emptyDict)
petsc_options = num_generic%get_asString('petsc_options',defaultVal='')
!--------------------------------------------------------------------------------------------------
! set default and user defined options for PETSc
call PETScOptionsInsertString(PETSC_NULL_OPTIONS,'-mech_snes_type newtonls -mech_ksp_type fgmres &

View File

@ -89,7 +89,8 @@ subroutine grid_mech_spectral_basic_init
real(pReal), dimension(3,3) :: &
temp33_Real = 0.0_pReal
class (tNode), pointer :: &
num_grid
num_grid, &
num_generic
PetscErrorCode :: ierr
PetscScalar, pointer, dimension(:,:,:,:) :: &
@ -97,7 +98,9 @@ subroutine grid_mech_spectral_basic_init
PetscInt, dimension(worldsize) :: localK
integer(HID_T) :: fileHandle, groupHandle
integer :: fileUnit
character(len=pStringLen) :: fileName
character(len=pStringLen) :: &
fileName, &
petsc_options
write(6,'(/,a)') ' <<<+- grid_mech_spectral_basic init -+>>>'; flush(6)
@ -107,6 +110,11 @@ subroutine grid_mech_spectral_basic_init
write(6,'(/,a)') ' Shanthraj et al., International Journal of Plasticity 66:3145, 2015'
write(6,'(a)') ' https://doi.org/10.1016/j.ijplas.2014.02.006'
!-------------------------------------------------------------------------------------------------
! 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)
num%update_gamma = num_grid%get_asBool('update_gamma',defaultVal=.false.)

View File

@ -96,7 +96,8 @@ subroutine grid_mech_spectral_polarisation_init
real(pReal), dimension(3,3) :: &
temp33_Real = 0.0_pReal
class (tNode), pointer :: &
num_grid
num_grid, &
num_generic
PetscErrorCode :: ierr
PetscScalar, pointer, dimension(:,:,:,:) :: &
@ -106,13 +107,20 @@ subroutine grid_mech_spectral_polarisation_init
PetscInt, dimension(0:worldsize-1) :: localK
integer(HID_T) :: fileHandle, groupHandle
integer :: fileUnit
character(len=pStringLen) :: fileName
character(len=pStringLen) :: &
fileName, &
petsc_options
write(6,'(/,a)') ' <<<+- grid_mech_spectral_polarisation init -+>>>'; flush(6)
write(6,'(/,a)') ' Shanthraj et al., International Journal of Plasticity 66:3145, 2015'
write(6,'(a)') ' https://doi.org/10.1016/j.ijplas.2014.02.006'
!-------------------------------------------------------------------------------------------------
! 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)
num%update_gamma = num_grid%get_asBool('update_gamma',defaultVal=.false.)

View File

@ -62,12 +62,21 @@ subroutine grid_thermal_spectral_init
DM :: thermal_grid
PetscScalar, dimension(:,:,:), pointer :: x_scal
PetscErrorCode :: ierr
class(tNode), pointer :: &
num_generic
character(len=pStringLen) :: &
petsc_options
write(6,'(/,a)') ' <<<+- grid_thermal_spectral init -+>>>'
write(6,'(/,a)') ' Shanthraj et al., Handbook of Mechanics of Materials, 2019'
write(6,'(a)') ' https://doi.org/10.1007/978-981-10-6855-3_80'
!-------------------------------------------------------------------------------------------------
! read numerical parameter
num_generic => numerics_root%get('generic',defaultVal=emptyDict)
petsc_options = num_generic%get_asString('petsc_options',defaultVal='')
!--------------------------------------------------------------------------------------------------
! set default and user defined options for PETSc
call PETScOptionsInsertString(PETSC_NULL_OPTIONS,'-thermal_snes_type ngmres',ierr)

View File

@ -189,8 +189,11 @@ subroutine spectral_utilities_init
scalarSize = 1_C_INTPTR_T, &
vecSize = 3_C_INTPTR_T, &
tensorSize = 9_C_INTPTR_T
character(len=pStringLen) :: &
petsc_options
class (tNode) , pointer :: &
num_grid
num_grid, &
num_generic
write(6,'(/,a)') ' <<<+- spectral_utilities init -+>>>'
@ -217,6 +220,9 @@ 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='')
call PETScOptionsClear(PETSC_NULL_OPTIONS,ierr)
CHKERRQ(ierr)
if(debugPETSc) call PETScOptionsInsertString(PETSC_NULL_OPTIONS,trim(PETSCDEBUG),ierr)

View File

@ -103,9 +103,11 @@ subroutine FEM_utilities_init
character(len=pStringLen) :: petsc_optionsOrder
class(tNode), pointer :: &
num_mesh
num_mesh, &
num_generic
integer :: structOrder !< order of displacement shape functions
character(len=pStringLen) :: &
petsc_options
PetscErrorCode :: ierr
write(6,'(/,a)') ' <<<+- DAMASK_FEM_utilities init -+>>>'
@ -113,6 +115,9 @@ 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='')
!--------------------------------------------------------------------------------------------------
! set debugging parameters
debugPETSc = iand(debug_level(debug_SPECTRAL),debug_SPECTRALPETSC) /= 0

View File

@ -26,20 +26,6 @@ module numerics
integer(4), protected, public :: &
DAMASK_NumThreadsInt = 0 !< value stored in environment variable DAMASK_NUM_THREADS, set to zero if no OpenMP directive
!--------------------------------------------------------------------------------------------------
! spectral parameters:
#ifdef Grid
character(len=pStringLen), protected, public :: &
petsc_options
#endif
!--------------------------------------------------------------------------------------------------
! Mesh parameters:
#ifdef Mesh
character(len=pStringLen), protected, public :: &
petsc_options
#endif
public :: numerics_init
contains
@ -56,8 +42,6 @@ subroutine numerics_init
character(len=:), allocatable :: &
numerics_input, &
numerics_inFlow
class (tNode), pointer :: &
num_grid
logical :: fexist
!$ character(len=6) DAMASK_NumThreadsString ! environment variable DAMASK_NUM_THREADS
@ -86,12 +70,6 @@ subroutine numerics_init
numerics_input = IO_read('numerics.yaml')
numerics_inFlow = to_flow(numerics_input)
numerics_root => parse_flow(numerics_inFlow,defaultVal=emptyDict)
!--------------------------------------------------------------------------------------------------
! grid parameters
num_grid => numerics_root%get('grid',defaultVal=emptyDict)
#ifdef PETSC
petsc_options = num_grid%get_asString('petsc_options',defaultVal = '')
#endif
else fileExists
write(6,'(a,/)') ' using standard values'
flush(6)
@ -101,11 +79,6 @@ subroutine numerics_init
! openMP parameter
!$ write(6,'(a24,1x,i8,/)') ' number of threads: ',DAMASK_NumThreadsInt
!--------------------------------------------------------------------------------------------------
#ifdef PETSC
write(6,'(a24,1x,a)') ' PETSc_options: ',trim(petsc_options)
#endif
end subroutine numerics_init
end module numerics