20 #ifndef LIBMESH_PETSC_PRECONDITIONER_H 21 #define LIBMESH_PETSC_PRECONDITIONER_H 23 #include "libmesh/libmesh_config.h" 25 #ifdef LIBMESH_HAVE_PETSC 28 #include "libmesh/preconditioner.h" 29 #include "libmesh/libmesh_common.h" 30 #include "libmesh/reference_counted_object.h" 31 #include "libmesh/libmesh.h" 32 #include "libmesh/petsc_macro.h" 33 #include "libmesh/wrapped_petsc.h" 42 template <
typename T>
class SparseMatrix;
43 template <
typename T>
class NumericVector;
44 template <
typename T>
class ShellMatrix;
69 virtual void clear ()
override;
71 virtual void init ()
override;
110 #endif // #ifdef LIBMESH_HAVE_PETSC 111 #endif // LIBMESH_PETSC_PRECONDITIONER_H
This class provides an interface to the suite of preconditioners available from PETSc.
Mat _mat
PETSc Mat pulled out of the _matrix object during init().
virtual void init() override
Initialize data structures if not done so already.
PreconditionerType type() const
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
static void set_petsc_subpreconditioner_type(const PCType type, PC &pc)
Some PETSc preconditioners (ILU, LU) don't work in parallel.
The libMesh namespace provides an interface to certain functionality in the library.
virtual void apply(const NumericVector< T > &x, NumericVector< T > &y) override
Computes the preconditioned vector y based on input vector x.
This class provides a uniform interface for preconditioners.
WrappedPetsc< PC > _pc
Preconditioner context.
PetscPreconditioner(const libMesh::Parallel::Communicator &comm_in)
Constructor.
virtual void clear() override
Release all memory and clear data structures.
static void set_petsc_preconditioner_type(const PreconditionerType &preconditioner_type, PC &pc)
Tells PETSc to use the user-specified preconditioner.
PreconditionerType
Defines an enum for preconditioner types.
virtual ~PetscPreconditioner()=default
void ErrorVector unsigned int