9 #ifndef Thyra_ReuseLinearOpWithSolveFactory_hpp
10 #define Thyra_ReuseLinearOpWithSolveFactory_hpp
12 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
20 template<
class Scalar>
102 const std::string &precFactoryName
106 virtual RCP<PreconditionerFactoryBase<Scalar> >
112 std::string *precFactoryName
119 virtual RCP<LinearOpWithSolveBase<Scalar> >
createOp()
const;
174 RCP< PreconditionerBase<Scalar> >
prec_;
182 template<
class Scalar>
183 RCP<ReuseLinearOpWithSolveFactory<Scalar> >
189 RCP<ReuseLinearOpWithSolveFactory<Scalar> > rlowsf =
191 rlowsf->nonconstInitialize(lowsf, prec);
199 template<
class Scalar>
200 RCP<ReuseLinearOpWithSolveFactory<Scalar> >
206 RCP<ReuseLinearOpWithSolveFactory<Scalar> > rlowsf =
208 rlowsf->initialize(lowsf, prec);
214 template<
class Scalar>
226 lowsf_.initialize(lowsf);
230 template<
class Scalar>
242 lowsf_.initialize(lowsf);
246 template<
class Scalar>
247 RCP<LinearOpWithSolveFactoryBase<Scalar> >
251 return lowsf_.getNonconstObj();
254 template<
class Scalar>
255 RCP<const LinearOpWithSolveFactoryBase<Scalar> >
259 return lowsf_.getConstObj();
262 template<
class Scalar>
263 RCP<PreconditionerBase<Scalar> >
270 template<
class Scalar>
271 RCP<const PreconditionerBase<Scalar> >
280 template<
class Scalar>
285 std::ostringstream oss;
289 if (!
is_null(lowsf_.getConstObj()))
290 oss << lowsf_.getConstObj()->description();
296 oss << prec_->description();
305 template<
class Scalar>
309 RCP<ParameterList>
const& paramList
312 lowsf_.getNonconstObj()->setParameterList(paramList);
315 template<
class Scalar>
320 return lowsf_.getNonconstObj()->getNonconstParameterList();
323 template<
class Scalar>
328 return lowsf_.getNonconstObj()->unsetParameterList();
331 template<
class Scalar>
332 RCP<const ParameterList>
336 return lowsf_.getConstObj()->getParameterList();
339 template<
class Scalar>
340 RCP<const ParameterList>
344 return lowsf_.getConstObj()->getValidParameters();
349 template<
class Scalar>
357 template<
class Scalar>
367 template<
class Scalar>
368 RCP<PreconditionerFactoryBase<Scalar> >
372 return Thyra::reusePreconditionerFactory<Scalar>(prec_);
375 template<
class Scalar>
384 template<
class Scalar>
391 return lowsf_.getConstObj()->isCompatible(fwdOpSrc);
394 template<
class Scalar>
395 RCP<LinearOpWithSolveBase<Scalar> >
399 return lowsf_.getConstObj()->createOp();
402 template<
class Scalar>
411 lowsf_.getConstObj()->initializeOp(fwdOpSrc, Op, supportSolveUse);
414 template<
class Scalar>
422 lowsf_.getConstObj()->initializeAndReuseOp(fwdOpSrc, Op);
425 template<
class Scalar>
436 lowsf_.getConstObj()->uninitializeOp(Op, fwdOpSrc, prec, approxFwdOpSrc,
440 template<
class Scalar>
447 return lowsf_.getConstObj()->supportsPreconditionerInputType(precOpType);
450 template<
class Scalar>
460 lowsf_.getConstObj()->initializePreconditionedOp(fwdOpSrc, prec, Op,
464 template<
class Scalar>
474 lowsf_.getConstObj()->initializeApproxPreconditionedOp(fwdOpSrc,
482 template<
class Scalar>
487 lowsf_.getConstObj()->setVerbLevel(this->getVerbLevel());
488 lowsf_.getConstObj()->setOStream(this->getOStream());
virtual void unsetPreconditionerFactory(RCP< PreconditionerFactoryBase< Scalar > > *precFactory, std::string *precFactoryName)
Throws exception.
RCP< LinearOpWithSolveFactoryBase< Scalar > > getUnderlyingLOWSF()
virtual void setPreconditionerFactory(const RCP< PreconditionerFactoryBase< Scalar > > &precFactory, const std::string &precFactoryName)
Throws exception.
virtual void uninitializeOp(LinearOpWithSolveBase< Scalar > *Op, RCP< const LinearOpSourceBase< Scalar > > *fwdOpSrc, RCP< const PreconditionerBase< Scalar > > *prec, RCP< const LinearOpSourceBase< Scalar > > *approxFwdOpSrc, ESupportSolveUse *supportSolveUse) const
std::string description() const
bool is_null(const boost::shared_ptr< T > &p)
A LinearOpWithSolveFactory that is designed to reuse an already created/initialized preconditioner...
RCP< PreconditionerBase< Scalar > > prec_
RCP< ParameterList > getNonconstParameterList()
virtual bool acceptsPreconditionerFactory() const
returns false.
RCP< const ParameterList > getValidParameters() const
RCP< ReuseLinearOpWithSolveFactory< Scalar > > reuseLinearOpWithSolveFactory(const RCP< const LinearOpWithSolveFactoryBase< Scalar > > &lowsf, const RCP< PreconditionerBase< Scalar > > &prec)
Nonmember constructor.
virtual bool isCompatible(const LinearOpSourceBase< Scalar > &fwdOpSrc) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
RCP< const ParameterList > getParameterList() const
virtual void initializeAndReuseOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op) const
void informUpdatedVerbosityState() const
Overridden from Teuchos::VerboseObjectBase.
virtual void initializeOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
virtual std::string description() const
virtual void initializePreconditionedOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const RCP< const PreconditionerBase< Scalar > > &prec, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
RCP< PreconditionerBase< Scalar > > getUnderlyingPreconditioner()
virtual bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const
RCP< ReuseLinearOpWithSolveFactory< Scalar > > nonconstReuseLinearOpWithSolveFactory(const RCP< LinearOpWithSolveFactoryBase< Scalar > > &lowsf, const RCP< PreconditionerBase< Scalar > > &prec)
Nonmember constructor.
Teuchos::ConstNonconstObjectContainer< LinearOpWithSolveFactoryBase< Scalar > > LOWSF_t
RCP< ParameterList > unsetParameterList()
virtual void initializeApproxPreconditionedOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const RCP< const LinearOpSourceBase< Scalar > > &approxFwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
void nonconstInitialize(const RCP< LinearOpWithSolveFactoryBase< Scalar > > &lowsf, const RCP< PreconditionerBase< Scalar > > &prec)
Initialize given a single non-const LOWSFB object.
void setParameterList(RCP< ParameterList > const ¶mList)
ReuseLinearOpWithSolveFactory()
Construct to uninitialized.
void initialize(const RCP< const LinearOpWithSolveFactoryBase< Scalar > > &lowsf, const RCP< PreconditionerBase< Scalar > > &prec)
Initialize given a single const LOWSFB object.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
virtual RCP< LinearOpWithSolveBase< Scalar > > createOp() const
virtual RCP< PreconditionerFactoryBase< Scalar > > getPreconditionerFactory() const
Returns null .