Ifpack2 Templated Preconditioning Package  Version 1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
Ifpack2::Experimental::RBILUK< MatrixType > Class Template Reference

ILU(k) factorization of a given Tpetra::BlockCrsMatrix. More...

#include <Ifpack2_Experimental_RBILUK_decl.hpp>

Inheritance diagram for Ifpack2::Experimental::RBILUK< MatrixType >:
Inheritance graph
[legend]

Public Member Functions

void initialize ()
 Initialize by computing the symbolic incomplete factorization. More...
 
void compute ()
 Compute the (numeric) incomplete factorization. More...
 
Teuchos::RCP< const
block_crs_matrix_type > 
getBlockMatrix () const
 Get the input matrix. More...
 
const block_crs_matrix_type & getLBlock () const
 Return the L factor of the ILU factorization. More...
 
const block_crs_matrix_type & getDBlock () const
 Return the diagonal entries of the ILU factorization. More...
 
const block_crs_matrix_type & getUBlock () const
 Return the U factor of the ILU factorization. More...
 
Implementation of Ifpack2::Details::CanChangeMatrix
void setMatrix (const Teuchos::RCP< const block_crs_matrix_type > &A)
 Change the matrix to be preconditioned. More...
 
Implementation of Teuchos::Describable interface
std::string description () const
 A one-line description of this object. More...
 
Implementation of Tpetra::Operator
void apply (const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(), scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero()) const
 Apply the (inverse of the) incomplete factorization to X, resulting in Y. More...
 
- Public Member Functions inherited from Ifpack2::RILUK< Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > >
 RILUK (const Teuchos::RCP< const row_matrix_type > &A_in)
 Constructor that takes a Tpetra::RowMatrix. More...
 
 RILUK (const Teuchos::RCP< const crs_matrix_type > &A_in)
 Constructor that takes a Tpetra::CrsMatrix. More...
 
Teuchos::RCP< RILUK
< NewMatrixType > > 
clone (const Teuchos::RCP< const NewMatrixType > &A_newnode) const
 Clone preconditioner to a new node type. More...
 
virtual ~RILUK ()
 Destructor (declared virtual for memory safety). More...
 
void setParameters (const Teuchos::ParameterList &params)
 
void initialize ()
 Initialize by computing the symbolic incomplete factorization. More...
 
void compute ()
 Compute the (numeric) incomplete factorization. More...
 
bool isInitialized () const
 Whether initialize() has been called on this object. More...
 
bool isComputed () const
 Whether compute() has been called on this object. More...
 
int getNumInitialize () const
 Number of successful initialize() calls for this object. More...
 
int getNumCompute () const
 Number of successful compute() calls for this object. More...
 
int getNumApply () const
 Number of successful apply() calls for this object. More...
 
double getInitializeTime () const
 Total time in seconds taken by all successful initialize() calls for this object. More...
 
double getComputeTime () const
 Total time in seconds taken by all successful compute() calls for this object. More...
 
double getApplyTime () const
 Total time in seconds taken by all successful apply() calls for this object. More...
 
size_t getNodeSmootherComplexity () const
 Get a rough estimate of cost per iteration. More...
 
Teuchos::RCP< const
row_matrix_type
getMatrix () const
 Get the input matrix. More...
 
magnitude_type getRelaxValue () const
 Get RILU(k) relaxation parameter. More...
 
magnitude_type getAbsoluteThreshold () const
 Get absolute threshold value. More...
 
magnitude_type getRelativeThreshold () const
 Get relative threshold value. More...
 
int getLevelOfFill () const
 Get level of fill (the "k" in ILU(k)). More...
 
Tpetra::CombineMode getOverlapMode ()
 Get overlap mode type. More...
 
Tpetra::global_size_t getGlobalNumEntries () const
 Returns the number of nonzero entries in the global graph. More...
 
Teuchos::RCP
< Ifpack2::IlukGraph
< Tpetra::CrsGraph
< local_ordinal_type,
global_ordinal_type, node_type > > > 
getGraph () const
 Return the Ifpack2::IlukGraph associated with this factored matrix. More...
 
const crs_matrix_typegetL () const
 Return the L factor of the ILU factorization. More...
 
const Tpetra::Vector
< scalar_type,
local_ordinal_type,
global_ordinal_type, node_type > & 
getD () const
 Return the diagonal entries of the ILU factorization. More...
 
const crs_matrix_typegetU () const
 Return the U factor of the ILU factorization. More...
 
Teuchos::RCP< const
crs_matrix_type
getCrsMatrix () const
 Return the input matrix A as a Tpetra::CrsMatrix, if possible; else throws. More...
 
