43 #ifndef IFPACK2_PRECONDITIONER_HPP 44 #define IFPACK2_PRECONDITIONER_HPP 46 #include "Ifpack2_ConfigDefs.hpp" 47 #include "Ifpack2_CondestType.hpp" 48 #include "Kokkos_DefaultNode.hpp" 49 #include "Tpetra_Operator.hpp" 50 #include "Tpetra_RowMatrix.hpp" 51 #include "Teuchos_ParameterList.hpp" 52 #include "Teuchos_ScalarTraits.hpp" 129 template<
class Scalar,
class LocalOrdinal =
int,
class GlobalOrdinal = LocalOrdinal,
class Node = Kokkos::DefaultNode::DefaultNodeType>
130 class Preconditioner :
virtual public Tpetra::Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node> {
133 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType magnitudeType;
142 virtual const Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > &
getDomainMap()
const = 0;
145 virtual const Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > &
getRangeMap()
const = 0;
148 virtual void apply(
const Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &X,
149 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &Y,
150 Teuchos::ETransp mode = Teuchos::NO_TRANS,
151 Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(),
152 Scalar beta = Teuchos::ScalarTraits<Scalar>::zero())
const = 0;
157 virtual void setParameters(
const Teuchos::ParameterList& List) = 0;
173 LocalOrdinal MaxIters = 1550,
174 magnitudeType Tol = 1e-9,
175 const Teuchos::Ptr<
const Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &Matrix = Teuchos::null) = 0;
181 virtual Teuchos::RCP<const Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
getMatrix()
const = 0;
205 #endif // IFPACK2_PRECONDITIONER_HPP virtual int getNumApply() const =0
Returns the number of calls to apply().
CondestType
Ifpack2::CondestType: enum to define the type of condition number estimate.
Definition: Ifpack2_CondestType.hpp:50
virtual magnitudeType getCondEst() const =0
Returns the computed condition number estimate, or -1.0 if not computed.
virtual void compute()=0
Computes all (coefficient) data necessary to apply the preconditioner.
virtual void apply(const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const =0
Applies the effect of the preconditioner.
virtual const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > & getRangeMap() const =0
Returns the Map associated with the range of this operator, which must be compatible with Y...
virtual int getNumInitialize() const =0
Returns the number of calls to initialize().
virtual double getApplyTime() const =0
Returns the time spent in apply().
virtual const Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > & getDomainMap() const =0
Returns the Map associated with the domain of this operator, which must be compatible with X...
virtual double getInitializeTime() const =0
Returns the time spent in initialize().
Base class for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:130
virtual Teuchos::RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getMatrix() const =0
Returns a pointer to the input matrix.
virtual void initialize()=0
Computes all (graph-related) data necessary to initialize the preconditioner.
virtual void setParameters(const Teuchos::ParameterList &List)=0
Sets all parameters for the preconditioner.
virtual bool isInitialized() const =0
Returns true if the preconditioner has been successfully initialized, false otherwise.
virtual bool isComputed() const =0
Returns true if the preconditioner has been successfully computed, false otherwise.
Ifpack2::Container: a pure virtual class for creating and solving local linear problems.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:67
virtual magnitudeType computeCondEst(CondestType CT=Ifpack2::Cheap, LocalOrdinal MaxIters=1550, magnitudeType Tol=1e-9, const Teuchos::Ptr< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &Matrix=Teuchos::null)=0
Computes the condition number estimate and returns its value.
virtual double getComputeTime() const =0
Returns the time spent in compute().
virtual ~Preconditioner()
Destructor.
Definition: Ifpack2_Preconditioner.hpp:136
cheap estimate
Definition: Ifpack2_CondestType.hpp:51
virtual int getNumCompute() const =0
Returns the number of calls to compute().