43 #ifndef THYRA_DELAYED_LINEAR_OP_WITH_SOLVE_HPP
44 #define THYRA_DELAYED_LINEAR_OP_WITH_SOLVE_HPP
47 #include "Thyra_DelayedLinearOpWithSolve_decl.hpp"
48 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
49 #include "Thyra_LinearOpWithSolveBase.hpp"
50 #include "Thyra_SolveSupportTypes.hpp"
51 #include "Teuchos_VerboseObject.hpp"
60 template <
class Scalar>
66 template <
class Scalar>
82 approxFwdOpSrc_ = approxFwdOpSrc;
84 supportSolveUse_ = supportSolveUse;
85 fwdOp_ = fwdOpSrc_->getOp().assert_not_null();
86 lows_is_valid_ =
false;
90 template <
class Scalar>
98 template <
class Scalar>
106 template <
class Scalar>
110 return approxFwdOpSrc_;
114 template <
class Scalar>
118 return supportSolveUse_;
125 template<
class Scalar>
128 std::ostringstream oss;
133 oss << fwdOp_->description();
138 oss << lows_->description();
149 template <
class Scalar>
154 return fwdOp_->range();
155 return Teuchos::null;
159 template <
class Scalar>
164 return fwdOp_->domain();
165 return Teuchos::null;
169 template <
class Scalar>
173 return Teuchos::null;
180 template<
class Scalar>
184 lowsf_->setVerbLevel(this->getVerbLevel());
185 lowsf_->setOStream(this->getOStream());
188 lows_->setVerbLevel(this->getVerbLevel());
189 lows_->setOStream(this->getOStream());
197 template <
class Scalar>
200 return Thyra::opSupported(*fwdOp_,M_trans);
204 template <
class Scalar>
213 Thyra::apply(*fwdOp_, M_trans, X, Y, alpha, beta);
220 template <
class Scalar>
224 return Thyra::solveSupports(*lows_, M_trans);
228 template <
class Scalar>
234 return Thyra::solveSupportsSolveMeasureType(*lows_, M_trans, solveMeasureType);
238 template <
class Scalar>
248 return Thyra::solve(*lows_, transp, B, X, solveCriteria);
255 template <
class Scalar>
259 lows_ = lowsf_->createOp();
260 if (!lows_is_valid_) {
262 lowsf_->initializePreconditionedOp(
263 fwdOpSrc_,prec_,&*lows_,supportSolveUse_);
264 else if (!
is_null(approxFwdOpSrc_))
265 lowsf_->initializeApproxPreconditionedOp(
266 fwdOpSrc_,approxFwdOpSrc_,&*lows_,supportSolveUse_);
268 lowsf_->initializeOp(
269 fwdOpSrc_,&*lows_,supportSolveUse_);
270 lows_is_valid_ =
true;
278 #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