Ifpack2 Templated Preconditioning Package Version 1.0
Classes | Enumerations | Functions
Ifpack2 Namespace Reference

Ifpack2::Container: a pure virtual class for creating and solving local linear problems. More...

Classes

class  AdditiveSchwarz
 Additive Schwarz domain decomposition for Tpetra::RowMatrix objects. More...
class  BlockRelaxation
 Ifpack2::BlockRelaxation: defines relaxation preconditioners for Tpetra::RowMatrix objects. More...
class  BorderedOperator
 Ifpack2 bordered operator. More...
class  Diagonal
 A class for diagonal preconditioning. More...
class  DiagonalFilter
 Ifpack2_DiagonalFilter: Filter to modify the diagonal entries of a given Tpetra_RowMatrix. More...
class  DropFilter
 Ifpack2::DropFilter: Filter based on matrix entries. More...
class  Factory
 A factory class to create Ifpack2 preconditioners. More...
class  IlukGraph
 A class for constructing level filled graphs for use with ILU(k) class preconditioners. More...
class  ILUT
 A class for constructing and using an ILUT factorization. More...
struct  BelosScalarType
 A traits class for determining the scalar type to use for Belos. More...
class  Krylov
 A class for constructing and using a CG/GMRES smoother. More...
class  LinearPartitioner
 Ifpack2::LinearPartitioner: A class to define linear partitions. More...
class  LocalFilter
 Ifpack2_LocalFilter a class for light-weight extraction of the submatrix corresponding to local rows and columns. More...
class  OverlapGraph
 Ifpack2::OverlapGraph constructs an overlapped graph. More...
class  OverlappingRowMatrix
 Ifpack2::OverlappingRowMatrix: matrix with ghost rows, based on Tpetra::RowMatrix. More...
class  Partitioner
 Ifpack2::Partitioner: A class to decompose local Ifpack2::Graph objects. More...
class  Preconditioner
 Base class for all Ifpack2 preconditioners. More...
class  Relaxation
 Relaxation preconditioners for Tpetra::RowMatrix and Tpetra::CrsMatrix sparse matrices. More...
class  ReorderFilter
 Ifpack2::ReorderFilter: a class for light-weight reorder of local rows and columns of an Tpetra::RowMatrix. More...
class  RILUK
 ILU(k) (incomplete LU with fill level k) factorization of a given Tpetra::RowMatrix. More...
class  SingletonFilter
 Ifpack2_SingletonFilter: Filter based on matrix entries. More...
class  SparsityFilter
 Ifpack2_SparsityFilter: a class to drop based on sparsity. More...

Enumerations

enum  CondestType { Cheap, CG, GMRES }
 Ifpack2::CondestType: enum to define the type of condition number estimate. More...
enum  ScalingType
 Ifpack2 scaling type selector. More...

Functions

template<class LocalOrdinal , class GlobalOrdinal = LocalOrdinal>
void ConstructLevelFillGraph (const RowGraph< LocalOrdinal, GlobalOrdinal > &userGraph, Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal >> graphL, Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal >> graphU)
 ConstructLevelFillGraph: A function for constructing level filled graphs for use with ILU(k) class preconditioners.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< const
Tpetra::CrsGraph< LocalOrdinal,
GlobalOrdinal, Node > > 
CreateOverlapGraph (const Teuchos::RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &input_graph, int OverlapLevel)
 Constructs an overlapped graph for use with Ifpack2 preconditioners.
template<class MatrixType , class VectorType >
Teuchos::RCP
< Ifpack2::Diagonal
< MatrixType > > 
createDiagonalPreconditioner (const Teuchos::RCP< const VectorType > &invdiag)
bool supportsUnsymmetric (const std::string &prec_type)
 Return true if the specified preconditioner type supports unsymmetric matrices.
