Teko Version of the Day
Public Member Functions | Static Public Member Functions | Protected Attributes
Teko::PreconditionerFactory Class Reference

Abstract class which block preconditioner factories in Teko should be based on. More...

#include <Teko_PreconditionerFactory.hpp>

Inheritance diagram for Teko::PreconditionerFactory:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual LinearOp buildPreconditionerOperator (LinearOp &lo, PreconditionerState &state) const =0
 Function that is called to build the preconditioner for the linear operator that is passed in.
virtual Teuchos::RCP
< PreconditionerState
buildPreconditionerState () const
 Function that permits the construction of an arbitrary PreconditionerState object.
void setInverseLibrary (const Teuchos::RCP< const InverseLibrary > &il)
 Set the inverse library used by this preconditioner factory.
Teuchos::RCP< const
InverseLibrary > 
getInverseLibrary () const
 Get the inverse library used by this preconditioner factory.
void setRequestHandler (const Teuchos::RCP< RequestHandler > &rh)
 Set the request handler with pointers to the appropriate callbacks.
Teuchos::RCP< RequestHandlergetRequestHandler () const
 Get the request handler with pointers to the appropriate callbacks.
Methods for construction from a parameter list entry
virtual void initializeFromParameterList (const Teuchos::ParameterList &settings)
 This function builds the internals of the preconditioner factory from a parameter list.
virtual Teuchos::RCP
< Teuchos::ParameterList > 
getRequestedParameters () const
 Request the additional parameters this preconditioner factory needs.
virtual bool updateRequestedParameters (const Teuchos::ParameterList &pl)
 Update this object with the fields from a parameter list.
Methods inherited from Thyra::PreconditionerFactoryBase
bool isCompatible (const Thyra::LinearOpSourceBase< double > &fwdOpSrc) const
 is this operator compatiable with the preconditioner factory?
Teuchos::RCP
< Thyra::PreconditionerBase
< double > > 
createPrec () const
 create an instance of the preconditioner
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
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
void uninitializePrec (Thyra::PreconditionerBase< double > *prec, Teuchos::RCP< const Thyra::LinearOpSourceBase< double > > *fwdOpSrc, Thyra::ESupportSolveUse *supportSolveUse) const
 wipe clean a already initialized preconditioner object
Methods inherited from Teuchos::ParameterListAcceptor
void setParameterList (const Teuchos::RCP< Teuchos::ParameterList > &paramList)
 Set parameters from a parameter list and return with default values.
Teuchos::RCP
< Teuchos::ParameterList > 
getNonconstParameterList ()
 Get the parameter list that was set using setParameterList().
Teuchos::RCP
< Teuchos::ParameterList > 
unsetParameterList ()
 Unset the parameter list that was set using setParameterList().

Static Public Member Functions

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).
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.
static void getPreconditionerFactoryNames (std::vector< std::string > &names)
 Get the names of the block preconditioner factories.

Protected Attributes

Teuchos::RCP
< Teuchos::ParameterList > 
paramList_
 for ParameterListAcceptor
Teuchos::RCP< RequestHandlercallbackHandler_
 For handling requests and send requests back to the user.

Detailed Description

Abstract class which block preconditioner factories in Teko should be based on.

Abstract class which block preconditioner factories in Teko should be based on. All that is needed is the implementation of "buildPreconditionerOperator". This class also uses the RequestHandler concrete interface. This is useful for extracting information from the user in an unobtrusive and modular way.

Definition at line 82 of file Teko_PreconditionerFactory.hpp.


Member Function Documentation

virtual LinearOp Teko::PreconditionerFactory::buildPreconditionerOperator ( LinearOp &  lo,
PreconditionerState state 
) const [pure virtual]

Function that is called to build the preconditioner for the linear operator that is passed in.

This function builds a preconditioner based on the passed in LinearOp.

Parameters:
[in]loSource linear operator that is to be preconditioned.
[in]stateAn object associated with this operator to store the preconditioner state.
Returns:
The preconditioner as a linear operator (i.e. to perform a matrix-vector operation simply call "apply").

Implemented in Teko::BlockPreconditionerFactory, Teko::DiagnosticPreconditionerFactory, Teko::DiagonallyScaledPreconditionerFactory, Teko::DiagonalPreconditionerFactory, Teko::IdentityPreconditionerFactory, and Teko::IterativePreconditionerFactory.

