Ifpack2 Templated Preconditioning Package Version 1.0
Public Types | Public Member Functions | Public Attributes
Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node > Class Template Reference

Interface for all Ifpack2 preconditioners. More...

#include <Ifpack2_Preconditioner.hpp>

Inheritance diagram for Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef Teuchos::ScalarTraits
< Scalar >::magnitudeType 
magnitude_type
 The type of the magnitude (absolute value) of a matrix entry.

Public Member Functions

virtual ~Preconditioner ()
 Destructor.
virtual void setParameters (const Teuchos::ParameterList &List)=0
 Set this preconditioner's parameters.
virtual void initialize ()=0
 Set up the graph structure of this preconditioner.
virtual bool isInitialized () const =0
 True if the preconditioner has been successfully initialized, else false.
virtual void compute ()=0
 Set up the numerical values in this preconditioner.
virtual bool isComputed () const =0
 True if the preconditioner has been successfully computed, else false.
virtual magnitude_type
TEUCHOS_DEPRECATED 
computeCondEst (CondestType CT=Ifpack2::Cheap, LocalOrdinal MaxIters=1550, magnitude_type Tol=1e-9, const Teuchos::Ptr< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &Matrix=Teuchos::null)=0
 Compute the condition number estimate and return its value.
virtual magnitude_type
TEUCHOS_DEPRECATED 
getCondEst () const =0
 Return the computed condition number estimate, or -1 if not computed.
virtual Teuchos::RCP< const
Tpetra::RowMatrix< Scalar,
LocalOrdinal, GlobalOrdinal,
Node > > 
getMatrix () const =0
 The input matrix given to the constructor.
virtual int getNumInitialize () const =0
 The number of calls to initialize().
virtual int getNumCompute () const =0
 The number of calls to compute().
virtual int getNumApply () const =0
 The number of calls to apply().
virtual double getInitializeTime () const =0
 The time (in seconds) spent in initialize().
virtual double getComputeTime () const =0
 The time (in seconds) spent in compute().
virtual double getApplyTime () const =0
 The time (in seconds) spent in apply().
Methods implementing Tpetra::Operator.
virtual Teuchos::RCP< const
Tpetra::Map< LocalOrdinal,
GlobalOrdinal, Node > > 
getDomainMap () const =0
 The domain Map of this operator.
virtual Teuchos::RCP< const
Tpetra::Map< LocalOrdinal,
GlobalOrdinal, Node > > 
getRangeMap () const =0
 The range Map of this operator.
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.

Public Attributes

TEUCHOS_DEPRECATED typedef
Teuchos::ScalarTraits< Scalar >
::magnitudeType 
magnitudeType
 Preserved only for backwards compatibility. Please use magnitude_type instead.

Detailed Description

template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
class Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >

Interface for all Ifpack2 preconditioners.

Template Parameters:
ScalarType of the matrix's entries; same as the first template parameter of Tpetra::RowMatrix
LocalOrdinalType of the matrix's local indices; same as the second template parameter of Tpetra::RowMatrix
GlobalOrdinalType of the matrix's global indices; same as the third template parameter of Tpetra::RowMatrix
NodeThe matrix's Kokkos Node type; same as the fourth template parameter of Tpetra::RowMatrix

The Preconditioner class defines the interface that all Ifpack2 preconditioners must implement. Preconditioner inherits from Tpetra::Operator. Its apply() method applies the preconditioner. (If you are familiar with the IFPACK package, please be aware that this is different from IFPACK. In IFPACK, the ApplyInverse() method applies or "solves with" the preconditioner \(M^{-1}\), and the Apply() method "applies" the preconditioner \(M\). In Ifpack2, the apply() method applies or "solves with" the preconditioner \(M^{-1}\), and there is no method comparable to Apply() in IFPACK.)

Preconditioner provides the following methods

Implementations of compute() must internally call initialize() if isInitialized() returns false. The preconditioner is applied by apply() (which returns if isComputed() is false). Every time that initialize() is called, the object destroys all the previously allocated information, and reinitializes the preconditioner. Every time compute() is called, the object recomputes the actual values of the preconditioner.


Member Typedef Documentation

template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
typedef Teuchos::ScalarTraits<Scalar>::magnitudeType Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::magnitude_type

Constructor & Destructor Documentation

template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::~Preconditioner ( ) [inline, virtual]

Destructor.


Member Function Documentation

template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getDomainMap ( ) const [pure virtual]
template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getRangeMap ( ) const [pure virtual]
template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual void Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::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 [pure virtual]

Apply the preconditioner to X, putting the result in Y.

If the result of applying this preconditioner to a vector X is \(F \cdot X$\), then this method computes \(\beta Y + \alpha F \cdot X\). The typical case is \(\beta = 0\) and \(\alpha = 1\).

