BSpline Finite Element Exterior Calculus
Loading...
Searching...
No Matches
m_mform_eigensolver Module Reference

Module that provides an interface to SLEPc for solving (generalized) eigenvalue problems. More...

Data Types

interface  eigeninitoptions
 
type  eigensolver
 Type that wraps SLEPc functionality for solving (generalized) eigenvalue problems. More...
 

Functions/Subroutines

type(eigeninitoptions) function init_eigeninitoptions (ksp_type, pc_type, hypre_type, rtol, atol, max_iter, verbosity, which, target, target_interval, eps_type)
 Initialize an EigenInitOptions object.
 
subroutine init_eigen_options_from_traits (this, traits)
 Select solver options for eigenvalue problems, favouring direct solvers (MUMPS)
 
subroutine eigensolver_init (this, amat, bmat, constraint1, constraint2, constraint3, coord_transform, options)
 Initialize the eigensolver.
 
subroutine eigensolver_solve (this, rtol, max_iter, nr_pairs, verbosity)
 Solve the eigenvalue problem.
 
subroutine eigensolver_get_eigenpair (this, index, val_r, fun_r, val_i, fun_i, err_est)
 Get an eigenpair.
 
subroutine eigensolver_get_eigenvalues (this, vals_r, vals_i)
 Get all computed eigenvalues.
 
subroutine eigensolver_destroy (this)
 Destroy the eigensolver and free associated resources.
 

Detailed Description

Module that provides an interface to SLEPc for solving (generalized) eigenvalue problems.

Function/Subroutine Documentation

◆ eigensolver_destroy()

subroutine m_mform_eigensolver::eigensolver_destroy ( class(eigensolver), intent(inout) this)

Destroy the eigensolver and free associated resources.

Parameters
thisThe EigenSolver object

◆ eigensolver_get_eigenpair()

subroutine m_mform_eigensolver::eigensolver_get_eigenpair ( class(eigensolver), intent(in) this,
integer, intent(in) index,
real(wp), intent(out) val_r,
type(mformfun), intent(out) fun_r,
real(wp), intent(out), optional val_i,
type(mformfun), intent(out), optional fun_i,
real(wp), intent(out), optional err_est )

Get an eigenpair.

Parameters
thisThe EigenSolver object
indexThe index of the eigenpair to get (1-based)
val_rThe real part of the eigenvalue
fun_rThe real part of the eigenfunction
val_i_(optional)_ The imaginary part of the eigenvalue
fun_i_(optional)_ The imaginary part of the eigenfunction
err_est_(optional)_ The error estimate for the eigenpair

◆ eigensolver_get_eigenvalues()

subroutine m_mform_eigensolver::eigensolver_get_eigenvalues ( class(eigensolver), intent(in) this,
real(wp), dimension(:), intent(out), allocatable vals_r,
real(wp), dimension(:), intent(out), optional, allocatable vals_i )

Get all computed eigenvalues.

Parameters
thisThe EigenSolver object
vals_rThe real parts of the eigenvalues
vals_i_(optional)_ The imaginary parts of the eigenvalues

◆ eigensolver_init()

subroutine m_mform_eigensolver::eigensolver_init ( class(eigensolver), intent(inout) this,
class(abstractmatrix), intent(in) amat,
class(abstractmatrix), intent(in), optional bmat,
class(mformconstraintlocal), intent(in), optional constraint1,
class(mformconstraintlocal), intent(in), optional constraint2,
class(mformconstraintlocal), intent(in), optional constraint3,
class(coordtransformabstract), intent(in), optional coord_transform,
type(eigeninitoptions), intent(in), optional options )

Initialize the eigensolver.

Parameters
thisThe EigenSolver object
amatThe matrix A in the eigenvalue problem: $A x = \lambda x$
bmat_(optional)_ The matrix B in the eigenvalue problem: $A x = \lambda B x$
[in]constraint1_(optional)_ An optional constraint to be applied to the solution
[in]constraint2_(optional)_ An optional constraint to be applied to the solution
[in]constraint3_(optional)_ An optional constraint to be applied to the solution
[in]coord_transform_(optional)_ The coordinate transformation associated with the m-form spaces
options_(optional)_ The options for initializing the eigensolver (default: auto-select based on traits)