virtual Teuchos::RCP<PreconditionerState> Teko::PreconditionerFactory::buildPreconditionerState ( ) const [inline, virtual]

Function that permits the construction of an arbitrary PreconditionerState object.

Function that permits the construction of an arbitrary PreconditionerState object. If the basic state object, which takes a parameter list, is sufficient the default behavior does precisely what is needed. Otherwise, an author of a PreconditionerFactory would need to reimplement this method to return a new state object.

Returns:
A state object associated with this factory.

Reimplemented in Teko::MLPreconditionerFactory, Teko::NS::ModALPreconditionerFactory, Teko::AddPreconditionerFactory, Teko::BlockPreconditionerFactory, Teko::DiagonalPreconditionerFactory, and Teko::MultPreconditionerFactory.

Definition at line 114 of file Teko_PreconditionerFactory.hpp.

virtual void Teko::PreconditionerFactory::initializeFromParameterList ( const Teuchos::ParameterList &  settings) [inline, 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.

Parameters:
[in]settingsParmaeter list to use as the internal settings
Note:
The default implementation does nothing.

Reimplemented in Teko::MLPreconditionerFactory, Teko::NS::SIMPLEPreconditionerFactory, Teko::AddPreconditionerFactory, Teko::DiagnosticPreconditionerFactory, Teko::DiagonallyScaledPreconditionerFactory, Teko::DiagonalPreconditionerFactory, Teko::GaussSeidelPreconditionerFactory, Teko::IdentityPreconditionerFactory, Teko::IterativePreconditionerFactory, Teko::JacobiPreconditionerFactory, Teko::LU2x2PreconditionerFactory, and Teko::MultPreconditionerFactory.

Definition at line 132 of file Teko_PreconditionerFactory.hpp.

virtual Teuchos::RCP<Teuchos::ParameterList> Teko::PreconditionerFactory::getRequestedParameters ( ) const [inline, 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.

Returns:
A parameter list with the requested parameters.
Note:
The default implementation returns Teuchos::null.

Reimplemented in Teko::NS::SIMPLEPreconditionerFactory, Teko::DiagnosticPreconditionerFactory, Teko::IterativePreconditionerFactory, and Teko::LU2x2PreconditionerFactory.

Definition at line 149 of file Teko_PreconditionerFactory.hpp.

virtual bool Teko::PreconditionerFactory::updateRequestedParameters ( const Teuchos::ParameterList &  pl) [inline, 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).

Parameters:
[in]plParameter list containing the requested parameters.
Returns:
If the method succeeded (found all its required parameters) this method returns true, otherwise it returns false.
Note:
The default implementation returns true (it does nothing!).

Reimplemented in Teko::NS::SIMPLEPreconditionerFactory, Teko::DiagnosticPreconditionerFactory, Teko::IterativePreconditionerFactory, and Teko::LU2x2PreconditionerFactory.

Definition at line 165 of file Teko_PreconditionerFactory.hpp.

void Teko::PreconditionerFactory::setInverseLibrary ( const Teuchos::RCP< const InverseLibrary > &  il)

Set the inverse library used by this preconditioner factory.

Definition at line 173 of file Teko_PreconditionerFactory.cpp.

RCP< const InverseLibrary > Teko::PreconditionerFactory::getInverseLibrary ( ) const

Get the inverse library used by this preconditioner factory.

Definition at line 179 of file Teko_PreconditionerFactory.cpp.

bool Teko::PreconditionerFactory::isCompatible ( const Thyra::LinearOpSourceBase< double > &  fwdOpSrc) const

is this operator compatiable with the preconditioner factory?

Reimplemented in Teko::BlockPreconditionerFactory.

Definition at line 83 of file Teko_PreconditionerFactory.cpp.

RCP< Thyra::PreconditionerBase< double > > Teko::PreconditionerFactory::createPrec ( ) const

create an instance of the preconditioner

Definition at line 90 of file Teko_PreconditionerFactory.cpp.

void Teko::PreconditionerFactory::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

Initialize a newly created preconditioner object. For use with nonlinear solvers.

Parameters:
[in]fwdOpSrcForward operator to be preconditioned
[in]solnVecVector associated with this linear operator.
[in,out]precOpReturn location for the preconditioner
[in]supportSolveUseThyra information (?)
void Teko::PreconditionerFactory::initializePrec ( const Teuchos::RCP< const Thyra::LinearOpSourceBase< double > > &  fwdOpSrc,
Thyra::PreconditionerBase< double > *  precOp,
const Thyra::ESupportSolveUse  supportSolveUse 
) const

initialize a newly created preconditioner object

void Teko::PreconditionerFactory::uninitializePrec ( Thyra::PreconditionerBase< double > *  prec,
Teuchos::RCP< const Thyra::LinearOpSourceBase< double > > *  fwdOpSrc,
Thyra::ESupportSolveUse *  supportSolveUse 
) const

wipe clean a already initialized preconditioner object

void Teko::PreconditionerFactory::setParameterList ( const Teuchos::RCP< Teuchos::ParameterList > &  paramList)

Set parameters from a parameter list and return with default values.

RCP< Teuchos::ParameterList > Teko::PreconditionerFactory::getNonconstParameterList ( )

Get the parameter list that was set using setParameterList().

Definition at line 159 of file Teko_PreconditionerFactory.cpp.

RCP< Teuchos::ParameterList > Teko::PreconditionerFactory::unsetParameterList ( )

Unset the parameter list that was set using setParameterList().

Definition at line 165 of file Teko_PreconditionerFactory.cpp.

void Teko::PreconditionerFactory::setRequestHandler ( const Teuchos::RCP< RequestHandler > &  rh) [inline, virtual]

Set the request handler with pointers to the appropriate callbacks.

Implements Teko::RequestHandlerContainer.

Definition at line 225 of file Teko_PreconditionerFactory.hpp.

Teuchos::RCP<RequestHandler> Teko::PreconditionerFactory::getRequestHandler ( ) const [inline, virtual]

Get the request handler with pointers to the appropriate callbacks.

Implements Teko::RequestHandlerContainer.

Definition at line 229 of file Teko_PreconditionerFactory.hpp.

RCP< PreconditionerFactory > Teko::PreconditionerFactory::buildPreconditionerFactory ( const std::string &  name,
const Teuchos::ParameterList &  settings,
const Teuchos::RCP< const InverseLibrary > &  invLib = Teuchos::null 
) [static]

Builder function for creating preconditioner factories (yes this is a factory factory).

Builder function for creating preconditioner factories (yes this is a factory factory.

Builder function for creating preconditioner factories (yes this is a factory factory).

Parameters:
[in]nameString name of factory to build
[in]settingsParameter list describing the parameters for the factory to build
[in]invLibInverse library for the factory to use.
Returns:
If the name is associated with a preconditioner a pointer is returned, otherwise Teuchos::null is returned.

Builder function for creating preconditioner factories (yes this is a factory factory.

Parameters:
[in]nameString name of factory to build
[in]settingsParameter list describing the parameters for the factory to build
[in]invLibInverse library for the factory to use.
Returns:
If the name is associated with a preconditioner a pointer is returned, otherwise Teuchos::null is returned.

Definition at line 226 of file Teko_PreconditionerFactory.cpp.

void Teko::PreconditionerFactory::addPreconditionerFactory ( const std::string &  name,
const Teuchos::RCP< Cloneable > &  clone 
) [static]

Add a preconditioner factory to the builder. This is done using the clone pattern.

Add a preconditioner factory 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.

Note:
If this method is called twice with the same string, the latter clone pointer will be used.
Parameters:
[in]nameString to associate with this object
[in]clonePointer to Cloneable object

Definition at line 272 of file Teko_PreconditionerFactory.cpp.

void Teko::PreconditionerFactory::getPreconditionerFactoryNames ( std::vector< std::string > &  names) [static]

Get the names of the block preconditioner factories.

Definition at line 334 of file Teko_PreconditionerFactory.cpp.


Member Data Documentation

Teuchos::RCP<Teuchos::ParameterList> Teko::PreconditionerFactory::paramList_ [protected]

for ParameterListAcceptor

Definition at line 234 of file Teko_PreconditionerFactory.hpp.

For handling requests and send requests back to the user.

Definition at line 237 of file Teko_PreconditionerFactory.hpp.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables