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" 41 template <
typename T>
class SparseMatrix;
42 template <
typename T>
class ShellMatrix;
43 template <
typename T>
class NumericVector;
44 class SolverConfiguration;
93 libmesh_experimental();
103 libmesh_experimental();
115 virtual void init () = 0;
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;
357 #endif // LIBMESH_HAVE_SLEPC 359 #endif // LIBMESH_EIGEN_SOLVER_H void set_eigensolver_type(const EigenSolverType est)
Sets the type of eigensolver to use.
SolverConfiguration * _solver_configuration
Optionally store a SolverOptions object that can be used to set parameters like solver type...
virtual void set_initial_space(NumericVector< T > &initial_space_in)=0
Provide one basis vector for the initial guess.
bool _is_initialized
Flag indicating if the data structures have been initialized.
bool _close_matrix_before_solve
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
EigenProblemType
Defines an enum for eigenproblem types.
virtual std::pair< Real, Real > get_eigenpair(dof_id_type i, NumericVector< T > &solution)=0
The libMesh namespace provides an interface to certain functionality in the library.
virtual void attach_deflation_space(NumericVector< T > &deflation_vector)=0
Attach a deflation space defined by a single vector.
PositionOfSpectrum _position_of_spectrum
Enum stating where to evaluate the spectrum.
PositionOfSpectrum position_of_spectrum() const
EigenProblemType eigen_problem_type() const
virtual std::pair< Real, Real > get_eigenvalue(dof_id_type i)=0
This class stores solver configuration data, e.g.
PositionOfSpectrum
Defines an enum for the position of the spectrum, i.e.
EigenSolver(const Parallel::Communicator &comm_in)
Constructor.
void set_eigenproblem_type(EigenProblemType ept)
Sets the type of the eigenproblem.
This class implements reference counting.
An object whose state is distributed along a set of processors.
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.
virtual ~EigenSolver()
Destructor.
bool get_close_matrix_before_solve() const
virtual void init()=0
Initialize data structures if not done so already.
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.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void set_position_of_spectrum(PositionOfSpectrum pos)
Sets the position of the spectrum.
EigenSolverType
Defines an enum for iterative eigenproblem solver types.
EigenSolverType _eigen_solver_type
Enum stating which type of eigensolver to use.
SolverPackage
Defines an enum for various linear solver packages.
EigenProblemType _eigen_problem_type
Enum stating which type of eigen problem we deal with.
void set_solver_configuration(SolverConfiguration &solver_configuration)
Set the solver configuration object.
Generic shell matrix, i.e.
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_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 clear()
Release all memory and clear data structures.
void ErrorVector unsigned int
This class provides an interface to solvers for eigenvalue problems.