10 #ifndef Thyra_ReuseLinearOpWithSolveFactory_hpp
11 #define Thyra_ReuseLinearOpWithSolveFactory_hpp
13 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
21 template <
class Scalar>
98 const std::string &precFactoryName);
107 std::string *precFactoryName);
111 virtual RCP<LinearOpWithSolveBase<Scalar> >
createOp()
const;
160 RCP<PreconditionerBase<Scalar> >
prec_;
167 template <
class Scalar>
168 RCP<ReuseLinearOpWithSolveFactory<Scalar> >
173 RCP<ReuseLinearOpWithSolveFactory<Scalar> > rlowsf =
175 rlowsf->nonconstInitialize(lowsf, prec);
183 template <
class Scalar>
188 RCP<ReuseLinearOpWithSolveFactory<Scalar> > rlowsf =
190 rlowsf->initialize(lowsf, prec);
196 template <
class Scalar>
205 lowsf_.initialize(lowsf);
209 template <
class Scalar>
218 lowsf_.initialize(lowsf);
222 template <
class Scalar>
223 RCP<LinearOpWithSolveFactoryBase<Scalar> >
226 return lowsf_.getNonconstObj();
229 template <
class Scalar>
230 RCP<const LinearOpWithSolveFactoryBase<Scalar> >
233 return lowsf_.getConstObj();
236 template <
class Scalar>
237 RCP<PreconditionerBase<Scalar> >
243 template <
class Scalar>
244 RCP<const PreconditionerBase<Scalar> >
252 template <
class Scalar>
255 std::ostringstream oss;
258 if (!
is_null(lowsf_.getConstObj()))
259 oss << lowsf_.getConstObj()->description();
265 oss << prec_->description();
274 template <
class Scalar>
276 RCP<ParameterList>
const ¶mList)
278 lowsf_.getNonconstObj()->setParameterList(paramList);
281 template <
class Scalar>
285 return lowsf_.getNonconstObj()->getNonconstParameterList();
288 template <
class Scalar>
291 return lowsf_.getNonconstObj()->unsetParameterList();
294 template <
class Scalar>
295 RCP<const ParameterList>
298 return lowsf_.getConstObj()->getParameterList();
301 template <
class Scalar>
302 RCP<const ParameterList>
305 return lowsf_.getConstObj()->getValidParameters();
310 template <
class Scalar>
316 template <
class Scalar>
324 template <
class Scalar>
325 RCP<PreconditionerFactoryBase<Scalar> >
328 return Thyra::reusePreconditionerFactory<Scalar>(prec_);
331 template <
class Scalar>
339 template <
class Scalar>
343 return lowsf_.getConstObj()->isCompatible(fwdOpSrc);
346 template <
class Scalar>
347 RCP<LinearOpWithSolveBase<Scalar> >
350 return lowsf_.getConstObj()->createOp();
353 template <
class Scalar>
359 lowsf_.getConstObj()->initializeOp(fwdOpSrc, Op, supportSolveUse);
362 template <
class Scalar>
367 lowsf_.getConstObj()->initializeAndReuseOp(fwdOpSrc, Op);
370 template <
class Scalar>
378 lowsf_.getConstObj()->uninitializeOp(Op, fwdOpSrc, prec, approxFwdOpSrc,
382 template <
class Scalar>
386 return lowsf_.getConstObj()->supportsPreconditionerInputType(precOpType);
389 template <
class Scalar>
396 lowsf_.getConstObj()->initializePreconditionedOp(fwdOpSrc, prec, Op,
400 template <
class Scalar>
407 lowsf_.getConstObj()->initializeApproxPreconditionedOp(
408 fwdOpSrc, approxFwdOpSrc, Op, supportSolveUse);
413 template <
class Scalar>
416 lowsf_.getConstObj()->setVerbLevel(this->getVerbLevel());
417 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< ParameterList > getNonconstParameterList()
Teuchos::ConstNonconstObjectContainer< LinearOpWithSolveFactoryBase< Scalar > > LOWSF_t
RCP< PreconditionerBase< Scalar > > prec_
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.
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 .