used for both grid & mesh; polishing
This commit is contained in:
parent
ac2539b305
commit
0fc482585b
2
PRIVATE
2
PRIVATE
|
@ -1 +1 @@
|
||||||
Subproject commit 017b38d79deb4720368927b8a884527e2b331c23
|
Subproject commit bcc65dbb3557d6f154eb63b4651909a9e8fd7bb0
|
|
@ -112,6 +112,15 @@ program DAMASK_grid
|
||||||
allocate(solres(nActiveFields))
|
allocate(solres(nActiveFields))
|
||||||
allocate(newLoadCase%ID(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
|
! assign mechanics solver depending on selected type
|
||||||
|
|
||||||
|
@ -148,14 +157,6 @@ program DAMASK_grid
|
||||||
|
|
||||||
end select
|
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
|
! reading information from load case file and to sanity checks
|
||||||
|
|
|
@ -60,13 +60,22 @@ subroutine grid_damage_spectral_init
|
||||||
DM :: damage_grid
|
DM :: damage_grid
|
||||||
Vec :: uBound, lBound
|
Vec :: uBound, lBound
|
||||||
PetscErrorCode :: ierr
|
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)') ' <<<+- grid_spectral_damage init -+>>>'
|
||||||
|
|
||||||
write(6,'(/,a)') ' Shanthraj et al., Handbook of Mechanics of Materials, 2019'
|
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'
|
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
|
! set default and user defined options for PETSc
|
||||||
call PETScOptionsInsertString(PETSC_NULL_OPTIONS,'-damage_snes_type newtonls -damage_snes_mf &
|
call PETScOptionsInsertString(PETSC_NULL_OPTIONS,'-damage_snes_type newtonls -damage_snes_mf &
|
||||||
|
|
|
@ -96,13 +96,22 @@ subroutine grid_mech_FEM_init
|
||||||
1.0_pReal, 1.0_pReal, 1.0_pReal, 1.0_pReal], [4,8])
|
1.0_pReal, 1.0_pReal, 1.0_pReal, 1.0_pReal], [4,8])
|
||||||
PetscErrorCode :: ierr
|
PetscErrorCode :: ierr
|
||||||
integer(HID_T) :: fileHandle, groupHandle
|
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
|
real(pReal), dimension(3,3,3,3) :: devNull
|
||||||
PetscScalar, pointer, dimension(:,:,:,:) :: &
|
PetscScalar, pointer, dimension(:,:,:,:) :: &
|
||||||
u_current,u_lastInc
|
u_current,u_lastInc
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- grid_mech_FEM init -+>>>'; flush(6)
|
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
|
! set default and user defined options for PETSc
|
||||||
call PETScOptionsInsertString(PETSC_NULL_OPTIONS,'-mech_snes_type newtonls -mech_ksp_type fgmres &
|
call PETScOptionsInsertString(PETSC_NULL_OPTIONS,'-mech_snes_type newtonls -mech_ksp_type fgmres &
|
||||||
|
|
|
@ -89,7 +89,8 @@ subroutine grid_mech_spectral_basic_init
|
||||||
real(pReal), dimension(3,3) :: &
|
real(pReal), dimension(3,3) :: &
|
||||||
temp33_Real = 0.0_pReal
|
temp33_Real = 0.0_pReal
|
||||||
class (tNode), pointer :: &
|
class (tNode), pointer :: &
|
||||||
num_grid
|
num_grid, &
|
||||||
|
num_generic
|
||||||
|
|
||||||
PetscErrorCode :: ierr
|
PetscErrorCode :: ierr
|
||||||
PetscScalar, pointer, dimension(:,:,:,:) :: &
|
PetscScalar, pointer, dimension(:,:,:,:) :: &
|
||||||
|
@ -97,7 +98,9 @@ subroutine grid_mech_spectral_basic_init
|
||||||
PetscInt, dimension(worldsize) :: localK
|
PetscInt, dimension(worldsize) :: localK
|
||||||
integer(HID_T) :: fileHandle, groupHandle
|
integer(HID_T) :: fileHandle, groupHandle
|
||||||
integer :: fileUnit
|
integer :: fileUnit
|
||||||
character(len=pStringLen) :: fileName
|
character(len=pStringLen) :: &
|
||||||
|
fileName, &
|
||||||
|
petsc_options
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- grid_mech_spectral_basic init -+>>>'; flush(6)
|
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:31–45, 2015'
|
write(6,'(/,a)') ' Shanthraj et al., International Journal of Plasticity 66:31–45, 2015'
|
||||||
write(6,'(a)') ' https://doi.org/10.1016/j.ijplas.2014.02.006'
|
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_grid => numerics_root%get('grid',defaultVal=emptyDict)
|
||||||
num%update_gamma = num_grid%get_asBool('update_gamma',defaultVal=.false.)
|
num%update_gamma = num_grid%get_asBool('update_gamma',defaultVal=.false.)
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,8 @@ subroutine grid_mech_spectral_polarisation_init
|
||||||
real(pReal), dimension(3,3) :: &
|
real(pReal), dimension(3,3) :: &
|
||||||
temp33_Real = 0.0_pReal
|
temp33_Real = 0.0_pReal
|
||||||
class (tNode), pointer :: &
|
class (tNode), pointer :: &
|
||||||
num_grid
|
num_grid, &
|
||||||
|
num_generic
|
||||||
|
|
||||||
PetscErrorCode :: ierr
|
PetscErrorCode :: ierr
|
||||||
PetscScalar, pointer, dimension(:,:,:,:) :: &
|
PetscScalar, pointer, dimension(:,:,:,:) :: &
|
||||||
|
@ -106,13 +107,20 @@ subroutine grid_mech_spectral_polarisation_init
|
||||||
PetscInt, dimension(0:worldsize-1) :: localK
|
PetscInt, dimension(0:worldsize-1) :: localK
|
||||||
integer(HID_T) :: fileHandle, groupHandle
|
integer(HID_T) :: fileHandle, groupHandle
|
||||||
integer :: fileUnit
|
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)') ' <<<+- grid_mech_spectral_polarisation init -+>>>'; flush(6)
|
||||||
|
|
||||||
write(6,'(/,a)') ' Shanthraj et al., International Journal of Plasticity 66:31–45, 2015'
|
write(6,'(/,a)') ' Shanthraj et al., International Journal of Plasticity 66:31–45, 2015'
|
||||||
write(6,'(a)') ' https://doi.org/10.1016/j.ijplas.2014.02.006'
|
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_grid => numerics_root%get('grid',defaultVal=emptyDict)
|
||||||
num%update_gamma = num_grid%get_asBool('update_gamma',defaultVal=.false.)
|
num%update_gamma = num_grid%get_asBool('update_gamma',defaultVal=.false.)
|
||||||
|
|
||||||
|
|
|
@ -62,12 +62,21 @@ subroutine grid_thermal_spectral_init
|
||||||
DM :: thermal_grid
|
DM :: thermal_grid
|
||||||
PetscScalar, dimension(:,:,:), pointer :: x_scal
|
PetscScalar, dimension(:,:,:), pointer :: x_scal
|
||||||
PetscErrorCode :: ierr
|
PetscErrorCode :: ierr
|
||||||
|
class(tNode), pointer :: &
|
||||||
|
num_generic
|
||||||
|
character(len=pStringLen) :: &
|
||||||
|
petsc_options
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- grid_thermal_spectral init -+>>>'
|
write(6,'(/,a)') ' <<<+- grid_thermal_spectral init -+>>>'
|
||||||
|
|
||||||
write(6,'(/,a)') ' Shanthraj et al., Handbook of Mechanics of Materials, 2019'
|
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'
|
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
|
! set default and user defined options for PETSc
|
||||||
call PETScOptionsInsertString(PETSC_NULL_OPTIONS,'-thermal_snes_type ngmres',ierr)
|
call PETScOptionsInsertString(PETSC_NULL_OPTIONS,'-thermal_snes_type ngmres',ierr)
|
||||||
|
|
|
@ -189,8 +189,11 @@ subroutine spectral_utilities_init
|
||||||
scalarSize = 1_C_INTPTR_T, &
|
scalarSize = 1_C_INTPTR_T, &
|
||||||
vecSize = 3_C_INTPTR_T, &
|
vecSize = 3_C_INTPTR_T, &
|
||||||
tensorSize = 9_C_INTPTR_T
|
tensorSize = 9_C_INTPTR_T
|
||||||
|
character(len=pStringLen) :: &
|
||||||
|
petsc_options
|
||||||
class (tNode) , pointer :: &
|
class (tNode) , pointer :: &
|
||||||
num_grid
|
num_grid, &
|
||||||
|
num_generic
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- spectral_utilities init -+>>>'
|
write(6,'(/,a)') ' <<<+- spectral_utilities init -+>>>'
|
||||||
|
|
||||||
|
@ -217,6 +220,9 @@ subroutine spectral_utilities_init
|
||||||
trim(PETScDebug), &
|
trim(PETScDebug), &
|
||||||
' add more using the PETSc_Options keyword in numerics.config '; flush(6)
|
' 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)
|
call PETScOptionsClear(PETSC_NULL_OPTIONS,ierr)
|
||||||
CHKERRQ(ierr)
|
CHKERRQ(ierr)
|
||||||
if(debugPETSc) call PETScOptionsInsertString(PETSC_NULL_OPTIONS,trim(PETSCDEBUG),ierr)
|
if(debugPETSc) call PETScOptionsInsertString(PETSC_NULL_OPTIONS,trim(PETSCDEBUG),ierr)
|
||||||
|
|
|
@ -103,9 +103,11 @@ subroutine FEM_utilities_init
|
||||||
|
|
||||||
character(len=pStringLen) :: petsc_optionsOrder
|
character(len=pStringLen) :: petsc_optionsOrder
|
||||||
class(tNode), pointer :: &
|
class(tNode), pointer :: &
|
||||||
num_mesh
|
num_mesh, &
|
||||||
|
num_generic
|
||||||
integer :: structOrder !< order of displacement shape functions
|
integer :: structOrder !< order of displacement shape functions
|
||||||
|
character(len=pStringLen) :: &
|
||||||
|
petsc_options
|
||||||
PetscErrorCode :: ierr
|
PetscErrorCode :: ierr
|
||||||
|
|
||||||
write(6,'(/,a)') ' <<<+- DAMASK_FEM_utilities init -+>>>'
|
write(6,'(/,a)') ' <<<+- DAMASK_FEM_utilities init -+>>>'
|
||||||
|
@ -113,6 +115,9 @@ subroutine FEM_utilities_init
|
||||||
num_mesh => numerics_root%get('mesh',defaultVal=emptyDict)
|
num_mesh => numerics_root%get('mesh',defaultVal=emptyDict)
|
||||||
structOrder = num_mesh%get_asInt('structOrder',defaultVal = 2)
|
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
|
! set debugging parameters
|
||||||
debugPETSc = iand(debug_level(debug_SPECTRAL),debug_SPECTRALPETSC) /= 0
|
debugPETSc = iand(debug_level(debug_SPECTRAL),debug_SPECTRALPETSC) /= 0
|
||||||
|
|
|
@ -26,20 +26,6 @@ module numerics
|
||||||
integer(4), protected, public :: &
|
integer(4), protected, public :: &
|
||||||
DAMASK_NumThreadsInt = 0 !< value stored in environment variable DAMASK_NUM_THREADS, set to zero if no OpenMP directive
|
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
|
public :: numerics_init
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
@ -56,8 +42,6 @@ subroutine numerics_init
|
||||||
character(len=:), allocatable :: &
|
character(len=:), allocatable :: &
|
||||||
numerics_input, &
|
numerics_input, &
|
||||||
numerics_inFlow
|
numerics_inFlow
|
||||||
class (tNode), pointer :: &
|
|
||||||
num_grid
|
|
||||||
logical :: fexist
|
logical :: fexist
|
||||||
!$ character(len=6) DAMASK_NumThreadsString ! environment variable DAMASK_NUM_THREADS
|
!$ character(len=6) DAMASK_NumThreadsString ! environment variable DAMASK_NUM_THREADS
|
||||||
|
|
||||||
|
@ -86,12 +70,6 @@ subroutine numerics_init
|
||||||
numerics_input = IO_read('numerics.yaml')
|
numerics_input = IO_read('numerics.yaml')
|
||||||
numerics_inFlow = to_flow(numerics_input)
|
numerics_inFlow = to_flow(numerics_input)
|
||||||
numerics_root => parse_flow(numerics_inFlow,defaultVal=emptyDict)
|
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
|
else fileExists
|
||||||
write(6,'(a,/)') ' using standard values'
|
write(6,'(a,/)') ' using standard values'
|
||||||
flush(6)
|
flush(6)
|
||||||
|
@ -101,11 +79,6 @@ subroutine numerics_init
|
||||||
! openMP parameter
|
! openMP parameter
|
||||||
!$ write(6,'(a24,1x,i8,/)') ' number of threads: ',DAMASK_NumThreadsInt
|
!$ 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 subroutine numerics_init
|
||||||
|
|
||||||
end module numerics
|
end module numerics
|
||||||
|
|
Loading…
Reference in New Issue