Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Related Functions | List of all members
Thyra::PreconditionerFactoryBase< Scalar > Class Template Referenceabstract

Factory interface for creating preconditioner objects from LinearOpBase objects. More...

#include <Thyra_PreconditionerFactoryBase_decl.hpp>

Inheritance diagram for Thyra::PreconditionerFactoryBase< Scalar >:
Inheritance graph
[legend]

Related Functions

(Note that these are not member functions.)

template<class Scalar >
void initializePrec (const PreconditionerFactoryBase< Scalar > &precFactory, const Teuchos::RCP< const LinearOpBase< Scalar > > &fwdOp, const Teuchos::Ptr< PreconditionerBase< Scalar > > &prec, const ESupportSolveUse supportSolveUse=SUPPORT_SOLVE_UNSPECIFIED)
 Initialize a preconditioner from a forward linear operator. More...
 
template<class Scalar >
void uninitializePrec (const PreconditionerFactoryBase< Scalar > &precFactory, const Teuchos::Ptr< PreconditionerBase< Scalar > > &prec, const Teuchos::Ptr< Teuchos::RCP< const LinearOpBase< Scalar > > > &fwdOp=Teuchos::null, const Teuchos::Ptr< ESupportSolveUse > &supportSolveUse=Teuchos::null)
 Uninitialize a preconditioner and optionally extra what was used to create it. More...
 
template<class Scalar >
Teuchos::RCP
< PreconditionerBase< Scalar > > 
prec (const PreconditionerFactoryBase< Scalar > &precFactory, const Teuchos::RCP< const LinearOpBase< Scalar > > &fwdOp, const ESupportSolveUse supportSolveUse=SUPPORT_SOLVE_UNSPECIFIED)
 Create and initialize a preconditioner from a forward linear operator. More...
 

Pure virtual public functions that must be overridden in subclasses

virtual bool isCompatible (const LinearOpSourceBase< Scalar > &fwdOpSrc) const =0
 Check that a LinearOpBase object is compatible with *this factory object. More...
 
virtual RCP
< PreconditionerBase< Scalar > > 
createPrec () const =0
 Create an (uninitialized) LinearOpBase object to be initialized as the preconditioner later in this->initializePrecOp(). More...
 
virtual void initializePrec (const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, PreconditionerBase< Scalar > *precOp, const ESupportSolveUse supportSolveUse=SUPPORT_SOLVE_UNSPECIFIED) const =0
 Initialize a pre-created LinearOpBase preconditioner object given a "compatible" LinearOpBase object. More...
 
virtual void uninitializePrec (PreconditionerBase< Scalar > *prec, RCP< const LinearOpSourceBase< Scalar > > *fwdOpSrc=NULL, ESupportSolveUse *supportSolveUse=NULL) const =0
 Uninitialize a LinearOpBase preconditioner object and return its remembered forward linear operator. More...
 

Virtual public functions with default implementations

virtual bool applySupportsConj (EConj conj) const
 Return if precOp->apply() supports the argument conj. More...
 
virtual bool applyTransposeSupportsConj (EConj conj) const
 Return if precOp->solveTranspose() supports the argument conj. More...
 

Detailed Description

template<class Scalar>
class Thyra::PreconditionerFactoryBase< Scalar >

Factory interface for creating preconditioner objects from LinearOpBase objects.

ToDo: Finish documentation!

Definition at line 22 of file Thyra_OperatorSolveTypes.hpp.

Member Function Documentation

template<class Scalar>
virtual bool Thyra::PreconditionerFactoryBase< Scalar >::isCompatible ( const LinearOpSourceBase< Scalar > &  fwdOpSrc) const
pure virtual

Check that a LinearOpBase object is compatible with *this factory object.

template<class Scalar>
virtual RCP<PreconditionerBase<Scalar> > Thyra::PreconditionerFactoryBase< Scalar >::createPrec ( ) const
pure virtual

Create an (uninitialized) LinearOpBase object to be initialized as the preconditioner later in this->initializePrecOp().

Note that on output return->domain().get()==NULL may be true which means that the operator is not fully initialized. In fact, the output operator object is not guaranteed to be fully initialized until after it is passed through this->initializePrecOp().

template<class Scalar>
virtual void Thyra::PreconditionerFactoryBase< Scalar >::initializePrec ( const RCP< const LinearOpSourceBase< Scalar > > &  fwdOpSrc,
PreconditionerBase< Scalar > *  precOp,
const ESupportSolveUse  supportSolveUse = SUPPORT_SOLVE_UNSPECIFIED 
) const
pure virtual

Initialize a pre-created LinearOpBase preconditioner object given a "compatible" LinearOpBase object.

Parameters
fwdOpSrc[in] The forward linear operator that will be used to create the output LinearOpBase preconditioner object. Note that this object is remembered by the *Op object on output.
prec[in/out] The output PreconditionerBase preconditioner object. This object must have be created first by this->createPrec(). The object may have also already been passed through this function several times. Note that subclasses should always first strip off the transpose and scaling by calling unwrap() before attempting to dynamic cast the object.
supportSolveUse[in] Determines if apply() and/or applyTranspose() will be called on the initialized preconditioner operators. This allows *this factory object determine how to best initialize the *prec object. Default supportSolveUse=SUPPORT_SOLVE_UNSPECIFIED

