10 #ifndef THYRA_PRECONDITIONER_FACTORY_HELPERS_DECL_HPP
11 #define THYRA_PRECONDITIONER_FACTORY_HELPERS_DECL_HPP
14 #include "Thyra_PreconditionerFactoryBase.hpp"
15 #include "Thyra_DefaultLinearOpSource.hpp"
16 #include "Thyra_DefaultPreconditioner.hpp"
26 template <
class Scalar>
34 precFactory.
initializePrec(defaultLinearOpSource(fwdOp), prec.get(),
44 template <
class Scalar>
53 precFactory.
uninitializePrec(prec, Teuchos::outArg(fwdOpSrc), supportSolveUse);
54 if (
nonnull(fwdOp)) {*fwdOp = fwdOpSrc->getOp();}
62 template <
class Scalar>
72 precFactory.
initializePrec(defaultLinearOpSource(fwdOp), &*prec, supportSolveUse);
80 #endif // THYRA_PRECONDITIONER_FACTORY_HELPERS_DECL_HPP
How the output LOWSB object will be useded for solves in unspecified.
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...
virtual RCP< PreconditionerBase< Scalar > > createPrec() const =0
Create an (uninitialized) LinearOpBase object to be initialized as the preconditioner later in this->...
Simple interface class to access a precreated preconditioner as one or more linear operators objects ...
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.
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...
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.
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.
Factory interface for creating preconditioner objects from LinearOpBase objects.
Base class for all linear operators.
ESupportSolveUse
Enum that specifies how a LinearOpWithSolveBase object will be used for solves after it is constructe...
bool nonnull(const boost::shared_ptr< T > &p)