Construct a preconditioner using a LDU dcomposition of a block 2x2 matrix. More...
#include <Teko_LU2x2PreconditionerFactory.hpp>
Public Member Functions | |
LinearOp | buildPreconditionerOperator (BlockedLinearOp &blo, BlockPreconditionerState &state) const |
Create the LU 2x2 preconditioner operator. More... | |
virtual void | initializeFromParameterList (const Teuchos::ParameterList &settings) |
This function builds the internals of the preconditioner factory from a parameter list. More... | |
virtual Teuchos::RCP < Teuchos::ParameterList > | getRequestedParameters () const |
Request the additional parameters this preconditioner factory needs. More... | |
virtual bool | updateRequestedParameters (const Teuchos::ParameterList &pl) |
Update this object with the fields from a parameter list. More... | |
virtual bool | useFullLDU () const |
Determine the type of inverse operator to build. More... | |
virtual void | setFullLDU (bool value) |
Set the type of inverse operation to use. More... | |
Constructors. | |
LU2x2PreconditionerFactory (LinearOp &invA00, LinearOp &invS) | |
Build a simple static LU2x2 preconditioner. More... | |
LU2x2PreconditionerFactory (LinearOp &hatInvA00, LinearOp &tildeInvA00, LinearOp &invS) | |
Build a simple static LU2x2 preconditioner. More... | |
LU2x2PreconditionerFactory (const Teuchos::RCP< LU2x2Strategy > &strategy) | |
Constructor that permits the most generality in building and . More... | |
LU2x2PreconditionerFactory () | |
Default constructor for use with AutoClone. More... | |
Public Member Functions inherited from Teko::BlockPreconditionerFactory | |
virtual RCP< PreconditionerState > | buildPreconditionerState () const |
Function that permits the construction of an arbitrary BlockPreconditionerState object. More... | |
RCP< BlockPreconditionerState > | buildBlockPreconditionerState () const |
Function that constructs a BlockPreconditionerState object. More... | |
virtual LinearOp | buildPreconditionerOperator (LinearOp &blo, PreconditionerState &state) const |
Function that is called to build the preconditioner for the linear operator that is passed in. More... | |
bool | isCompatible (const Thyra::LinearOpSourceBase< double > &fwdOpSrc) const |
is this operator compatiable with the preconditioner factory? More... | |
Public Member Functions inherited from Teko::PreconditionerFactory | |
void | setInverseLibrary (const Teuchos::RCP< const InverseLibrary > &il) |
Set the inverse library used by this preconditioner factory. More... | |
Teuchos::RCP< const InverseLibrary > | getInverseLibrary () const |
Get the inverse library used by this preconditioner factory. More... | |
void | setRequestHandler (const Teuchos::RCP< RequestHandler > &rh) |
Set the request handler with pointers to the appropriate callbacks. More... | |
Teuchos::RCP< RequestHandler > | getRequestHandler () const |
Get the request handler with pointers to the appropriate callbacks. More... | |
bool | isCompatible (const Thyra::LinearOpSourceBase< double > &fwdOpSrc) const |
is this operator compatiable with the preconditioner factory? More... | |
Teuchos::RCP < Thyra::PreconditionerBase < double > > | createPrec () const |
create an instance of the preconditioner More... | |
void | initializePrec (const Teuchos::RCP< const Thyra::LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< const Thyra::MultiVectorBase< double > > &solnVec, Thyra::PreconditionerBase< double > *precOp, const Thyra::ESupportSolveUse supportSolveUse) const |
initialize a newly created preconditioner object More... | |
void | initializePrec (const Teuchos::RCP< const Thyra::LinearOpSourceBase< double > > &fwdOpSrc, Thyra::PreconditionerBase< double > *precOp, const Thyra::ESupportSolveUse supportSolveUse) const |
initialize a newly created preconditioner object More... | |
void | uninitializePrec (Thyra::PreconditionerBase< double > *prec, Teuchos::RCP< const Thyra::LinearOpSourceBase< double > > *fwdOpSrc, Thyra::ESupportSolveUse *supportSolveUse) const |
wipe clean a already initialized preconditioner object More... | |
void | setParameterList (const Teuchos::RCP< Teuchos::ParameterList > ¶mList) |
Set parameters from a parameter list and return with default values. More... | |
Teuchos::RCP < Teuchos::ParameterList > | getNonconstParameterList () |
Get the parameter list that was set using setParameterList(). More... | |
Teuchos::RCP < Teuchos::ParameterList > | unsetParameterList () |
Unset the parameter list that was set using setParameterList(). More... | |
Static Public Member Functions | |
static RCP< LU2x2Strategy > | buildStrategy (const std::string &name, const Teuchos::ParameterList &settings, const RCP< const InverseLibrary > &invLib, const RCP< RequestHandler > &rh) |
Builder function for creating strategies. More... | |
static void | addStrategy (const std::string &name, const RCP< Cloneable > &clone) |
Add a strategy to the builder. This is done using the clone pattern. More... | |
Static Public Member Functions inherited from Teko::PreconditionerFactory | |
static Teuchos::RCP < PreconditionerFactory > | buildPreconditionerFactory (const std::string &name, const Teuchos::ParameterList &settings, const Teuchos::RCP< const InverseLibrary > &invLib=Teuchos::null) |
Builder function for creating preconditioner factories (yes this is a factory factory). More... | |
static void | addPreconditionerFactory (const std::string &name, const Teuchos::RCP< Cloneable > &clone) |
Add a preconditioner factory to the builder. This is done using the clone pattern. More... | |
static void | getPreconditionerFactoryNames (std::vector< std::string > &names) |
Get the names of the block preconditioner factories. More... | |
Protected Attributes | |
Teuchos::RCP< LU2x2Strategy > | invOpsStrategy_ |
some members More... | |
bool | useFullLDU_ |
Protected Attributes inherited from Teko::PreconditionerFactory | |
Teuchos::RCP < Teuchos::ParameterList > | paramList_ |
for ParameterListAcceptor More... | |
Teuchos::RCP< RequestHandler > | callbackHandler_ |
For handling requests and send requests back to the user. More... | |
Construct a preconditioner using a LDU dcomposition of a block 2x2 matrix.
This produces a preconditioner using the block-LDU decomposition of the matrix. The general assumption made is that the matrix is 2x2 and the block factorization can be constructed (i.e. assumptions about the invertability of some blocks). The pattern used, and the one you should follow if you want to use this software is
where the Schur complement is .
To use an LDU approximation 2 evaluations of and a single evalution of are needed. For increased flexibility both evaluations of can be specified independently. For righthand side vector and solution vector the two inverses ( -hat and -tilde) are needed to evaluate
,
where is an intermediate step.
In order to facilate using this class in a nonlinear solve (or for a time-dependent problem) the additional abstraction of a ``Strategy'' has been added. This strategy, abstractly represented as the LU2x2Strategy, provides the and operators. Typical usage for this class is to build a LU2x2Strategy and pass it into the primary constructor. Additional constructors are provided both for convenience and to ease adoption. Underneath the hood all these constructors do is invoke the corresponding strategy object.
For example, assume that you have the particularly nice case that your approximations of and are independent of the source operator. Then, one way to instantiate a LU2x2PreconditionerFactory is
RCP<LinearOpBase<double> > invA00 = buildInvA00(...);
RCP<LinearOpBase<double> > invS = buildInvS(...);
RCP<LU2x2PreconditionerFactory> precFact = rcp(new LU2x2PreconditionerFactory(invA00,invS));
Now using the strategy constructor, an entirely equivalent factory object can be constructed by
RCP<LinearOpBase<double> > invA00 = buildInvA00(...);
RCP<LinearOpBase<double> > invS = buildInvS(...);
RCP<LU2x2Strateghy> precStrat = rcp(new StaticLU2x2Strategy(invA00,invS));
RCP<LU2x2PreconditionerFactory> precFact = rcp(new LU2x2PreconditionerFactory(precStrat));
Notice that the StaticLU2x2Strategy takes the same objects as the original constructor, it acts as an intermediary to tell the LU2x2PreconditionerFactory what those operators are.
Definition at line 104 of file Teko_LU2x2PreconditionerFactory.hpp.
Teko::LU2x2PreconditionerFactory::LU2x2PreconditionerFactory | ( | LinearOp & | invA00, |
LinearOp & | invS | ||
) |
Build a simple static LU2x2 preconditioner.
Definition at line 26 of file Teko_LU2x2PreconditionerFactory.cpp.
Teko::LU2x2PreconditionerFactory::LU2x2PreconditionerFactory | ( | LinearOp & | hatInvA00, |
LinearOp & | tildeInvA00, | ||
LinearOp & | invS | ||
) |
Build a simple static LU2x2 preconditioner.
Definition at line 30 of file Teko_LU2x2PreconditionerFactory.cpp.
Teko::LU2x2PreconditionerFactory::LU2x2PreconditionerFactory | ( | const Teuchos::RCP< LU2x2Strategy > & | strategy | ) |
Constructor that permits the most generality in building and .
Constructor that permits the most generality in building and .
[in] | strategy | Strategy object that takes a 2x2 block matrix and and constructs the and objects. |
Teko::LU2x2PreconditionerFactory::LU2x2PreconditionerFactory | ( | ) |
Default constructor for use with AutoClone.
Default constructor for use with AutoClone
Definition at line 38 of file Teko_LU2x2PreconditionerFactory.cpp.
|
virtual |
Create the LU 2x2 preconditioner operator.
This method breaks apart the BlockLinearOp and builds a block LU preconditioner. This will require two applications of the inverse of the (0,0) block and one application of the inverse Schur complement.
Implements Teko::BlockPreconditionerFactory.
Definition at line 45 of file Teko_LU2x2PreconditionerFactory.cpp.
|
virtual |
This function builds the internals of the preconditioner factory from a parameter list.
This function builds the internals of the preconditioner factory from a parameter list. Furthermore, it allows a preconditioner factory developer to easily add a factory to the build system. This function is required for building a preconditioner from a parameter list.
[in] | settings | Parmaeter list to use as the internal settings |
Reimplemented from Teko::PreconditionerFactory.
Definition at line 75 of file Teko_LU2x2PreconditionerFactory.cpp.
|
virtual |
Request the additional parameters this preconditioner factory needs.
Request the additonal parameters needed by this preconditioner factory. The parameter list will have a set of fields that can be filled with the requested values. These fields include all requirements, even those of the sub-solvers if there are any. Once correctly filled the object can be updated by calling the updateRequestedParameters with the filled parameter list.
Reimplemented from Teko::PreconditionerFactory.
Definition at line 104 of file Teko_LU2x2PreconditionerFactory.cpp.
|
virtual |
Update this object with the fields from a parameter list.
Update the requested fields using a parameter list. This method is expected to pair with the getRequestedParameters method (i.e. the fields requested are going to be update using this method).
[in] | pl | Parameter list containing the requested parameters. |
Reimplemented from Teko::PreconditionerFactory.
Definition at line 122 of file Teko_LU2x2PreconditionerFactory.cpp.
|
inlinevirtual |
Determine the type of inverse operator to build.
Determine the type of inverse operator to build. If true use the full LDU decomposition. If false only the upper triangular solve should be used. Motivation for doing this can be found in Murphy, Golub and Wathen, SISC 2000.
Definition at line 198 of file Teko_LU2x2PreconditionerFactory.hpp.
|
inlinevirtual |
Set the type of inverse operation to use.
Set the type of inverse operator to use. If true use the full LDU decomposition. If false only the upper triangular solve should be used. Motivation for doing this can be found in Murphy, Golub and Wathen, SISC 2000.
[in] | value | Boolean indicating type of inverse operator to build. |
Definition at line 210 of file Teko_LU2x2PreconditionerFactory.hpp.
|
static |
Builder function for creating strategies.
Builder function for creating strategies.
[in] | name | String name of strategy to build |
[in] | settings | Parameter list describing the parameters for the strategy to build |
[in] | invLib | Inverse library for the strategy to use. |
Definition at line 146 of file Teko_LU2x2PreconditionerFactory.cpp.
|
static |
Add a strategy to the builder. This is done using the clone pattern.
Add a strategy to the builder. This is done using the clone pattern. If your class does not support the Cloneable interface then you can use the AutoClone class to construct your object.
[in] | name | String to associate with this object |
[in] | clone | Pointer to Cloneable object |
Definition at line 192 of file Teko_LU2x2PreconditionerFactory.cpp.
|
protected |
some members
Definition at line 216 of file Teko_LU2x2PreconditionerFactory.hpp.
|
protected |
If true, use full LDU decomposition, otherwise use the Golub & Wathen style upper block. This is true by default.
Definition at line 222 of file Teko_LU2x2PreconditionerFactory.hpp.