Go to the documentation of this file.
20 #ifndef LIBMESH_TRILINOS_PRECONDITIONER_H
21 #define LIBMESH_TRILINOS_PRECONDITIONER_H
23 #include "libmesh/libmesh_config.h"
25 #ifdef LIBMESH_TRILINOS_HAVE_EPETRA
28 #include "libmesh/preconditioner.h"
29 #include "libmesh/libmesh_common.h"
30 #include "libmesh/reference_counted_object.h"
31 #include "libmesh/libmesh.h"
35 #include "libmesh/ignore_warnings.h"
36 #include "Epetra_Operator.h"
37 #include "Epetra_FECrsMatrix.h"
38 #include "Teuchos_ParameterList.hpp"
39 #include "libmesh/restore_warnings.h"
41 #ifdef LIBMESH_FORWARD_DECLARE_ENUMS
47 #include "libmesh/enum_preconditioner_type.h"
57 template <
typename T>
class SparseMatrix;
58 template <
typename T>
class NumericVector;
59 template <
typename T>
class ShellMatrix;
72 public Epetra_Operator
88 virtual void clear ()
override {}
90 virtual void init ()
override;
95 void set_params(Teuchos::ParameterList & list);
133 virtual int Apply(
const Epetra_MultiVector & X, Epetra_MultiVector & Y)
const override;
134 virtual int ApplyInverse(
const Epetra_MultiVector & r, Epetra_MultiVector & z)
const override;
135 virtual double NormInf()
const override;
136 virtual const char *
Label()
const override;
139 virtual const Epetra_Comm &
Comm()
const override;
148 template <
typename T>
159 template <
typename T>
168 #endif // LIBMESH_TRILINOS_HAVE_EPETRA
169 #endif // LIBMESH_TRILINOS_PRECONDITIONER_H
Epetra_Operator * _prec
Trilinos preconditioner.
virtual void clear() override
Release all memory and clear data structures.
Teuchos::ParameterList _param_list
Parameter list to be used for building the preconditioner.
This class provides an interface to the suite of preconditioners available from Trilinos.
virtual bool HasNormInf() const override
virtual const char * Label() const override
virtual void apply(const NumericVector< T > &x, NumericVector< T > &y) override
Computes the preconditioned vector y based on input vector x.
Epetra_FECrsMatrix * mat()
The libMesh namespace provides an interface to certain functionality in the library.
virtual int SetUseTranspose(bool UseTranspose) override
const Parallel::Communicator & comm() const
void compute()
Compute the preconditioner.
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const override
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
virtual ~TrilinosPreconditioner()
Destructor.
virtual double NormInf() const override
void set_params(Teuchos::ParameterList &list)
Stores a copy of the ParameterList list internally.
virtual int ApplyInverse(const Epetra_MultiVector &r, Epetra_MultiVector &z) const override
virtual const Epetra_Comm & Comm() const override
virtual bool UseTranspose() const override
void set_preconditioner_type(const PreconditionerType &preconditioner_type)
Sets the Trilinos preconditioner to use based on the libMesh PreconditionerType.
This class provides a uniform interface for preconditioners.
virtual const Epetra_Map & OperatorDomainMap() const override
Epetra_FECrsMatrix * _mat
Trilinos matrix that's been pulled out of the _matrix object.
PreconditionerType
Defines an enum for preconditioner types.
virtual const Epetra_Map & OperatorRangeMap() const override
TrilinosPreconditioner(const libMesh::Parallel::Communicator &comm)
Constructor.
virtual void init() override
Initialize data structures if not done so already.
void ErrorVector unsigned int