Implemented in Ifpack2::AdditiveSchwarz< MatrixType, LocalInverseType >, Ifpack2::BlockRelaxation< MatrixType, ContainerType >, Ifpack2::Chebyshev< MatrixType >, Ifpack2::Details::Amesos2Wrapper< MatrixType >, Ifpack2::Details::DenseSolver< MatrixType, false >, Ifpack2::Hiptmair< MatrixType >, Ifpack2::IdentitySolver< MatrixType >, Ifpack2::ILUT< MatrixType >, Ifpack2::Krylov< MatrixType >, Ifpack2::Relaxation< MatrixType >, and Ifpack2::RILUK< MatrixType >.

template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual void Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::setParameters ( const Teuchos::ParameterList List) [pure virtual]
template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual void Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::initialize ( ) [pure virtual]

Set up the graph structure of this preconditioner.

If the graph structure of the constructor's input matrix has changed, or if you have not yet called initialize(), you must call initialize() before you may call compute() or apply().

Thus, initialize() corresponds to the "symbolic factorization" step of a sparse factorization, whether or not the specific preconditioner actually does a sparse factorization.

Implemented in Ifpack2::AdditiveSchwarz< MatrixType, LocalInverseType >, Ifpack2::BlockRelaxation< MatrixType, ContainerType >, Ifpack2::Chebyshev< MatrixType >, Ifpack2::Details::Amesos2Wrapper< MatrixType >, Ifpack2::Details::DenseSolver< MatrixType, false >, Ifpack2::Hiptmair< MatrixType >, Ifpack2::IdentitySolver< MatrixType >, Ifpack2::ILUT< MatrixType >, Ifpack2::Krylov< MatrixType >, Ifpack2::Relaxation< MatrixType >, and Ifpack2::RILUK< MatrixType >.

template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual bool Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::isInitialized ( ) const [pure virtual]
template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual void Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::compute ( ) [pure virtual]

Set up the numerical values in this preconditioner.

If the values of the constructor's input matrix have changed, or if you have not yet called compute(), you must call compute() before you may call apply().

Thus, compute() corresponds to the "numeric factorization" step of a sparse factorization, whether or not the specific preconditioner actually does a sparse factorization.

Implemented in Ifpack2::AdditiveSchwarz< MatrixType, LocalInverseType >, Ifpack2::BlockRelaxation< MatrixType, ContainerType >, Ifpack2::Chebyshev< MatrixType >, Ifpack2::Details::Amesos2Wrapper< MatrixType >, Ifpack2::Details::DenseSolver< MatrixType, false >, Ifpack2::Hiptmair< MatrixType >, Ifpack2::IdentitySolver< MatrixType >, Ifpack2::ILUT< MatrixType >, Ifpack2::Krylov< MatrixType >, Ifpack2::Relaxation< MatrixType >, and Ifpack2::RILUK< MatrixType >.

template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual bool Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::isComputed ( ) const [pure virtual]
template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual magnitude_type TEUCHOS_DEPRECATED Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::computeCondEst ( CondestType  CT = Ifpack2::Cheap,
LocalOrdinal  MaxIters = 1550,
magnitude_type  Tol = 1e-9,
const Teuchos::Ptr< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &  Matrix = Teuchos::null 
) [pure virtual]

Compute the condition number estimate and return its value.

Warning:
This method is DEPRECATED. It was inherited from Ifpack, and Ifpack never clearly stated what this method computes. Furthermore, Ifpack's method just estimates the condition number of the matrix A, and ignores the preconditioner -- which is probably not what users thought it did. If there is sufficient interest, we might reintroduce this method with a different meaning and a better algorithm.

Implemented in Ifpack2::Details::Amesos2Wrapper< MatrixType >, Ifpack2::Hiptmair< MatrixType >, Ifpack2::IdentitySolver< MatrixType >, Ifpack2::ILUT< MatrixType >, and Ifpack2::Krylov< MatrixType >.

template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual magnitude_type TEUCHOS_DEPRECATED Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getCondEst ( ) const [pure virtual]
template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual Teuchos::RCP<const Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getMatrix ( ) const [pure virtual]
template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual int Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getNumInitialize ( ) const [pure virtual]
template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual int Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getNumCompute ( ) const [pure virtual]
template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual int Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getNumApply ( ) const [pure virtual]
template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual double Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getInitializeTime ( ) const [pure virtual]
template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual double Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getComputeTime ( ) const [pure virtual]
template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual double Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getApplyTime ( ) const [pure virtual]

Member Data Documentation

template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
TEUCHOS_DEPRECATED typedef Teuchos::ScalarTraits<Scalar>::magnitudeType Ifpack2::Preconditioner< Scalar, LocalOrdinal, GlobalOrdinal, Node >::magnitudeType

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends