Go to the documentation of this file.
19 #include "libmesh/libmesh_config.h"
23 #if defined(LIBMESH_HAVE_SLEPC)
26 #include "libmesh/eigen_system.h"
27 #include "libmesh/equation_systems.h"
28 #include "libmesh/sparse_matrix.h"
29 #include "libmesh/shell_matrix.h"
30 #include "libmesh/eigen_solver.h"
31 #include "libmesh/dof_map.h"
32 #include "libmesh/mesh_base.h"
33 #include "libmesh/enum_eigen_solver_type.h"
42 const std::string & name_in,
43 const unsigned int number_in
45 Parent (es, name_in, number_in),
47 _n_converged_eigenpairs (0),
49 _is_generalized_eigenproblem (false),
50 _eigen_problem_type (
NHEP),
51 _use_shell_matrices (false)
279 const unsigned int maxits =
280 es.
parameters.
get<
unsigned int>(
"linear solver maximum iterations");
282 const unsigned int nev =
285 const unsigned int ncv =
288 std::pair<unsigned int, unsigned int> solve_data;
341 #endif // LIBMESH_HAVE_SLEPC
Manages consistently variables, degrees of freedom, and coefficient vectors.
void compute_sparsity(const MeshBase &)
Computes the sparsity pattern for the matrices corresponding to proc_id and sends that data to Linear...
const EquationSystems & get_equation_systems() const
virtual void reinit()
Reinitializes degrees of freedom and other required data on the current mesh.
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.
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.
const Parallel::Communicator & comm() const
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.
virtual void assemble()
Prepares matrix and _dof_map for matrix assembly.
std::unique_ptr< SparseMatrix< Number > > precond_matrix
A preconditioning matrix.
bool have_parameter(const std::string &) const
std::unique_ptr< SparseMatrix< Number > > matrix_B
A second system matrix for generalized eigenvalue problems.
bool assemble_before_solve
Flag which tells the system to whether or not to call the user assembly function during each call to ...
virtual void init_data() override
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used.
const MeshBase & get_mesh() const
virtual std::pair< Real, Real > get_eigenpair(dof_id_type i)
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.
void attach_matrix(SparseMatrix< Number > &matrix)
Additional matrices may be handled with this DofMap.
std::unique_ptr< NumericVector< Number > > solution
Data structure to hold solution values.
static std::unique_ptr< SparseMatrix< T > > build(const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())
Builds a SparseMatrix<T> using the linear solver package specified by solver_package.
This class handles the numbering of degrees of freedom on a mesh.
void clear_sparsity()
Clears the sparsity pattern.
static std::unique_ptr< ShellMatrix< T > > build(const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())
Builds a ShellMatrix<T> using the linear solver package specified by solver_package.
unsigned int _n_converged_eigenpairs
The number of converged eigenpairs.
virtual void init_data()
Initializes the data for the system.
This class provides an interface to solvers for eigenvalue problems.
virtual void clear()
Clear all the data structures associated with the system.
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.
const DofMap & get_dof_map() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const T & get(const std::string &) const
virtual void assemble() override
Assembles the system matrix.
Parameters parameters
Data structure holding arbitrary parameters.