virtual void setMatrix (const Teuchos::RCP< const row_matrix_type > &A)
 Change the matrix to be preconditioned. More...
 
std::string description () const
 A one-line description of this object. More...
 
Teuchos::RCP< const
Tpetra::Map
< local_ordinal_type,
global_ordinal_type, node_type > > 
getDomainMap () const
 Returns the Tpetra::Map object associated with the domain of this operator. More...
 
Teuchos::RCP< const
Tpetra::Map
< local_ordinal_type,
global_ordinal_type, node_type > > 
getRangeMap () const
 Returns the Tpetra::Map object associated with the range of this operator. More...
 
void apply (const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(), scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero()) const
 Apply the (inverse of the) incomplete factorization to X, resulting in Y. More...
 
- Public Member Functions inherited from Ifpack2::Preconditioner< Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::scalar_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::local_ordinal_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::global_ordinal_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::node_type >
virtual ~Preconditioner ()
 Destructor. More...
 
virtual void apply (const Tpetra::MultiVector< Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::scalar_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::local_ordinal_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::global_ordinal_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::node_type > &X, Tpetra::MultiVector< Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::scalar_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::local_ordinal_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::global_ordinal_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::scalar_typealpha=Teuchos::ScalarTraits< Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::scalar_type >::one(), Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::scalar_typebeta=Teuchos::ScalarTraits< Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::scalar_type >::zero()) const =0
 Apply the preconditioner to X, putting the result in Y. More...
 
- Public Member Functions inherited from Ifpack2::Details::CanChangeMatrix< Tpetra::RowMatrix< Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::scalar_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::local_ordinal_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::global_ordinal_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::node_type > >
virtual void setMatrix (const Teuchos::RCP< const Tpetra::RowMatrix< Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::scalar_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::local_ordinal_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::global_ordinal_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::node_type > > &A)=0
 Set the new matrix. More...
 
virtual ~CanChangeMatrix ()
 Destructor. More...
 

Public type definitions.

typedef MatrixType::scalar_type scalar_type
 The type of the entries of the input MatrixType. More...
 
typedef MatrixType::scalar_type impl_scalar_type
 
typedef
MatrixType::local_ordinal_type 
local_ordinal_type
 The type of local indices in the input MatrixType. More...
 
typedef
MatrixType::global_ordinal_type 
global_ordinal_type
 The type of global indices in the input MatrixType. More...
 
typedef MatrixType::node_type node_type
 The Node type used by the input MatrixType. More...
 
typedef Teuchos::ScalarTraits
< scalar_type >::magnitudeType 
magnitude_type
 The type of the magnitude (absolute value) of a matrix entry. More...
 
typedef Tpetra::RowMatrix
< scalar_type,
local_ordinal_type,
global_ordinal_type, node_type
row_matrix_type
 Tpetra::RowMatrix specialization used by this class. More...
 
typedef Tpetra::CrsMatrix
< scalar_type,
local_ordinal_type,
global_ordinal_type, node_type
crs_matrix_type
 Tpetra::CrsMatrix specialization used by this class for representing L and U. More...
 
typedef Tpetra::BlockCrsMatrix
< scalar_type,
local_ordinal_type,
global_ordinal_type, node_type
block_crs_matrix_type
 
template<class NewMatrixType >
class RBILUK
 

Constructors/Destructors.

 RBILUK (const Teuchos::RCP< const row_matrix_type > &A_in)
 Constructor that takes a Tpetra::RowMatrix. More...
 
 RBILUK (const Teuchos::RCP< const block_crs_matrix_type > &A_in)
 Constructor that takes a Tpetra::BlockCrsMatrix. More...
 
virtual ~RBILUK ()
 Destructor (declared virtual for memory safety). More...
 

Additional Inherited Members

- Public Types inherited from Ifpack2::RILUK< Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > >
typedef Tpetra::RowMatrix
< MatrixType::scalar_type,
MatrixType::local_ordinal_type,
MatrixType::global_ordinal_type,
MatrixType::node_type >
::scalar_type 
scalar_type
 The type of the entries of the input MatrixType. More...
 
typedef Tpetra::RowMatrix
< MatrixType::scalar_type,
MatrixType::local_ordinal_type,
MatrixType::global_ordinal_type,
MatrixType::node_type >
::local_ordinal_type 
local_ordinal_type
 The type of local indices in the input MatrixType. More...
 
typedef Tpetra::RowMatrix
< MatrixType::scalar_type,
MatrixType::local_ordinal_type,
MatrixType::global_ordinal_type,
MatrixType::node_type >
::global_ordinal_type 
global_ordinal_type
 The type of global indices in the input MatrixType. More...
 