◆ eigensolver_solve()

subroutine m_mform_eigensolver::eigensolver_solve ( class(eigensolver), intent(inout) this,
real(wp), intent(in), optional rtol,
integer, intent(in), optional max_iter,
integer, intent(in), optional nr_pairs,
integer, intent(in), optional verbosity )

Solve the eigenvalue problem.

Parameters
thisThe EigenSolver object
rtol_(optional)_ The relative tolerance (default: 1.e-8)
max_iter_(optional)_ The maximum number of iterations (default: size of the space)
nr_pairs_(optional)_ The number of eigenpairs to compute (default: 6)
verbosity_(optional)_ The verbosity level (default: VERBOSITY_WARN_ON_FAILURE)
  • VERBOSITY_WARN_NEVER
  • VERBOSITY_WARN_ON_FAILURE
  • VERBOSITY_WARN_ALWAYS
  • VERBOSITY_ERROR_ON_FAILURE

◆ init_eigen_options_from_traits()

subroutine m_mform_eigensolver::init_eigen_options_from_traits ( class(eigeninitoptions), intent(inout) this,
type(solverinittraits), intent(in) traits )

Select solver options for eigenvalue problems, favouring direct solvers (MUMPS)

Eigenvalue solvers require highly accurate linear solves inside the spectral transform. Iterative methods with standard preconditioners often lack the accuracy needed for convergence of multiple eigenpairs. This override defaults to a direct solver (PREONLY + Cholesky/LU with MUMPS) which works both in serial and parallel.

Parameters
thisThe EigenInitOptions object
traitsThe solver traits derived from matrix properties

◆ init_eigeninitoptions()

type(eigeninitoptions) function m_mform_eigensolver::init_eigeninitoptions ( character(*), intent(in), optional ksp_type,
character(*), intent(in), optional pc_type,
character(*), intent(in), optional hypre_type,
real(wp), intent(in), optional rtol,
real(wp), intent(in), optional atol,
integer, intent(in), optional max_iter,
character(len=80), intent(in), optional verbosity,
character(*), intent(in), optional which,
real(wp), intent(in), optional target,
real(wp), dimension(2), intent(in), optional target_interval,
character(*), intent(in), optional eps_type )

Initialize an EigenInitOptions object.

Parameters
ksp_type_(optional)_ The KSP type to use (default: auto-select based on traits)
pc_type_(optional)_ The PC type to use (default: auto-select based on traits)
hypre_type_(optional)_ The HYPRE preconditioner type to use (default: auto-select based on traits)
rtol_(optional)_ The relative tolerance (default: 1.e-10)
atol_(optional)_ The absolute tolerance (default: 1.e-20)
max_iter_(optional)_ The maximum number of iterations (default: size of the space)
verbosity_(optional)_ The verbosity level (default: 'warn on failure')
  • 'warn never'
  • 'warn on failure'
  • 'warn always'
  • 'error on failure'
which_(optional)_ Which part of the spectrum to compute. Possible values are:
which_(optional)_ Which part of the spectrum to compute. Possible values are:
  • 'largest magnitude' or 'lm' (default)
  • 'smallest magnitude' or 'sm'
  • 'largest real' or 'lr'
  • 'smallest real' or 'sr'
  • 'largest imaginary' or 'li'
  • 'smallest imaginary' or 'si'
  • 'target magnitude' or 'tm'
  • 'target real' or 'tr'
  • 'target imaginary' or 'ti'
  • 'target interval' or 'all'
target_(optional)_ The target value if 'which' is a target option
target_interval_(optional)_ The target interval if 'which' is 'all'
eps_type_(optional)_ The type of eigensolver to use (default: 'krylovschur'). Possible values are:
  • 'power'
  • 'subspace'
  • 'arnoldi'
  • 'lanczos'
  • 'krylovschur'
  • 'gd'
  • 'jd' or 'jacobi davidson'
  • 'rqcg'
  • 'lobpcg'
  • 'ciss'
  • 'lyapii'
  • 'lapack'
  • 'arpack'
  • 'blopex'
  • 'primme'
  • 'feast'
  • 'scalapack'
  • 'elpa'
  • 'elemental'
  • 'evsl'
  • 'chase'