Used to represent the input configuration of eigval. Several of these options are controlling SLEPc settings, which can also be set using the SLEPc command line flags.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
logical, | public | :: | exist | = | .false. |
Does the related namelist exist in the target input file? |
|
integer, | public | :: | index | = | 0 |
Used to hold the specific index of numbered namelists |
|
logical, | public | :: | skip_read | = | .false. |
Do we want to skip the read step in init? |
|
logical, | public | :: | skip_broadcast | = | .false. |
Do we want to skip the broadcast step in init? |
|
logical, | public | :: | skip_smart_defaults | = | .false. |
Do we want to skip the smaart defaults in init? |
|
logical, | public | :: | analyse_ddt_operator | = | .false. |
Determines which operator SLEPc is finding eigenvalues of. If
.false. then SLEPc analyses the time advance operator, so
internally works with the eigenvalue |
|
character(len=20), | public | :: | extraction_option | = | 'default' |
Sets the extraction technique, must be one of:
|
|
integer, | public | :: | max_iter | = | 0 |
Sets the maximum number of SLEPC iterations used. If not set (recommended) then let SLEPC decide what to use (varies with different options). |
|
integer, | public | :: | n_eig | = | 1 |
The number of eigenmodes to search for. The actual number of modes found may be larger than this. |
|
integer, | public | :: | nadv | = | 1 |
How many GS2 timesteps to take each time SLEPc wants to advance the distribution function. Useful to separate closely spaced eigenvalues without changing delt. |
|
logical, | public | :: | save_restarts | = | .false. |
If |
|
character(len=20), | public | :: | solver_option | = | 'default' |
Sets the type of solver to use, must be one of:
Not all solver types are compatible with other eigenvalue options, some options may not be supported in older SLEPC versions and some may require certain flags to be set when SLEPC is compiled. |
|
real, | public | :: | targ_im | = | 0.5 |
Imaginary part of the eigenvalue target. Often beneficial to
set this fairly large (e.g. 10) when looking for unstable
modes. Used with the |
|
real, | public | :: | targ_re | = | 0.5 |
Real part of the eigenvalue target. Often beneficial to set
this fairly small (e.g. ~0). Used with the |
|
real, | public | :: | tolerance | = | 1.0d-6 |
Sets tolerance on SLEPC eigenmode search. Used to determine when an eigenmode has been found. Note this is the tolerance based on the SLEPc eigenvalue, which is the time advance eigenvalue rather than the GS2 eigenvalue, . |
|
character(len=20), | public | :: | transform_option | = | 'default' |
Sets the type of spectral transform to be used. This can help extract interior eigenvalues. Must be one of
Not all options are available in all versions of the library. |
|
logical, | public | :: | use_ginit | = | .false. |
If |
|
character(len=20), | public | :: | which_option | = | 'default' |
Sets SLEPC mode of operation (i.e. what sort of eigenvalues it
looks for). Note that this refers to the SLEPc eigenvalue,
i.e. the time advance eigenvalue
. In other
words one should select
|
Is this instance initialised?
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self |
Fully initialise the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(inout) | :: | self | |||
character(len=*), | intent(in), | optional | :: | name | ||
logical, | intent(in), | optional | :: | requires_index | ||
integer, | intent(in), | optional | :: | index | ||
logical, | intent(in), | optional | :: | skip_smart_defaults | ||
logical, | intent(in), | optional | :: | skip_read | ||
logical, | intent(in), | optional | :: | skip_broadcast |
Do some standard setup/checking
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(inout) | :: | self | |||
character(len=*), | intent(in), | optional | :: | name | ||
logical, | intent(in), | optional | :: | requires_index | ||
integer, | intent(in), | optional | :: | index |
Write the namelist header for this instance
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
integer, | intent(in) | :: | unit |
Returns the namelist name. Not very useful at the moment but may want to do more interesting things in the future
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self |
Returns the requires_index value. Allows access whilst keeping the variable private
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self |
An no-op implementation of the set_smart_defaults method. Unless over-ridden the specific config instance will have no smart defaults applied.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(inout) | :: | self |
Has to be intent in out as over-riding procedures need to change self |
Write the namelist footer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type character
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
character(len=*), | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type real
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
real, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type complex
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
complex, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
integer, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type logical
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
logical, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type real array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | key | |||
real, | intent(in), | dimension(:) | :: | val | ||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type complex array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | key | |||
complex, | intent(in), | dimension(:) | :: | val | ||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type integer array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | key | |||
integer, | intent(in), | dimension(:) | :: | val | ||
integer, | intent(in) | :: | unit |
Reads in the eigval_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(eigval_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(eigval_config_type), | intent(in) | :: | self | |||
integer, | intent(in), | optional | :: | unit |
Resets the config object to the initial empty state
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(eigval_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(eigval_config_type), | intent(inout) | :: | self |
Gets the default name for this namelist
Gets the default requires index for this namelist
type, extends(abstract_config_type) :: eigval_config_type
! namelist : eigval_knobs
! indexed : false
!> Determines which operator SLEPc is finding eigenvalues of. If
!> .false. then SLEPc analyses the time advance operator, so
!> internally works with the eigenvalue `exp(-i*omega*nadv*dt)`.
!> If .true. then SLEPc analyses a time derivative operator, so
!> internally works with the eigenvalue `-i*omega`. Note we form
!> a first order one sided approximation of the time derivative
!> (e.g. `(g_{n+nadv}-g_{n})/(nadv*code_dt)`) to be analysed.
logical :: analyse_ddt_operator = .false.
!> Sets the extraction technique, must be one of:
!>
!> - 'default' (use SLEPC default)
!> - 'slepc_default' (use SLEPC default)
!> - 'ritz'
!> - 'harmonic'
!> - 'harmonic_relative'
!> - 'harmonic_right'
!> - 'harmonic_largest'
!> - 'refined'
!> - 'refined_harmonic'
!>
character(len = 20) :: extraction_option = 'default'
!> Sets the maximum number of SLEPC iterations used. If not set
!> (recommended) then let SLEPC decide what to use (varies with
!> different options).
integer :: max_iter = PETSC_DECIDE
!> The number of eigenmodes to search for. The actual number of
!> modes found may be larger than this.
integer :: n_eig = 1
!> How many GS2 timesteps to take each time SLEPc wants to
!> advance the distribution function. Useful to separate closely
!> spaced eigenvalues without changing [[knobs:delt]].
integer :: nadv = 1
!> If `true` then we save a set of restart files for each eigenmode
!> found. These are named as the standard restart file
!> (i.e. influenced by the restart_file input), but have `eig_<id>`
!> appended near the end, where `<id>` is an integer representing the
!> eigenmode id. If `save_distfn` of [[gs2_diagnostics_knobs]] is true
!> then will also save the distribution function files.
logical :: save_restarts = .false.
!> Sets the type of solver to use, must be one of:
!>
!> - 'default' (Krylov-Schur)
!> - 'slepc_default' (Krylov-Schur)
!> - 'power'
!> - 'subspace'
!> - 'arnoldi'
!> - 'lanczos'
!> - 'krylov'
!> - 'GD'
!> - 'JD'
!> - 'RQCG'
!> - 'CISS'
!> - 'lapack'
!> - 'arpack'
!> - 'blzpack'
!> - 'trlan'
!> - 'blopex'
!> - 'primme'
!> - 'feast'
!>
!> Not all solver types are compatible with other eigenvalue options,
!> some options may not be supported in older SLEPC versions and some
!> may require certain flags to be set when SLEPC is compiled.
character(len = 20) :: solver_option = 'default'
!> Imaginary part of the eigenvalue target. Often beneficial to
!> set this fairly large (e.g. 10) when looking for unstable
!> modes. Used with the `target_*` [[eigval_knobs:which_option]]
!> mode.
real :: targ_im = 0.5
!> Real part of the eigenvalue target. Often beneficial to set
!> this fairly small (e.g. ~0). Used with the `target_*`
!> [[eigval_knobs:which_option]] mode.
real :: targ_re = 0.5
!> Sets tolerance on SLEPC eigenmode search. Used to determine
!> when an eigenmode has been found. Note this is the tolerance
!> based on the SLEPc eigenvalue, which is the time advance
!> eigenvalue
!> \(\exp{\left(-i\Omega\textrm{nadv delt}\right)}\)
!> rather than the GS2 eigenvalue, \(\Omega\).
real :: tolerance = 1.0d-6
!> Sets the type of spectral transform to be used. This can help
!> extract interior eigenvalues. Must be one of
!>
!> - 'default' (let SLEPC decide)
!> - 'slepc_default' (let SLEPC decide)
!> - 'shell'
!> - 'shift'
!> - 'invert'
!> - 'cayley'
!> - 'fold'
!> - 'precond' (not implemented)
!>
!> Not all options are available in all versions of the library.
character(len = 20) :: transform_option = 'default'
!> If `true` then provide an initial guess for the eigenmode
!> based on using [[init_g]] routines to initialise `g`. Can be
!> helpful in accelerating initial phase of eigensolver. Can also
!> be quite useful with `ginit_option='many'` (etc.) to start an
!> eigenvalue search from a previously obtained solution,
!> allowing both eigenmode refinement and sub-dominant mode
!> detection.
logical :: use_ginit = .false.
!> Sets SLEPC mode of operation (i.e. what sort of eigenvalues it
!>looks for). Note that this refers to the SLEPc eigenvalue,
!>i.e. the time advance eigenvalue
!>\(\exp{\left(-i\Omega\textrm{nadv delt}\right)}\). In other
!>words one should select `'largest_real'` to search for modes
!>with the largest growth rate. Must be one of
!>
!> - 'default' (equivalent to 'target_magnitude')
!> - 'slepc_default' (let SLEPC decide)
!> - 'largest_magnitude'
!> - 'smallest_magnitude'
!> - 'largest_real'
!> - 'smallest_real'
!> - 'largest_imaginary'
!> - 'smallest_imaginary'
!> - 'target_magnitude' (complex eigenvalue magnitude closest to magnitude of target)
!> - 'target_real'
!> - 'target_imaginary'
!> - 'all' (only some solver types, e.g. lapack) -- not supported
!> - 'user' (will use a user specified function to pick between eigenmodes, note not currently implemented)
!>
character(len = 20) :: which_option = 'default'
contains
procedure, public :: read => read_eigval_config
procedure, public :: write => write_eigval_config
procedure, public :: reset => reset_eigval_config
procedure, public :: broadcast => broadcast_eigval_config
procedure, public, nopass :: get_default_name => get_default_name_eigval_config
procedure, public, nopass :: get_default_requires_index => get_default_requires_index_eigval_config
end type eigval_config_type