Teko  Version of the Day
 All Classes Files Functions Variables Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Teko::PreconditionerFactory Class Referenceabstract

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]

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. More...
 
virtual Teuchos::RCP
< PreconditionerState
buildPreconditionerState () const
 Function that permits the construction of an arbitrary PreconditionerState object. More...
 
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< RequestHandlergetRequestHandler () const
 Get the request handler with pointers to the appropriate callbacks. More...
 
Methods for construction from a parameter list entry
virtual void initializeFromParameterList (const Teuchos::ParameterList &)
 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 &)
 Update this object with the fields from a parameter list. More...
 
Methods inherited from Thyra::PreconditionerFactoryBase
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...
 
Methods inherited from Teuchos::ParameterListAcceptor
void setParameterList (const Teuchos::RCP< Teuchos::ParameterList > &paramList)
 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 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
< Teuchos::ParameterList > 
paramList_
 for ParameterListAcceptor More...
 
Teuchos::RCP< RequestHandlercallbackHandler_
 For handling requests and send requests back to the user. More...
 

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::IterativePreconditionerFactory, Teko::BlockPreconditionerFactory, Teko::DiagonalPreconditionerFactory, Teko::DiagonallyScaledPreconditionerFactory, Teko::DiagnosticPreconditionerFactory, and Teko::IdentityPreconditionerFactory.

virtual Teuchos::RCP<PreconditionerState> Teko::PreconditionerFactory::buildPreconditionerState ( ) const
inlinevirtual

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::NS::ModALPreconditionerFactory, Teko::MultPreconditionerFactory, Teko::BlockPreconditionerFactory, Teko::DiagonalPreconditionerFactory, Teko::AddPreconditionerFactory, and Teko::MLPreconditionerFactory.

Definition at line 114 of file Teko_PreconditionerFactory.hpp.

virtual void Teko::PreconditionerFactory::initializeFromParameterList ( const Teuchos::ParameterList &  )
inlinevirtual

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::LU2x2PreconditionerFactory, Teko::IterativePreconditionerFactory, Teko::MultPreconditionerFactory, Teko::GaussSeidelPreconditionerFactory, Teko::DiagonallyScaledPreconditionerFactory, Teko::DiagonalPreconditionerFactory, Teko::DiagnosticPreconditionerFactory, Teko::JacobiPreconditionerFactory, Teko::NS::TimingsSIMPLEPreconditionerFactory, Teko::NS::SIMPLEPreconditionerFactory, Teko::AddPreconditionerFactory, Teko::IdentityPreconditionerFactory, and Teko::MLPreconditionerFactory.

Definition at line 132 of file Teko_PreconditionerFactory.hpp.

virtual Teuchos::RCP<Teuchos::ParameterList> Teko::PreconditionerFactory::getRequestedParameters ( ) const
inlinevirtual

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::LU2x2PreconditionerFactory, Teko::IterativePreconditionerFactory, Teko::DiagnosticPreconditionerFactory, Teko::NS::TimingsSIMPLEPreconditionerFactory, and Teko::NS::SIMPLEPreconditionerFactory.

Definition at line 149 of file Teko_PreconditionerFactory.hpp.

virtual bool Teko::PreconditionerFactory::updateRequestedParameters ( const Teuchos::ParameterList &  )
inlinevirtual

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::LU2x2PreconditionerFactory, Teko::IterativePreconditionerFactory, Teko::DiagnosticPreconditionerFactory, Teko::NS::TimingsSIMPLEPreconditionerFactory, and Teko::NS::SIMPLEPreconditionerFactory.

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 174 of file Teko_PreconditionerFactory.cpp.

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

Get the inverse library used by this preconditioner factory.

Definition at line 180 of file Teko_PreconditionerFactory.cpp.

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

is this operator compatiable with the preconditioner factory?

Definition at line 84 of file Teko_PreconditionerFactory.cpp.

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

create an instance of the preconditioner

Definition at line 91 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

Definition at line 140 of file Teko_PreconditionerFactory.cpp.

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

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

Definition at line 154 of file Teko_PreconditionerFactory.cpp.

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

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

Definition at line 160 of file Teko_PreconditionerFactory.cpp.

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

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

Definition at line 166 of file Teko_PreconditionerFactory.cpp.

void Teko::PreconditionerFactory::setRequestHandler ( const Teuchos::RCP< RequestHandler > &  rh)
inlinevirtual

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
inlinevirtual

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 227 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 273 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 338 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.

Teuchos::RCP<RequestHandler> Teko::PreconditionerFactory::callbackHandler_
protected

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: