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" 37 template <
typename T>
class SparseMatrix;
38 template <
typename T>
class NumericVector;
39 template <
typename T>
class ShellMatrix;
76 static std::unique_ptr<Preconditioner<T>>
150 template <
typename T>
157 template <
typename T>
166 template <
typename T>
172 _preconditioner_type = pct;
178 #endif // LIBMESH_PRECONDITIONER_H virtual void clear()
Release all memory and clear data structures.
PreconditionerType type() const
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.
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
const Parallel::Communicator & comm() const
void set_matrix(SparseMatrix< Number > &mat)
Sets the matrix to be preconditioned.
The libMesh namespace provides an interface to certain functionality in the library.
SolverPackage default_solver_package()
This class provides a uniform interface for preconditioners.
Preconditioner(const libMesh::Parallel::Communicator &comm)
Constructor.
bool _is_initialized
Flag that tells if init() has been called.
This class implements reference counting.
An object whose state is distributed along a set of processors.
bool _is_initialized
Flag indicating if the data structures have been initialized.
PreconditionerType
Defines an enum for preconditioner types.
void set_type(const PreconditionerType pct)
Sets the type of preconditioner to use.
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, returning the result wrapped in a std::unique_ptr for safety.
SolverPackage
Defines an enum for various linear solver packages.
virtual void init()
Initialize data structures if not done so already.
virtual void setup()
This is called every time the "operator might have changed".
void ErrorVector unsigned int
virtual ~Preconditioner()
Destructor.
SparseMatrix< T > * _matrix
The matrix P...