Ifpack2 Templated Preconditioning Package Version 1.0
Static Public Member Functions
Ifpack2::Factory Class Reference

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

#include <Ifpack2_Factory.hpp>

List of all members.

Static Public Member Functions

template<class MatrixType >
static Teuchos::RCP
< Ifpack2::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)
 Create an instance of Ifpack2_Preconditioner given the string name of the preconditioner type.
template<class MatrixType , class M2 >
static Teuchos::RCP
< Ifpack2::Preconditioner
< typename M2::scalar_type,
typename
M2::local_ordinal_type,
typename
M2::global_ordinal_type,
typename M2::node_type > > 
clone (const Teuchos::RCP< Ifpack2::Preconditioner< typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > &prec, const Teuchos::RCP< const M2 > &matrix, const Teuchos::ParameterList &params=Teuchos::ParameterList())
 Clones a preconditioner for a different node type from an Ifpack2 RILUK or Chebyshev preconditioner.

Detailed Description

A factory class to create Ifpack2 preconditioners.

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

The create() method has three arguments:

The first argument can assume the following values:

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

#include "Ifpack2_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 Ifpack2::Preconditioner<Scalar,LocalOrdinal,GlobalOrdinal,Node> TPrecond;
...
Ifpack2::Factory 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);

Teuchos::ParameterList params;
params.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< Ifpack2::Preconditioner< typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > Ifpack2::Factory::create ( const std::string &  prec_type,
const Teuchos::RCP< const MatrixType > &  matrix,
const int  overlap = 0 
) [static]

Create an instance of Ifpack2_Preconditioner given the string name of the preconditioner type.

Parameters:
PrecType[in] Name of preconditioner type to be created.
Matrix[in] Matrix used to define the preconditioner
overlap(in) Specified overlap; defaults to 0.

Throw an exception if the preconditioner with that input name does not exist. Otherwise, return a newly created preconditioner object.

template<class MatrixType , class M2 >
Teuchos::RCP< Ifpack2::Preconditioner< typename M2::scalar_type, typename M2::local_ordinal_type, typename M2::global_ordinal_type, typename M2::node_type > > Ifpack2::Factory::clone ( const Teuchos::RCP< Ifpack2::Preconditioner< typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > &  prec,
const Teuchos::RCP< const M2 > &  matrix,
const Teuchos::ParameterList params = Teuchos::ParameterList() 
) [static]

Clones a preconditioner for a different node type from an Ifpack2 RILUK or Chebyshev preconditioner.


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