10 #ifndef THYRA_DELAYED_LINEAR_OP_WITH_SOLVE_HPP
11 #define THYRA_DELAYED_LINEAR_OP_WITH_SOLVE_HPP
14 #include "Thyra_DelayedLinearOpWithSolve_decl.hpp"
15 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
16 #include "Thyra_LinearOpWithSolveBase.hpp"
17 #include "Thyra_SolveSupportTypes.hpp"
18 #include "Teuchos_VerboseObject.hpp"
27 template <
class Scalar>
33 template <
class Scalar>
49 approxFwdOpSrc_ = approxFwdOpSrc;
51 supportSolveUse_ = supportSolveUse;
52 fwdOp_ = fwdOpSrc_->getOp().assert_not_null();
53 lows_is_valid_ =
false;
57 template <
class Scalar>
65 template <
class Scalar>
73 template <
class Scalar>
77 return approxFwdOpSrc_;
81 template <
class Scalar>
85 return supportSolveUse_;
92 template<
class Scalar>
95 std::ostringstream oss;
100 oss << fwdOp_->description();
105 oss << lows_->description();
116 template <
class Scalar>
121 return fwdOp_->range();
122 return Teuchos::null;
126 template <
class Scalar>
131 return fwdOp_->domain();
132 return Teuchos::null;
136 template <
class Scalar>
140 return Teuchos::null;
147 template<
class Scalar>
151 lowsf_->setVerbLevel(this->getVerbLevel());
152 lowsf_->setOStream(this->getOStream());
155 lows_->setVerbLevel(this->getVerbLevel());
156 lows_->setOStream(this->getOStream());
164 template <
class Scalar>
167 return Thyra::opSupported(*fwdOp_,M_trans);
171 template <
class Scalar>
180 Thyra::apply(*fwdOp_, M_trans, X, Y, alpha, beta);
187 template <
class Scalar>
191 return Thyra::solveSupports(*lows_, M_trans);
195 template <
class Scalar>
201 return Thyra::solveSupportsSolveMeasureType(*lows_, M_trans, solveMeasureType);
205 template <
class Scalar>
215 return Thyra::solve(*lows_, transp, B, X, solveCriteria);
222 template <
class Scalar>
226 lows_ = lowsf_->createOp();
227 if (!lows_is_valid_) {
229 lowsf_->initializePreconditionedOp(
230 fwdOpSrc_,prec_,&*lows_,supportSolveUse_);
231 else if (!
is_null(approxFwdOpSrc_))
232 lowsf_->initializeApproxPreconditionedOp(
233 fwdOpSrc_,approxFwdOpSrc_,&*lows_,supportSolveUse_);
235 lowsf_->initializeOp(
236 fwdOpSrc_,&*lows_,supportSolveUse_);
237 lows_is_valid_ =
true;
245 #endif // THYRA_DELAYED_LINEAR_OP_WITH_SOLVE_HPP
How the output LOWSB object will be useded for solves in unspecified.
RCP< const PreconditionerBase< Scalar > > getPrec() const
bool is_null(const boost::shared_ptr< T > &p)
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
SolveStatus< Scalar > solveImpl(const EOpTransp transp, const MultiVectorBase< Scalar > &B, const Ptr< MultiVectorBase< Scalar > > &X, const Ptr< const SolveCriteria< Scalar > > solveCriteria) const
Simple interface class to access a precreated preconditioner as one or more linear operators objects ...
DelayedLinearOpWithSolve()
RCP< const VectorSpaceBase< Scalar > > domain() const
RCP< const LinearOpSourceBase< Scalar > > getFwdOpSrc() const
Interface for a collection of column vectors called a multi-vector.
Factory interface for creating LinearOpWithSolveBase objects from compatible LinearOpBase objects...
void informUpdatedVerbosityState() const
Overridden from Teuchos::VerboseObjectBase.
virtual std::string description() const
std::string description() const
void initialize(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const RCP< const PreconditionerBase< Scalar > > &prec, const RCP< const LinearOpSourceBase< Scalar > > &approxFwdOpSrc, const ESupportSolveUse supportSolveUse, const RCP< LinearOpWithSolveFactoryBase< Scalar > > &lowsf)
ESupportSolveUse getSupportSolveUse() const
Simple struct for the return status from a solve.
Base interface for objects that can return a linear operator.
RCP< const LinearOpSourceBase< Scalar > > getApproxFwdOpSrc() const
RCP< const VectorSpaceBase< Scalar > > range() const
ESupportSolveUse
Enum that specifies how a LinearOpWithSolveBase object will be used for solves after it is constructe...
virtual void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
virtual bool solveSupportsSolveMeasureTypeImpl(EOpTransp M_trans, const SolveMeasureType &solveMeasureType) const
virtual bool opSupportedImpl(EOpTransp M_trans) const
virtual bool solveSupportsImpl(EOpTransp M_trans) const
Simple struct that defines the requested solution criteria for a solve.
Delayed linear solver construction LinearOpWithSolveBase decorator class.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
RCP< const LinearOpBase< Scalar > > clone() const