template<typename Ordinal , typename SizeType >
void add_to_heap (const Ordinal &idx, Teuchos::Array< Ordinal > &heap, SizeType &heap_len)
template<typename Ordinal , typename SizeType , class Compare >
void add_to_heap (const Ordinal &idx, Teuchos::Array< Ordinal > &heap, SizeType &heap_len, Compare comp)
template<typename Ordinal , typename SizeType >
void rm_heap_root (Teuchos::Array< Ordinal > &heap, SizeType &heap_len)
template<typename Ordinal , typename SizeType , class Compare >
void rm_heap_root (Teuchos::Array< Ordinal > &heap, SizeType &heap_len, Compare comp)
void getValidParameters (Teuchos::ParameterList &params)
 Fills a list which contains all the parameters possibly used by Ifpack2.
template<typename T >
void getParameter (const Teuchos::ParameterList &params, const std::string &name, T &value)
 Set a value from a ParameterList if a parameter with the specified name exists.

Detailed Description

Ifpack2::Container: a pure virtual class for creating and solving local linear problems.

Ifpack2_SparseContainer: a class for storing and solving linear systems using sparse matrices.

Class Ifpack2::Container provides the abstract interfaces for containers. A "container" is an object that hosts all it is necessary to create, populate, and solve local linear problems. The local linear problem matrix, B, is a submatrix of the local components of a distributed matrix, A. The idea of container is to specify the rows of A that are contained in B, then extract B from A, and compute all it is necessary to solve a linear system in B. Then, set starting solution (if necessary) and right-hand side for B, and solve the linear system in B.

A container should be used in the following manner:

The number of vectors can be set using setNumVectors(), and it is defaulted to 1.

Containers are currently used by class Ifpack2::BlockRelaxation.

Ifpack2::Container is a pure virtual class. Two concrete implementations are provided in classes Ifpack2::SparseContainer (that stores matrices in sparse the format Tpetra::CrsMatrix) and Ifpack2::DenseContainer (for relatively small matrices, as matrices are stored as Tpetra::SerialDenseMatrix's).

Note: The MatrixType and InverseType can have different Scalars, ordinals (and even nodes). You can mix and match so long as implicit conversions are available. The most obvious use case for this are: 1) MatrixGlobalOrdinal==long long and InverseGlobalOrdinal==short 2) MatrixScalar=float and InverseScalar=double

Date:
Last update Aug-12.

Classes and functions for templated preconditioning.

To understand what an IFPACK2 container is, please refer to the documentation of the pure virtual class Ifpack2::Container. Currently, containers are used by class Ifpack2::BlockRelaxation.

Using block methods, one needs to store all diagonal blocks and to be also to apply the inverse of each diagonal block. Using class Ifpack2::SparseContainer, one can store the blocks as sparse matrices (Tpetra::CrsMatrix), which can be advantageous when the blocks are large. Otherwise, class Ifpack2::DenseContainer is probably more appropriate.

Sparse containers are templated with a type InverseType, which represent the class to use in the application of the inverse. (InverseType is not used in Ifpack2::DenseContainer). In SparseContainer, T must be an Ifpack2::Preconditioner derived class. The container will allocate a T object, use setParameters() and compute(), then use T every time the linear system as to be solved (using the ApplyInverse() method of T).

Date:
Last modified on Aug-12.

Enumeration Type Documentation

Ifpack2::CondestType: enum to define the type of condition number estimate.

Enumerator:
Cheap 

cheap estimate

CG 

Uses AztecOO's CG.

GMRES 

Uses AztecOO's GMRES.

Ifpack2 scaling type selector.

Selects the type of scaling used (if any) for Ifpack2 preconditioners.


Function Documentation

template<class LocalOrdinal , class GlobalOrdinal = LocalOrdinal>
void Ifpack2::ConstructLevelFillGraph ( const RowGraph< LocalOrdinal, GlobalOrdinal > &  userGraph,
Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal >>  graphL,
Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal >>  graphU 
)

ConstructLevelFillGraph: A function for constructing level filled graphs for use with ILU(k) class preconditioners.

