Go to the documentation of this file.
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;
64 const std::string & name_in,
65 const unsigned int number_in);
91 virtual void clear ()
override;
97 virtual void reinit ()
override;
102 virtual void solve ()
override;
119 virtual std::string
system_type ()
const override {
return "Eigen"; }
124 virtual unsigned int n_matrices ()
const override;
267 #endif // LIBMESH_HAVE_SLEPC
269 #endif // LIBMESH_EIGEN_SYSTEM_H
Manages consistently variables, degrees of freedom, and coefficient vectors.
void set_n_converged(unsigned int nconv)
Set the _n_converged_eigenpairs member, useful for subclasses of EigenSystem.
std::unique_ptr< SparseMatrix< Number > > matrix_A
The system matrix for standard eigenvalue problems.
bool _is_generalized_eigenproblem
A boolean flag to indicate whether we are dealing with a generalized eigenvalue problem.
std::unique_ptr< ShellMatrix< Number > > shell_matrix_B
A second system shell matrix for generalized eigenvalue problems.
EigenProblemType
Defines an enum for eigenproblem types.
virtual void init_matrices()
Initializes the matrices associated with the system.
EigenProblemType get_eigenproblem_type() const
virtual ~EigenSystem()
Destructor.
virtual void solve() override
Assembles & solves the eigen system.
The libMesh namespace provides an interface to certain functionality in the library.
EigenSystem(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
Constructor.
std::unique_ptr< EigenSolver< Number > > eigen_solver
The EigenSolver, defining which interface, i.e solver package to use.
void set_eigenproblem_type(EigenProblemType ept)
Sets the type of the current eigen problem.
virtual void clear() override
Clear all the data structures associated with the system.
EigenProblemType _eigen_problem_type
The type of the eigenvalue problem.
bool _use_shell_matrices
A boolean flag to indicate whether or not to use shell matrices.
std::unique_ptr< SparseMatrix< Number > > precond_matrix
A preconditioning matrix.
unsigned int get_n_converged() const
std::unique_ptr< SparseMatrix< Number > > matrix_B
A second system matrix for generalized eigenvalue problems.
unsigned int get_n_iterations() const
virtual void init_data() override
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used.
void use_shell_matrices(bool use_shell_matrices)
Set a flag to use shell matrices.
virtual std::pair< Real, Real > get_eigenpair(dof_id_type i)
EigenSystem sys_type
The type of system.
virtual void reinit() override
Reinitializes the member data fields associated with the system, so that, e.g., assemble() may be use...
This is the EquationSystems class.
Manages consistently variables, degrees of freedom, and coefficient vectors for eigenvalue problems.
unsigned int _n_converged_eigenpairs
The number of converged eigenpairs.
std::unique_ptr< ShellMatrix< Number > > shell_matrix_A
The system shell matrix for standard eigenvalue problems.
unsigned int _n_iterations
The number of iterations of the eigen solver algorithm.
virtual unsigned int n_matrices() const override
virtual std::string system_type() const override
void set_n_iterations(unsigned int its)
Set the _n_iterations member, useful for subclasses of EigenSystem.
bool use_shell_matrices() const
System Parent
The type of the parent.
virtual void assemble() override
Assembles the system matrix.