Ifpack2 Templated Preconditioning Package  Version 1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Ifpack2_Preconditioner.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Ifpack2: Templated Object-Oriented Algebraic Preconditioner Package
4 //
5 // Copyright 2009 NTESS and the Ifpack2 contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
11 
12 #ifndef IFPACK2_PRECONDITIONER_HPP
13 #define IFPACK2_PRECONDITIONER_HPP
14 
15 #include "Ifpack2_ConfigDefs.hpp"
16 #include "Tpetra_Operator.hpp"
17 #include "Tpetra_RowMatrix.hpp"
19 #include "Teuchos_ScalarTraits.hpp"
20 #include <iostream>
21 
22 namespace Ifpack2 {
23 
66 template<class Scalar =
67  Tpetra::Operator<>::scalar_type,
68  class LocalOrdinal =
69  typename Tpetra::Operator<Scalar>::local_ordinal_type,
70  class GlobalOrdinal =
71  typename Tpetra::Operator<Scalar, LocalOrdinal>::global_ordinal_type,
72  class Node =
73  typename Tpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal>::node_type>
75  virtual public Tpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
76 public:
79 
81  virtual ~Preconditioner(){}
82 
84 
85 
91  getDomainMap () const = 0;
92 
98  getRangeMap () const = 0;
99 
105  virtual void
106  apply (const Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &X,
107  Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &Y,
109  Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(),
110  Scalar beta = Teuchos::ScalarTraits<Scalar>::zero()) const = 0;
112 
114  virtual void setParameters (const Teuchos::ParameterList& List) = 0;
115 
116  virtual bool supportsZeroStartingSolution () { return false; };
117 
119  virtual void setZeroStartingSolution (bool zeroStartingSolution) { TEUCHOS_ASSERT(false); };
120 
130  virtual void initialize() = 0;
131 
133  virtual bool isInitialized() const = 0;
134 
144  virtual void compute() = 0;
145 
147  virtual bool isComputed() const = 0;
148 
151 
153  virtual int getNumInitialize() const = 0;
154 
156  virtual int getNumCompute() const = 0;
157 
159  virtual int getNumApply() const = 0;
160 
162  virtual double getInitializeTime() const = 0;
163 
165  virtual double getComputeTime() const = 0;
166 
168  virtual double getApplyTime() const = 0;
169 };
170 
171 }//namespace Ifpack2
172 
173 #endif // IFPACK2_PRECONDITIONER_HPP
virtual Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const =0
The domain Map of this operator.
virtual int getNumApply() const =0
The number of calls to apply().
virtual void setZeroStartingSolution(bool zeroStartingSolution)
Set this preconditioner&#39;s parameters.
Definition: Ifpack2_Preconditioner.hpp:119
virtual Teuchos::RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getMatrix() const =0
The input matrix given to the constructor.
Teuchos::ScalarTraits< Scalar >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_Preconditioner.hpp:78
virtual void compute()=0
Set up the numerical values in this preconditioner.
virtual Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const =0
The range Map of this operator.
virtual int getNumCompute() const =0
The number of calls to compute().
Interface for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:74
virtual double getInitializeTime() const =0
The time (in seconds) spent in initialize().
virtual void initialize()=0
Set up the graph structure of this preconditioner.
virtual bool isComputed() const =0
True if the preconditioner has been successfully computed, else false.
virtual int getNumInitialize() const =0
The number of calls to initialize().
virtual void setParameters(const Teuchos::ParameterList &List)=0
Set this preconditioner&#39;s parameters.
virtual double getComputeTime() const =0
The time (in seconds) spent in compute().
#define TEUCHOS_ASSERT(assertion_test)
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
Apply the preconditioner to X, putting the result in Y.
virtual ~Preconditioner()
Destructor.
Definition: Ifpack2_Preconditioner.hpp:81
virtual bool isInitialized() const =0
True if the preconditioner has been successfully initialized, else false.
virtual double getApplyTime() const =0
The time (in seconds) spent in apply().