Ifpack2 Templated Preconditioning Package
Version 1.0
|
"Factory" for creating single-level preconditioners. More...
#include <Ifpack2_Details_OneLevelFactory_decl.hpp>
Public Member Functions | |
Teuchos::RCP< prec_type > | 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. More... | |
"Factory" for creating single-level preconditioners.
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:
The first argument is not case sensitive. It can assume the following values:
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.
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.