Go to the documentation of this file.
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"
34 #ifdef LIBMESH_FORWARD_DECLARE_ENUMS
42 #include "libmesh/enum_solver_package.h"
43 #include "libmesh/enum_eigen_solver_type.h"
53 template <
typename T>
class SparseMatrix;
54 template <
typename T>
class ShellMatrix;
55 template <
typename T>
class NumericVector;
56 class SolverConfiguration;
75 EigenSolver (
const Parallel::Communicator & comm_in);
86 static std::unique_ptr<EigenSolver<T>>
build(
const Parallel::Communicator & comm_in,
102 libmesh_experimental();
112 libmesh_experimental();
124 virtual void init () = 0;
173 const unsigned int m_its) = 0;
185 const unsigned int m_its) = 0;
199 const unsigned int m_its) = 0;
214 const unsigned int m_its) = 0;
228 const unsigned int m_its) = 0;
242 const unsigned int m_its) = 0;
256 const unsigned int m_its) = 0;
271 const unsigned int m_its) = 0;
338 #endif // LIBMESH_HAVE_SLEPC
340 #endif // LIBMESH_EIGEN_SOLVER_H
virtual void attach_deflation_space(NumericVector< T > &deflation_vector)=0
Attach a deflation space defined by a single vector.
Generic shell matrix, i.e.
virtual std::pair< Real, Real > get_eigenpair(dof_id_type i, NumericVector< T > &solution)=0
SolverPackage
Defines an enum for various linear solver packages.
EigenSolverType eigen_solver_type() const
EigenProblemType eigen_problem_type() const
EigenProblemType
Defines an enum for eigenproblem types.
void set_eigenproblem_type(EigenProblemType ept)
Sets the type of the eigenproblem.
This class implements reference counting.
The libMesh namespace provides an interface to certain functionality in the library.
bool get_close_matrix_before_solve() const
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.
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
EigenSolver(const Parallel::Communicator &comm_in)
Constructor.
PositionOfSpectrum _position_of_spectrum
Enum stating where to evaluate the spectrum.
virtual std::pair< Real, Real > get_eigenvalue(dof_id_type i)=0
bool _is_initialized
Flag indicating if the data structures have been initialized.
void set_close_matrix_before_solve(bool val)
Set the flag which controls whether libmesh closes the eigenproblem matrices before solving.
void set_solver_configuration(SolverConfiguration &solver_configuration)
Set the solver configuration object.
virtual void init()=0
Initialize data structures if not done so already.
EigenSolverType
Defines an enum for iterative eigenproblem solver types.
virtual ~EigenSolver()
Destructor.
void set_position_of_spectrum(PositionOfSpectrum pos)
Sets the position of the spectrum.
EigenProblemType _eigen_problem_type
Enum stating which type of eigen problem we deal with.
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, 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 void set_initial_space(NumericVector< T > &initial_space_in)=0
Provide one basis vector for the initial guess.
PositionOfSpectrum
Defines an enum for the position of the spectrum, i.e.
PositionOfSpectrum position_of_spectrum() const
This class provides an interface to solvers for eigenvalue problems.
virtual void clear()
Release all memory and clear data structures.
This class stores solver configuration data, e.g.
bool _close_matrix_before_solve
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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.
An object whose state is distributed along a set of processors.
void ErrorVector unsigned int
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.