Preconditions:

  • fwdOpSrc.get()!=NULL

  • this->isCompatible(*fwdOpSrc)==true

  • prec!=NULL

  • *prec must have been created by this->createPrec() prior to calling this function.

  • [supportSolveUse==SUPPORT_SOLVE_FORWARD_ONLY] this->applySupportsConj(conj)==true for any value of conj

  • [supportSolveUse==SUPPORT_SOLVE_TRANSPOSE_ONLY] this->applyTransposeSupportsConj(conj)==true for any value of conj

  • [supportSolveUse==SUPPORT_SOLVE_FORWARD_AND_TRANSPOSE] this->applySupportsConj(conj)==true && this->applyTransposeSupportsConj(conj)==true for any value of conj

Postconditions:

  • Throws CatastrophicSolveFailure if the preconditioner could not be created successfully (e.g. due to a factorization failure or some other cause).

  • precOp->range()->isCompatible(*fwdOpSrc->domain())==true

  • precOp->domain()->isCompatible(*fwdOpSrc->range())==true

  • <t>precOp->applySupportsConj(conj)==this->applySupportsConj(conj)

  • <t>precOp->applyTransposeSupportsConj(conj) == this->applyTransposeSupportsConj(conj)

  • fwdOpSrc.count() after output is greater than fwdOpSrc.count() just before this call and therefore the client can assume that the *fwdOpSrc object will be remembered by the *prec object. The client must be careful not to modify the *fwdOpSrc object or else the *precOp object may also be modified and become invalid.

template<class Scalar>
virtual void Thyra::PreconditionerFactoryBase< Scalar >::uninitializePrec ( PreconditionerBase< Scalar > *  prec,
RCP< const LinearOpSourceBase< Scalar > > *  fwdOpSrc = NULL,
ESupportSolveUse supportSolveUse = NULL 
) const
pure virtual

Uninitialize a LinearOpBase preconditioner object and return its remembered forward linear operator.

Parameters
prec[in/out] On input, *precOp is an initialized or uninitialized object and on output is uninitialized. Note that "uninitialized" does not mean that precOp is completely stateless. It may still remember some aspect of the matrix fwdOpSrc that will allow for a more efficient initialization next time through this->initializePrecOp().
fwdOpSrc[in/out] If fwdOpSrc!=NULL on input, then on output this is set to same forward operator passed into this->initializePrecOp().
ESupportSolveUse[in/out] If precOpType!=NULL on input, then on output this is set to same option value passed to this->initializePrecOp().

Preconditions:

  • *precOp must have been created by this->createPrecOp() prior to calling this function.

  • precOp may or may not have been passed through a call to this->initializePrecOp().

Postconditions:

  • If *precOp on input was initialized through a call to this->initializePrecOp() then return.get()!=NULL.

  • If *precOp was uninitialized on input and fwdOpSrc!=NULL then fwdOpSrc->get()==NULL on output.

  • On output, *precOp can be considered to be uninitialized and it is safe to modify the forward operator object *(*fwdOpSrc) returned in fwdOpSrc. The default is fwdOpSrc==NULL in which case the forward operator will not be returned in *fwdOpSrc.

This function should be called before the forward operator passed in to this->initializePrecOp() is modified. Otherwise, *this could be left in an inconsistent state. However, this is not required.

template<class Scalar >
bool Thyra::PreconditionerFactoryBase< Scalar >::applySupportsConj ( EConj  conj) const
virtual

Return if precOp->apply() supports the argument conj.

The default implementation returns true for real valued scalar types or when conj==NONCONJ_ELE for complex valued types.

Definition at line 21 of file Thyra_PreconditionerFactoryBase_def.hpp.

template<class Scalar >
bool Thyra::PreconditionerFactoryBase< Scalar >::applyTransposeSupportsConj ( EConj  conj) const
virtual

Return if precOp->solveTranspose() supports the argument conj.

The default implementation returns false.

Definition at line 30 of file Thyra_PreconditionerFactoryBase_def.hpp.

Friends And Related Function Documentation

template<class Scalar >
void initializePrec ( const PreconditionerFactoryBase< Scalar > &  precFactory,
const Teuchos::RCP< const LinearOpBase< Scalar > > &  fwdOp,
const Teuchos::Ptr< PreconditionerBase< Scalar > > &  prec,
const ESupportSolveUse  supportSolveUse = SUPPORT_SOLVE_UNSPECIFIED 
)
related

Initialize a preconditioner from a forward linear operator.

Definition at line 27 of file Thyra_PreconditionerFactoryHelpers.hpp.

template<class Scalar >
void uninitializePrec ( const PreconditionerFactoryBase< Scalar > &  precFactory,
const Teuchos::Ptr< PreconditionerBase< Scalar > > &  prec,
const Teuchos::Ptr< Teuchos::RCP< const LinearOpBase< Scalar > > > &  fwdOp = Teuchos::null,
const Teuchos::Ptr< ESupportSolveUse > &  supportSolveUse = Teuchos::null 
)
related

Uninitialize a preconditioner and optionally extra what was used to create it.

Definition at line 45 of file Thyra_PreconditionerFactoryHelpers.hpp.

template<class Scalar >
Teuchos::RCP< PreconditionerBase< Scalar > > prec ( const PreconditionerFactoryBase< Scalar > &  precFactory,
const Teuchos::RCP< const LinearOpBase< Scalar > > &  fwdOp,
const ESupportSolveUse  supportSolveUse = SUPPORT_SOLVE_UNSPECIFIED 
)
related

Create and initialize a preconditioner from a forward linear operator.

Definition at line 64 of file Thyra_PreconditionerFactoryHelpers.hpp.


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