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::Details::OneLevelFactory< MatrixType > Class Template Reference

"Factory" for creating single-level preconditioners. More...

#include <Ifpack2_Details_OneLevelFactory_decl.hpp>

Public Member Functions

Teuchos::RCP< prec_typecreate (const std::string &precType, const Teuchos::RCP< const row_matrix_type > &matrix) const
 Create an instance of Preconditioner given the string name of the preconditioner type. More...
 

Detailed Description

template<class MatrixType>
class Ifpack2::Details::OneLevelFactory< MatrixType >

"Factory" for creating single-level preconditioners.

Warning
This class is an implementation detail of Ifpack2. Users must not rely on it continuing to exist, on its name, or on its contents.

This class exists so that Ifpack2's "multi-level" (nested) preconditioners – AdditiveSchwarz and SupportGraph (if enabled) – can create a default inner preconditioner. These preconditioners can't use Ifpack2::Factory, because that would introduce a circular dependency between them and Ifpack2::Factory. (Ifpack2::Factory has to be able to create AdditiveSchwarz, for example.) Ifpack2 indicates that a preconditioner is multi-level if it implements Details::NestedPreconditioner.

We resolve the circular dependency using this class, OneLevelFactory. OneLevelFactory knows how to create all of Ifpack2's "single-level" (not multi-level) preconditioners. This includes Diagonal, Relaxation, and the incomplete factorizations (like ILUT and RILUK).

The preferred way to create Ifpack2 preconditioners is to use Factory. Users who create a multi-level preconditioner using Factory will be able to specify any arbitrary Ifpack2 preconditioner as an inner preconditioner for the "outer" multi-level preconditioner. However, if users create a multi-level preconditioner directly (by calling its constructor, not by using Factory), the preconditioner will use OneLevelFactory to create its inner solver. This means that if users create a multi-level preconditioner by calling its constructor, then they are limited to single-level inner preconditioners. Full generality is only possible using Factory, or by creating an arbitrary inner preconditioner themselves and giving it to the "outer" preconditioner (by calling its setInnerPreconditioner() method).

This class' create() method lets users create an instance of any single-level Ifpack2 preconditioner.

The create() method has two arguments:

  1. a string, indicating the type of preconditioner to compute; and
  2. a Tpetra::RowMatrix, representing the input matrix (to be used to define the preconditioner)

The first argument is not case sensitive. It can assume the following values:

Member Function Documentation

template<class MatrixType >
Teuchos::RCP< typename OneLevelFactory< MatrixType >::prec_type > Ifpack2::Details::OneLevelFactory< MatrixType >::create ( const std::string &  precType,
const Teuchos::RCP< const row_matrix_type > &  matrix 
) const

Create an instance of 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

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


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