The IlukGraph class enable the construction matrix graphs using level-fill algorithms. The only function required for construction is an ExtractRowView capability, i.e., the matrix that is passed in to the constructor must implement the CrsGraph interface defined in CrsMatrix.hpp

Constructing IlukGraph objects

Constructing IlukGraph objects is usually a two step process of passing in a CrsGraph object and an integer indicating the desired level of fill and then calling the ConstructFilledGraph function to complete the process. This allows warning error codes to be returned to the calling routine.

It is worth noting that an IlukGraph object has two Tpetra::CrsGraph objects containing L and U, the graphs for the lower and upper triangular parts of the ILU(k) graph. Thus, it is possible to manually insert and delete graph entries in L and U via the Tpetra_CrsGraph InsertIndices and RemoveIndices functions. However, in this case FillComplete must be called before the graph is used for subsequent operations.

Parameters:
userGraph(In) - An existing CrsGraph. This object must implement the RowGraph functions that provide graph dimension and pattern information.
levelFill(In) - The level of fill to compute via ILU(k) algorithm.
graphL(Out) - Lower triangular graph with the level k fill pattern.
graphU(Out) - Upper triangular graph with the level k fill pattern.
template<class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP<const Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node> > Ifpack2::CreateOverlapGraph ( const Teuchos::RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &  input_graph,
int  OverlapLevel 
)

Constructs an overlapped graph for use with Ifpack2 preconditioners.

If OverlapLevel is 0, then the overlapped graph is the input_graph.

template<class MatrixType , class VectorType >
Teuchos::RCP<Ifpack2::Diagonal<MatrixType> > Ifpack2::createDiagonalPreconditioner ( const Teuchos::RCP< const VectorType > &  invdiag)

Function to construct a Diagonal preconditioner with vector input. The input vector is assumed to contain the equivalent of the inverted diagonal of a matrix.

Example usage:
typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> TCrsMatrix;
typedef Tpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> TVector;
typedef Tpetra::Preconditioner<Scalar,LocalOrdinal,GlobalOrdinal,Node> TPrec;

Teuchos::RCP<TVector> myvec = ...

Teuchos::RCP<TPrec> prec = Ifpack2::createDiagonalPreconditioner<TCrsMatrix,TVector>(myvec);

bool Ifpack2::supportsUnsymmetric ( const std::string &  prec_type)

Return true if the specified preconditioner type supports unsymmetric matrices.

template<typename Ordinal , typename SizeType >
void Ifpack2::add_to_heap ( const Ordinal &  idx,
Teuchos::Array< Ordinal > &  heap,
SizeType &  heap_len 
)

Add idx to heap, don't assume heap occupies entire vector.

template<typename Ordinal , typename SizeType , class Compare >
void Ifpack2::add_to_heap ( const Ordinal &  idx,
Teuchos::Array< Ordinal > &  heap,
SizeType &  heap_len,
Compare  comp 
)

Add idx to heap, don't assume heap occupies entire vector. Also take custom comparator.

template<typename Ordinal , typename SizeType >
void Ifpack2::rm_heap_root ( Teuchos::Array< Ordinal > &  heap,
SizeType &  heap_len 
)

Remove heap root, don't shorten vector but update a heap_len parameter.

template<typename Ordinal , typename SizeType , class Compare >
void Ifpack2::rm_heap_root ( Teuchos::Array< Ordinal > &  heap,
SizeType &  heap_len,
Compare  comp 
)

Remove heap root, with custom comparator, don't assume heap occupies entire vector.

void Ifpack2::getValidParameters ( Teuchos::ParameterList params)

Fills a list which contains all the parameters possibly used by Ifpack2.

template<typename T >
void Ifpack2::getParameter ( const Teuchos::ParameterList params,
const std::string &  name,
T &  value 
)

Set a value from a ParameterList if a parameter with the specified name exists.

If the specified name does not name a parameter in the list, then 'value' is not referenced.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends