libMesh
Loading...
Searching...
No Matches
eigen_time_solver.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3
4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public
6// License as published by the Free Software Foundation; either
7// version 2.1 of the License, or (at your option) any later version.
8
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12// Lesser General Public License for more details.
13
14// You should have received a copy of the GNU Lesser General Public
15// License along with this library; if not, write to the Free Software
16// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18
19
20#ifndef LIBMESH_EIGEN_TIME_SOLVER_H
21#define LIBMESH_EIGEN_TIME_SOLVER_H
22
23#include "libmesh/libmesh_config.h"
24#ifdef LIBMESH_HAVE_SLEPC
25
26// Local includes
27#include "libmesh/time_solver.h"
28
29// C++ includes
30
31namespace libMesh
32{
33
34// Forward declarations
35template <typename T> class EigenSolver;
36
37
67{
68public:
73
78
83 explicit
85
89 virtual ~EigenTimeSolver ();
90
95 virtual void init () override;
96
101 virtual void reinit () override;
102
107 virtual void solve () override;
108
112 virtual void advance_timestep () override {}
113
118 Real error_order() const { return 0.; }
119
124 virtual bool element_residual (bool get_jacobian,
125 DiffContext &) override;
126
130 virtual bool side_residual (bool get_jacobian,
131 DiffContext &) override;
132
136 virtual bool nonlocal_residual (bool get_jacobian,
137 DiffContext &) override;
138
144 virtual Real du (const SystemNorm &) const override { return 0.; }
145
149 virtual bool is_steady() const override { return true; }
150
155 std::unique_ptr<EigenSolver<Number>> eigen_solver;
156
161 double tol;
162
166 unsigned int maxits;
167
172
183
189
194 unsigned int n_iterations_reqd;
195
196private:
197
214
219};
220
221} // namespace libMesh
222
223
224#endif // LIBMESH_HAVE_SLEPC
225#endif // LIBMESH_EIGEN_TIME_SOLVER_H
This class provides all data required for a physics package (e.g.
This class provides a specific system class.
Definition diff_system.h:57
The name of this class is confusing...it's meant to refer to the base class (TimeSolver) while still ...
DifferentiableSystem sys_type
The type of system.
Real error_order() const
error convergence order against deltat is not applicable to an eigenvalue problem.
unsigned int maxits
The maximum number of iterations allowed to solve the problem.
unsigned int n_converged_eigenpairs
After a solve, holds the number of eigenpairs successfully converged.
TimeSolver Parent
The parent class.
std::unique_ptr< EigenSolver< Number > > eigen_solver
The EigenSolver object.
NowAssembling now_assembling
Flag which controls the internals of element_residual() and side_residual().
virtual bool side_residual(bool get_jacobian, DiffContext &) override
Forms the jacobian of the boundary terms.
virtual void advance_timestep() override
It doesn't make sense to advance the timestep, so we shouldn't call this.
unsigned int n_basis_vectors_to_use
The number of basis vectors to use in the computation.
virtual bool nonlocal_residual(bool get_jacobian, DiffContext &) override
Forms the jacobian of the nonlocal terms.
@ Matrix_B
The matrix associated with the time derivative (mass matrix).
@ Invalid_Matrix
The enum is in an invalid state.
@ Matrix_A
The matrix associated with the spatial part of the operator.
double tol
The linear solver tolerance to be used when solving the eigenvalue problem.
virtual Real du(const SystemNorm &) const override
unsigned int n_iterations_reqd
After a solve, holds the number of iterations required to converge the requested number of eigenpairs...
virtual bool is_steady() const override
This is effectively a steady-state solver.
virtual void init() override
The initialization function.
virtual ~EigenTimeSolver()
Destructor.
unsigned int n_eigenpairs_to_compute
The number of eigenvectors/values to be computed.
virtual void solve() override
Implements the assembly of both matrices A and B, and calls the EigenSolver to compute the eigenvalue...
virtual bool element_residual(bool get_jacobian, DiffContext &) override
Forms either the spatial (Jacobian) or mass matrix part of the operator, depending on which is reques...
virtual void reinit() override
The reinitialization function.
This class defines a norm/seminorm to be applied to a NumericVector which contains coefficients in a ...
Definition system_norm.h:50
This is a generic class that defines a solver to handle time integration of DifferentiableSystems.
Definition time_solver.h:64
The libMesh namespace provides an interface to certain functionality in the library.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real