Tifpack::Factory Class Reference

A factory class to create Tifpack preconditioners. More...

#include <Tifpack_Factory.hpp>

List of all members.

Static Public Member Functions

template<class MatrixType >
static Teuchos::RCP
< Tifpack::Preconditioner
< typename
MatrixType::scalar_type,
typename
MatrixType::local_ordinal_type,
typename
MatrixType::global_ordinal_type,
typename MatrixType::node_type > > 
create (const std::string &prec_type, const Teuchos::RCP< const MatrixType > &matrix, const int overlap=0)
 Creates an instance of Tifpack_Preconditioner given the string name of the preconditioner type (throws exception if given unrecognized name).

Detailed Description

A factory class to create Tifpack preconditioners.

Tifpack::Factory contains just one method: create(). Using Tifpack::Factory::create(), users can easily create a variety of Tifpack preconditioners.

create requires 3 arguments:

The first argument can assume the following values:

The following fragment of code shows the basic usage of this class.

#include "Tifpack_Factory.hpp"

...
typedef double Scalar;
typedef int    LocalOrdinal;
typedef int    GlobalOrdinal;
typedef Tpetra::DefaultPlatform::DefaultPlatformType::NodeType Node;
typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> TCrsMatrix;
typedef Tifpack::Preconditioner<Scalar,LocalOrdinal,GlobalOrdinal,Node> TPrecond;
...
Tifpack::Factory<Scalar,LocalOrdinal,GlobalOrdinal,Node> Factory;

Teuchos::RCP<TCrsMatrix> A; // A is fillComplete()'d.
std::string PrecType = "ILUT"; // use incomplete LU on each process
Teuchos::RCP<TPrecond> Prec = Factory.create(PrecType, A);
assert (Prec != Teuchos::null);

Teuchos::ParameterList List;
List.set("fact: ilut level-of-fill", 5.0); // use ILUT(fill=5, drop=0)

Prec->SetParameters(List);
Prec->Initialize();
Prec->Compute();

// now Prec can be used as a preconditioner

Member Function Documentation

template<class MatrixType >
Teuchos::RCP< Tifpack::Preconditioner< typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > Tifpack::Factory::create ( const std::string &  prec_type,
const Teuchos::RCP< const MatrixType > &  matrix,
const int  overlap = 0 
) [inline, static]

Creates an instance of Tifpack_Preconditioner given the string name of the preconditioner type (throws exception if given unrecognized name).

Parameters:
PrecType (In) - String name of preconditioner type to be created.
Matrix (In) - Matrix used to define the preconditioner
overlap (In) - specified overlap, defaulted to 0.

Returns 0 if the preconditioner with that input name does not exist. Otherwise, return a newly created preconditioner object. Note that the client is responsible for calling delete on the returned object once it is finished using it!


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Generated on Wed Apr 13 09:56:54 2011 for Tifpack Templated Preconditioning Package by  doxygen 1.6.3