typedef Tpetra::RowMatrix
< MatrixType::scalar_type,
MatrixType::local_ordinal_type,
MatrixType::global_ordinal_type,
MatrixType::node_type >
::node_type 
node_type
 The Node type used by the input MatrixType. More...
 
typedef Teuchos::ScalarTraits
< scalar_type >::magnitudeType 
magnitude_type
 The type of the magnitude (absolute value) of a matrix entry. More...
 
typedef Tpetra::RowMatrix
< scalar_type,
local_ordinal_type,
global_ordinal_type, node_type
row_matrix_type
 Tpetra::RowMatrix specialization used by this class. More...
 
typedef Tpetra::CrsMatrix
< scalar_type,
local_ordinal_type,
global_ordinal_type, node_type
crs_matrix_type
 Tpetra::CrsMatrix specialization used by this class for representing L and U. More...
 
- Public Types inherited from Ifpack2::Preconditioner< Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::scalar_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::local_ordinal_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::global_ordinal_type, Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >::node_type >
typedef Teuchos::ScalarTraits
< Tpetra::RowMatrix
< MatrixType::scalar_type,
MatrixType::local_ordinal_type,
MatrixType::global_ordinal_type,
MatrixType::node_type >
::scalar_type >::magnitudeType 
magnitude_type
 The type of the magnitude (absolute value) of a matrix entry. More...
 
- Protected Attributes inherited from Ifpack2::RILUK< Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > >
Teuchos::RCP< const
row_matrix_type
A_
 The (original) input matrix for which to compute ILU(k). More...
 
Teuchos::RCP
< Ifpack2::IlukGraph
< Tpetra::CrsGraph
< local_ordinal_type,
global_ordinal_type, node_type > > > 
Graph_
 The ILU(k) graph. More...
 
Teuchos::RCP< const
row_matrix_type
A_local_
 The matrix whos numbers are used to to compute ILU(k). The graph may be computed using a crs_matrix_type that initialize() constructs temporarily. More...
 
Teuchos::RCP< crs_matrix_typeL_
 The L (lower triangular) factor of ILU(k). More...
 
Teuchos::RCP
< LocalSparseTriangularSolver
< row_matrix_type > > 
L_solver_
 Sparse triangular solver for L. More...
 
Teuchos::RCP< crs_matrix_typeU_
 The U (upper triangular) factor of ILU(k). More...
 
Teuchos::RCP
< LocalSparseTriangularSolver
< row_matrix_type > > 
U_solver_
 Sparse triangular solver for U. More...
 
Teuchos::RCP< vec_type > D_
 The diagonal entries of the ILU(k) factorization. More...
 

Detailed Description

template<class MatrixType>
class Ifpack2::Experimental::RBILUK< MatrixType >

ILU(k) factorization of a given Tpetra::BlockCrsMatrix.

Template Parameters
MatrixTypeA specialization of Tpetra::RowMatrix.

This class implements a "relaxed" incomplete ILU (ILU) factorization with level k fill. It is based upon the ILU algorithms outlined in Yousef Saad's "Iterative Methods for Sparse Linear Systems", 2nd edition, Chapter 10.

Parameters

For a complete list of valid parameters, see the documentation of setParameters().

The computed factorization is a function of several parameters:

Member Typedef Documentation

template<class MatrixType>
typedef MatrixType::scalar_type Ifpack2::Experimental::RBILUK< MatrixType >::scalar_type

The type of the entries of the input MatrixType.

template<class MatrixType>
typedef MatrixType::local_ordinal_type Ifpack2::Experimental::RBILUK< MatrixType >::local_ordinal_type

The type of local indices in the input MatrixType.

template<class MatrixType>
typedef MatrixType::global_ordinal_type Ifpack2::Experimental::RBILUK< MatrixType >::global_ordinal_type

The type of global indices in the input MatrixType.

template<class MatrixType>
typedef MatrixType::node_type Ifpack2::Experimental::RBILUK< MatrixType >::node_type

The Node type used by the input MatrixType.

template<class MatrixType>
typedef Teuchos::ScalarTraits<scalar_type>::magnitudeType Ifpack2::Experimental::RBILUK< MatrixType >::magnitude_type

The type of the magnitude (absolute value) of a matrix entry.

template<class MatrixType>
typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type> Ifpack2::Experimental::RBILUK< MatrixType >::row_matrix_type

Tpetra::RowMatrix specialization used by this class.

template<class MatrixType>
typedef Tpetra::CrsMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type> Ifpack2::Experimental::RBILUK< MatrixType >::crs_matrix_type

Tpetra::CrsMatrix specialization used by this class for representing L and U.

Constructor & Destructor Documentation

template<class MatrixType >
Ifpack2::Experimental::RBILUK< MatrixType >::RBILUK ( const Teuchos::RCP< const row_matrix_type > &  A_in)

Constructor that takes a Tpetra::RowMatrix.

Parameters
A_in[in] The input matrix.
template<class MatrixType >
Ifpack2::Experimental::RBILUK< MatrixType >::RBILUK ( const Teuchos::RCP< const block_crs_matrix_type > &  A_in)

Constructor that takes a Tpetra::BlockCrsMatrix.

Parameters
A_in[in] The input matrix.
template<class MatrixType >
Ifpack2::Experimental::RBILUK< MatrixType >::~RBILUK ( )
virtual

Destructor (declared virtual for memory safety).

Member Function Documentation

template<class MatrixType >
void Ifpack2::Experimental::RBILUK< MatrixType >::initialize ( )
virtual
template<class MatrixType >
void Ifpack2::Experimental::RBILUK< MatrixType >::compute ( )
virtual
template<class MatrixType >
void Ifpack2::Experimental::RBILUK< MatrixType >::setMatrix ( const Teuchos::RCP< const block_crs_matrix_type > &  A)

Change the matrix to be preconditioned.

Parameters
A[in] The new matrix.
Postcondition
! isInitialized ()
! isComputed ()

Calling this method resets the preconditioner's state. After calling this method with a nonnull input, you must first call initialize() and compute() (in that order) before you may call apply().

You may call this method with a null input. If A is null, then you may not call initialize() or compute() until you first call this method again with a nonnull input. This method invalidates any previous factorization whether or not A is null, so calling setMatrix() with a null input is one way to clear the preconditioner's state (and free any memory that it may be using).

The new matrix A need not necessarily have the same Maps or even the same communicator as the original matrix.

template<class MatrixType >
std::string Ifpack2::Experimental::RBILUK< MatrixType >::description ( ) const

A one-line description of this object.

template<class MatrixType >
void Ifpack2::Experimental::RBILUK< MatrixType >::apply ( const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &  X,
Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &  Y,
Teuchos::ETransp  mode = Teuchos::NO_TRANS,
scalar_type  alpha = Teuchos::ScalarTraits<scalar_type>::one (),
scalar_type  beta = Teuchos::ScalarTraits<scalar_type>::zero () 
) const

Apply the (inverse of the) incomplete factorization to X, resulting in Y.

For an incomplete factorization \(A \approx LDU\), this method computes the following, depending on the value of mode:

  • If mode = Teuchos::NO_TRANS, it computes Y = beta*Y + alpha*(U \ (D \ (L \ X)))
  • If mode = Teuchos::TRANS, it computes Y = beta*Y + alpha*(L^T \ (D^T \ (U^T \ X)))
  • If mode = Teuchos::CONJ_TRANS, it computes Y = beta*Y + alpha*(L^* \ (D^* \ (U^* \ X))), where the asterisk indicates the conjugate transpose.

If alpha is zero, then the result of applying the operator to a vector is ignored. This matters because zero times NaN (not a number) is NaN, not zero. Analogously, if beta is zero, then any values in Y on input are ignored.

Parameters
X[in] The input multivector.
Y[in/out] The output multivector.
mode[in] If Teuchos::TRANS resp. Teuchos::CONJ_TRANS, apply the transpose resp. conjugate transpose of the incomplete factorization. Otherwise, don't apply the tranpose.
alpha[in] Scaling factor for the result of applying the preconditioner.
beta[in] Scaling factor for the initial value of Y.
template<class MatrixType >
Teuchos::RCP< const typename RBILUK< MatrixType >::block_crs_matrix_type > Ifpack2::Experimental::RBILUK< MatrixType >::getBlockMatrix ( ) const

Get the input matrix.

template<class MatrixType >
const RBILUK< MatrixType >::block_crs_matrix_type & Ifpack2::Experimental::RBILUK< MatrixType >::getLBlock ( ) const

Return the L factor of the ILU factorization.

template<class MatrixType >
const RBILUK< MatrixType >::block_crs_matrix_type & Ifpack2::Experimental::RBILUK< MatrixType >::getDBlock ( ) const

Return the diagonal entries of the ILU factorization.

template<class MatrixType >
const RBILUK< MatrixType >::block_crs_matrix_type & Ifpack2::Experimental::RBILUK< MatrixType >::getUBlock ( ) const

Return the U factor of the ILU factorization.


The documentation for this class was generated from the following files: