19 #ifndef LIBMESH_EIGEN_SYSTEM_H 20 #define LIBMESH_EIGEN_SYSTEM_H 22 #include "libmesh/libmesh_config.h" 26 #if defined(LIBMESH_HAVE_SLEPC) 29 #include "libmesh/system.h" 30 #include "libmesh/eigen_solver.h" 36 template <
typename T>
class SparseMatrix;
37 template <
typename T>
class ShellMatrix;
63 const std::string & name_in,
64 const unsigned int number_in);
96 virtual void clear ()
override;
102 virtual void reinit ()
override;
107 virtual void solve ()
override;
125 virtual std::string
system_type ()
const override {
return "Eigen"; }
422 #endif // LIBMESH_HAVE_SLEPC 424 #endif // LIBMESH_EIGEN_SYSTEM_H virtual void reinit() override
Reinitializes the member data fields associated with the system, so that, e.g., assemble() may be use...
virtual std::pair< Real, Real > get_eigenpair(dof_id_type i)
void use_shell_matrices(bool use_shell_matrices)
Set a flag to use shell matrices.
const SparseMatrix< Number > & get_precond_matrix() const
This is the EquationSystems class.
EigenSystem sys_type
The type of system.
SparseMatrix< Number > * matrix_B
A second system matrix for generalized eigenvalue problems.
unsigned int _n_converged_eigenpairs
The number of converged eigenpairs.
const SparseMatrix< Number > & get_matrix_A() const
std::unique_ptr< ShellMatrix< Number > > shell_precond_matrix
A preconditioning shell matrix.
const SparseMatrix< Number > & get_matrix_B() const
bool has_matrix_A() const
bool has_shell_matrix_A() const
EigenProblemType
Defines an enum for eigenproblem types.
virtual void init_matrices() override
Initializes the matrices associated with the system.
bool use_shell_precond_matrix() const
virtual std::string system_type() const override
EigenSystem & operator=(const EigenSystem &)=delete
void set_initial_space(NumericVector< Number > &initial_space_in)
Sets an initial eigen vector.
The libMesh namespace provides an interface to certain functionality in the library.
const EigenSolver< Number > & get_eigen_solver() const
const ShellMatrix< Number > & get_shell_matrix_A() const
System Parent
The type of the parent.
unsigned int _n_iterations
The number of iterations of the eigen solver algorithm.
std::unique_ptr< ShellMatrix< Number > > shell_matrix_A
The system shell matrix for standard eigenvalue problems.
SparseMatrix< Number > * precond_matrix
A preconditioning matrix.
void use_shell_precond_matrix(bool use_shell_precond_matrix)
Set a flag to use a shell preconditioning matrix.
bool use_shell_matrices() const
void set_n_iterations(unsigned int its)
Set the _n_iterations member, useful for subclasses of EigenSystem.
bool has_matrix_B() const
Manages consistently variables, degrees of freedom, and coefficient vectors.
bool has_precond_matrix() const
EigenProblemType get_eigenproblem_type() const
bool _use_shell_precond_matrix
A boolean flag to indicate whether or not to use a shell preconditioning matrix.
std::unique_ptr< ShellMatrix< Number > > shell_matrix_B
A second system shell matrix for generalized eigenvalue problems.
SparseMatrix< Number > * matrix_A
The system matrix for standard eigenvalue problems.
bool has_shell_matrix_B() const
void set_n_converged(unsigned int nconv)
Set the _n_converged_eigenpairs member, useful for subclasses of EigenSystem.
const ShellMatrix< Number > & get_shell_precond_matrix() const
bool has_shell_precond_matrix() const
virtual std::pair< Real, Real > get_eigenvalue(dof_id_type i)
virtual void solve() override
Assembles & solves the eigen system.
EigenSystem(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
Constructor.
bool _use_shell_matrices
A boolean flag to indicate whether or not to use shell matrices.
std::unique_ptr< EigenSolver< Number > > eigen_solver
The EigenSolver, defining which interface, i.e solver package to use.
const ShellMatrix< Number > & get_shell_matrix_B() const
virtual void add_matrices() override
Adds the necessary matrices and shell matrices.
EigenProblemType _eigen_problem_type
The type of the eigenvalue problem.
void set_eigenproblem_type(EigenProblemType ept)
Sets the type of the current eigen problem.
unsigned int get_n_converged() const
virtual void clear() override
Clear all the data structures associated with the system.
Manages consistently variables, degrees of freedom, and coefficient vectors for eigenvalue problems...
unsigned int get_n_iterations() const
This class provides an interface to solvers for eigenvalue problems.