9 #ifndef Thyra_ScaledIdentityLinearOpWithSolveFactory_hpp
10 #define Thyra_ScaledIdentityLinearOpWithSolveFactory_hpp
12 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
17 #include "Thyra_DefaultLinearOpSource.hpp"
23 template<
class Scalar>
25 :
virtual public LinearOpWithSolveFactoryBase<Scalar>
38 void initialize(
const RCP<
const VectorSpaceBase<Scalar> >& space,
66 const RCP<PreconditionerFactoryBase<Scalar> > &,
71 virtual RCP<PreconditionerFactoryBase<Scalar> >
76 RCP<PreconditionerFactoryBase<Scalar> > * ,
81 const LinearOpSourceBase<Scalar> &fwdOpSrc
88 virtual RCP<LinearOpWithSolveBase<Scalar> >
createOp()
const
89 {
return scaledIdentity(
space_,
s_); }
92 const RCP<
const LinearOpSourceBase<Scalar> > &fwdOpSrc,
93 LinearOpWithSolveBase<Scalar> *Op,
94 const ESupportSolveUse supportSolveUse
98 const RCP<
const LinearOpSourceBase<Scalar> > &fwdOpSrc,
99 LinearOpWithSolveBase<Scalar> *Op
106 LinearOpWithSolveBase<Scalar> *Op,
107 RCP<
const LinearOpSourceBase<Scalar> > *fwdOpSrc,
108 RCP<
const PreconditionerBase<Scalar> > *prec,
109 RCP<
const LinearOpSourceBase<Scalar> > *approxFwdOpSrc,
110 ESupportSolveUse *supportSolveUse
114 const EPreconditionerInputType
115 )
const {
return false; }
118 const RCP<
const LinearOpSourceBase<Scalar> > &,
119 const RCP<
const PreconditionerBase<Scalar> > &,
120 LinearOpWithSolveBase<Scalar> * ,
121 const ESupportSolveUse
125 const RCP<
const LinearOpSourceBase<Scalar> > &,
126 const RCP<
const LinearOpSourceBase<Scalar> > &,
127 LinearOpWithSolveBase<Scalar> * ,
128 const ESupportSolveUse
144 RCP<const VectorSpaceBase<Scalar> >
space_;
153 template<
class Scalar>
154 RCP<ScaledIdentityLinearOpWithSolveFactory<Scalar> >
156 const RCP<
const VectorSpaceBase<Scalar> >& space,
159 RCP<ScaledIdentityLinearOpWithSolveFactory<Scalar> > lowsf =
161 lowsf->initialize(space,s);
167 template<
class Scalar>
171 const RCP<
const LinearOpSourceBase<Scalar> > &fwdOpSrc,
172 LinearOpWithSolveBase<Scalar> *Op,
173 const ESupportSolveUse
176 using Teuchos::dyn_cast;
177 using Teuchos::rcp_dynamic_cast;
180 TEUCHOS_TEST_FOR_EXCEPT(0==Op);
183 const RCP<const LinearOpBase<Scalar> > tmpFwdOp = fwdOpSrc->getOp();
184 RCP<const LinearOpBase<Scalar> > fwdOp;
185 Scalar fwdOp_scalar = 0.0;
186 EOpTransp fwdOp_transp;
187 unwrap<Scalar>(tmpFwdOp, &fwdOp_scalar, &fwdOp_transp, &fwdOp);
189 const RCP<const ScaledIdentityLinearOpWithSolve<Scalar> > fwdSi =
193 fwdSi->space(), fwdSi->scale());
196 template<
class Scalar>
200 LinearOpWithSolveBase<Scalar> * Op,
201 RCP<
const LinearOpSourceBase<Scalar> > *fwdOpSrc,
202 RCP<
const PreconditionerBase<Scalar> > *prec,
203 RCP<
const LinearOpSourceBase<Scalar> > *approxFwdOpSrc,
207 using Teuchos::dyn_cast;
208 using Teuchos::is_null;
210 TEUCHOS_TEST_FOR_EXCEPT(0==Op);
213 #endif // TEUCHOS_DEBUG
214 if (fwdOpSrc) *fwdOpSrc = Teuchos::null;
215 if (prec) *prec = Teuchos::null;
216 if (approxFwdOpSrc) *approxFwdOpSrc = Teuchos::null;
virtual bool supportsPreconditionerInputType(const EPreconditionerInputType) const
Implicit concrete LinearOpBase subclass that takes a flattended out multi-vector and performs a multi...
virtual bool acceptsPreconditionerFactory() const
returns false.
virtual bool isCompatible(const LinearOpSourceBase< Scalar > &fwdOpSrc) const
RCP< const ParameterList > getValidParameters() const
void setParameterList(RCP< ParameterList > const &)
RCP< const VectorSpaceBase< Scalar > > space_
void initialize(const RCP< const VectorSpaceBase< Scalar > > &space, const Scalar &s)
RCP< const ParameterList > getParameterList() const
virtual void uninitializeOp(LinearOpWithSolveBase< Scalar > *Op, RCP< const LinearOpSourceBase< Scalar > > *fwdOpSrc, RCP< const PreconditionerBase< Scalar > > *prec, RCP< const LinearOpSourceBase< Scalar > > *approxFwdOpSrc, ESupportSolveUse *supportSolveUse) const
void initialize(const RCP< const VectorSpaceBase< Scalar > > &space, const Scalar &s)
Initialize.
virtual RCP< LinearOpWithSolveBase< Scalar > > createOp() const
Create a LinearOpWithSolveFactory for a flattened-out multi-vector.
virtual void initializeApproxPreconditionedOp(const RCP< const LinearOpSourceBase< Scalar > > &, const RCP< const LinearOpSourceBase< Scalar > > &, LinearOpWithSolveBase< Scalar > *, const ESupportSolveUse) const
virtual void initializeOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
virtual RCP< PreconditionerFactoryBase< Scalar > > getPreconditionerFactory() const
Returns null .
ScaledIdentityLinearOpWithSolveFactory()
Construct to uninitialized.
void informUpdatedVerbosityState() const
Overridden from Teuchos::VerboseObjectBase.
RCP< ParameterList > getNonconstParameterList()
RCP< ScaledIdentityLinearOpWithSolveFactory< Scalar > > scaledIdentitySolveFactory(const RCP< const VectorSpaceBase< Scalar > > &space, const Scalar &s)
Nonmember constructor.
virtual void initializeAndReuseOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op) const
RCP< ParameterList > unsetParameterList()
virtual void setPreconditionerFactory(const RCP< PreconditionerFactoryBase< Scalar > > &, const std::string &)
Throws exception.
virtual void unsetPreconditionerFactory(RCP< PreconditionerFactoryBase< Scalar > > *, std::string *)
Throws exception.
virtual void initializePreconditionedOp(const RCP< const LinearOpSourceBase< Scalar > > &, const RCP< const PreconditionerBase< Scalar > > &, LinearOpWithSolveBase< Scalar > *, const ESupportSolveUse) const