Go to the documentation of this file.
20 #ifndef LIBMESH_PRECONDITIONER_H
21 #define LIBMESH_PRECONDITIONER_H
25 #include "libmesh/libmesh_common.h"
26 #include "libmesh/reference_counted_object.h"
27 #include "libmesh/libmesh.h"
28 #include "libmesh/parallel_object.h"
30 #ifdef LIBMESH_FORWARD_DECLARE_ENUMS
37 #include "libmesh/enum_solver_package.h"
38 #include "libmesh/enum_preconditioner_type.h"
49 template <
typename T>
class SparseMatrix;
50 template <
typename T>
class NumericVector;
51 template <
typename T>
class ShellMatrix;
86 static std::unique_ptr<Preconditioner<T>>
96 #ifdef LIBMESH_ENABLE_DEPRECATED
98 build(
const libMesh::Parallel::Communicator &
comm,
172 template <
typename T>
179 template <
typename T>
188 template <
typename T>
194 _preconditioner_type = pct;
200 #endif // LIBMESH_PRECONDITIONER_H
SolverPackage
Defines an enum for various linear solver packages.
virtual void apply(const NumericVector< T > &x, NumericVector< T > &y)=0
Computes the preconditioned vector y based on input vector x.
PreconditionerType _preconditioner_type
Enum stating with type of preconditioner to use.
This class implements reference counting.
The libMesh namespace provides an interface to certain functionality in the library.
const Parallel::Communicator & comm() const
SolverPackage default_solver_package()
virtual void setup()
This is called every time the "operator might have changed".
virtual void init()
Initialize data structures if not done so already.
Preconditioner(const libMesh::Parallel::Communicator &comm)
Constructor.
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
void set_type(const PreconditionerType pct)
Sets the type of preconditioner to use.
SparseMatrix< T > * _matrix
The matrix P...
This class provides a uniform interface for preconditioners.
virtual ~Preconditioner()
Destructor.
static std::unique_ptr< Preconditioner< T > > build_preconditioner(const libMesh::Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())
Builds a Preconditioner using the linear solver package specified by solver_package,...
static Preconditioner< T > * build(const libMesh::Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())
Builds a Preconditioner using the linear solver package specified by solver_package.
virtual void clear()
Release all memory and clear data structures.
PreconditionerType
Defines an enum for preconditioner types.
void set_matrix(SparseMatrix< Number > &mat)
Sets the matrix to be preconditioned.
bool _is_initialized
Flag that tells if init() has been called.
bool _is_initialized
Flag indicating if the data structures have been initialized.
An object whose state is distributed along a set of processors.
PreconditionerType type() const
void ErrorVector unsigned int