20#ifndef LIBMESH_EIGEN_SOLVER_H
21#define LIBMESH_EIGEN_SOLVER_H
24#include "libmesh/libmesh_config.h"
25#ifdef LIBMESH_HAVE_SLEPC
28#include "libmesh/libmesh_common.h"
29#include "libmesh/reference_counted_object.h"
30#include "libmesh/libmesh.h"
31#include "libmesh/parallel_object.h"
32#include "libmesh/enum_solver_package.h"
41template <
typename T>
class SparseMatrix;
42template <
typename T>
class ShellMatrix;
43template <
typename T>
class NumericVector;
44class SolverConfiguration;
93 libmesh_experimental();
103 libmesh_experimental();
164 const unsigned int m_its) = 0;
176 const unsigned int m_its) = 0;
190 const unsigned int m_its) = 0;
204 const unsigned int m_its) = 0;
218 const unsigned int m_its) = 0;
232 const unsigned int m_its) = 0;
246 const unsigned int m_its) = 0;
260 const unsigned int m_its) = 0;
275 const unsigned int m_its) = 0;
290 const unsigned int m_its) = 0;
void ErrorVector unsigned int
This class provides an interface to solvers for eigenvalue problems.
virtual std::pair< unsigned int, unsigned int > solve_generalized(ShellMatrix< T > &matrix_A, ShellMatrix< T > &matrix_B, ShellMatrix< T > &precond, int nev, int ncv, const double tol, const unsigned int m_its)=0
Solves the generalized eigenproblem involving ShellMatrices matrix_A, matrix_B and the shell precondi...
virtual std::pair< unsigned int, unsigned int > solve_generalized(ShellMatrix< T > &matrix_A, ShellMatrix< T > &matrix_B, int nev, int ncv, const double tol, const unsigned int m_its)=0
Solves the generalized eigenproblem involving ShellMatrices matrix_A and matrix_B.
EigenProblemType eigen_problem_type() const
static std::unique_ptr< EigenSolver< T > > build(const Parallel::Communicator &comm_in, const SolverPackage solver_package=SLEPC_SOLVERS)
Builds an EigenSolver using the linear solver package specified by solver_package.
void set_eigenproblem_type(EigenProblemType ept)
Sets the type of the eigenproblem.
virtual std::pair< unsigned int, unsigned int > solve_generalized(ShellMatrix< T > &matrix_A, SparseMatrix< T > &matrix_B, int nev, int ncv, const double tol, const unsigned int m_its)=0
Solves the generalized eigenproblem with ShellMatrix matrix_A and SparseMatrix matrix_B.
void set_position_of_spectrum(PositionOfSpectrum pos)
Sets the position of the spectrum.
virtual std::pair< unsigned int, unsigned int > solve_generalized(ShellMatrix< T > &matrix_A, ShellMatrix< T > &matrix_B, SparseMatrix< T > &precond, int nev, int ncv, const double tol, const unsigned int m_its)=0
Solves the generalized eigenproblem involving ShellMatrices matrix_A, matrix_B and the SparseMatrix p...
SolverConfiguration * _solver_configuration
Optionally store a SolverOptions object that can be used to set parameters like solver type,...
void set_eigensolver_type(const EigenSolverType est)
Sets the type of eigensolver to use.
virtual ~EigenSolver()
Destructor.
EigenSolverType _eigen_solver_type
Enum stating which type of eigensolver to use.
virtual std::pair< unsigned int, unsigned int > solve_generalized(SparseMatrix< T > &matrix_A, ShellMatrix< T > &matrix_B, int nev, int ncv, const double tol, const unsigned int m_its)=0
Solves the generalized eigenproblem with SparseMatrix matrix_A and ShellMatrix matrix_B.
virtual std::pair< unsigned int, unsigned int > solve_generalized(SparseMatrix< T > &matrix_A, SparseMatrix< T > &matrix_B, int nev, int ncv, const double tol, const unsigned int m_its)=0
Solves the generalized eigenproblem involving SparseMatrices matrix_A and matrix_B.
virtual std::pair< unsigned int, unsigned int > solve_standard(ShellMatrix< T > &matrix_A, SparseMatrix< T > &precond, int nev, int ncv, const double tol, const unsigned int m_its)=0
Solves the standard eigenproblem involving the ShellMatrix matrix_A and the preconditioning matrix pr...
bool get_close_matrix_before_solve() const
virtual std::pair< unsigned int, unsigned int > solve_standard(SparseMatrix< T > &matrix_A, int nev, int ncv, const double tol, const unsigned int m_its)=0
Solves the standard eigenproblem involving the SparseMatrix matrix_A.
PositionOfSpectrum _position_of_spectrum
Enum stating where to evaluate the spectrum.
virtual void set_initial_space(NumericVector< T > &initial_space_in)=0
Provide one basis vector for the initial guess.
virtual void clear()
Release all memory and clear data structures.
virtual std::pair< Real, Real > get_eigenpair(dof_id_type i, NumericVector< T > &solution)=0
EigenProblemType _eigen_problem_type
Enum stating which type of eigen problem we deal with.
virtual std::pair< unsigned int, unsigned int > solve_standard(ShellMatrix< T > &matrix_A, int nev, int ncv, const double tol, const unsigned int m_its)=0
Solves the standard eigenproblem involving the ShellMatrix matrix_A.
virtual std::pair< Real, Real > get_eigenvalue(dof_id_type i)=0
bool _is_initialized
Flag indicating if the data structures have been initialized.
PositionOfSpectrum position_of_spectrum() const
bool _close_matrix_before_solve
virtual void init()=0
Initialize data structures if not done so already.
EigenSolverType eigen_solver_type() const
void set_close_matrix_before_solve(bool val)
Set the flag which controls whether libmesh closes the eigenproblem matrices before solving.
virtual std::pair< unsigned int, unsigned int > solve_standard(ShellMatrix< T > &matrix_A, ShellMatrix< T > &precond, int nev, int ncv, const double tol, const unsigned int m_its)=0
Solves the standard eigenproblem involving the ShellMatrix matrix_A and the shell preconditioning mat...
void set_solver_configuration(SolverConfiguration &solver_configuration)
Set the solver configuration object.
virtual void attach_deflation_space(NumericVector< T > &deflation_vector)=0
Attach a deflation space defined by a single vector.
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
An object whose state is distributed along a set of processors.
This class implements reference counting.
Generic shell matrix, i.e.
This class stores solver configuration data, e.g.
The libMesh namespace provides an interface to certain functionality in the library.
PositionOfSpectrum
Defines an enum for the position of the spectrum, i.e.
SolverPackage
Defines an enum for various linear solver packages.
EigenProblemType
Defines an enum for eigenproblem types.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
EigenSolverType
Defines an enum for iterative eigenproblem solver types.