10 #ifndef THYRA_TPETRA_LINEAR_OP_DECL_HPP
11 #define THYRA_TPETRA_LINEAR_OP_DECL_HPP
13 #include "Thyra_LinearOpDefaultBase.hpp"
15 #include "Thyra_ScaledLinearOpBase.hpp"
16 #include "Thyra_RowStatLinearOpBase.hpp"
17 #include "Tpetra_Operator.hpp"
20 #if defined(HAVE_THYRA_EPETRA) && defined(HAVE_TPETRA_EPETRA)
21 # define HAVE_THYRA_TPETRA_EPETRA
24 #ifdef HAVE_THYRA_TPETRA_EPETRA
26 # include "Tpetra_EpetraRowMatrix.hpp"
39 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal=LocalOrdinal,
40 class Node=Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
42 :
virtual public Thyra::LinearOpDefaultBase<Scalar>,
43 virtual public ScaledLinearOpBase<Scalar>,
44 virtual public Thyra::RowStatLinearOpBase<Scalar>
45 #ifdef HAVE_THYRA_TPETRA_EPETRA
59 const RCP<
const VectorSpaceBase<Scalar> > &rangeSpace,
60 const RCP<
const VectorSpaceBase<Scalar> > &domainSpace,
61 const RCP<Tpetra::Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &tpetraOperator
66 const RCP<
const VectorSpaceBase<Scalar> > &rangeSpace,
67 const RCP<
const VectorSpaceBase<Scalar> > &domainSpace,
68 const RCP<
const Tpetra::Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &tpetraOperator
92 #ifdef HAVE_THYRA_TPETRA_EPETRA
98 void getNonconstEpetraOpView(
100 const Ptr<EOpTransp> &epetraOpTransp,
101 const Ptr<EApplyEpetraOpAs> &epetraOpApplyAs,
102 const Ptr<EAdjointEpetraOp> &epetraOpAdjointSupport
105 void getEpetraOpView(
107 const Ptr<EOpTransp> &epetraOpTransp,
108 const Ptr<EApplyEpetraOpAs> &epetraOpApplyAs,
109 const Ptr<EAdjointEpetraOp> &epetraOpAdjointSupport
114 #endif // HAVE_THYRA_TPETRA_EPETRA
126 const Thyra::EOpTransp M_trans,
127 const Thyra::MultiVectorBase<Scalar> &X_in,
128 const Teuchos::Ptr<Thyra::MultiVectorBase<Scalar> > &Y_inout,
145 virtual void scaleLeftImpl(
const VectorBase<Scalar> &row_scaling);
148 virtual void scaleRightImpl(
const VectorBase<Scalar> &col_scaling);
157 const RowStatLinearOpBaseUtils::ERowStat rowStat)
const;
161 const RowStatLinearOpBaseUtils::ERowStat rowStat,
162 const Ptr<VectorBase<Scalar> > &rowStatVec)
const;
177 #ifdef HAVE_THYRA_TPETRA_EPETRA
181 template<
class TpetraOperator_t>
183 const RCP<
const VectorSpaceBase<Scalar> > &rangeSpace,
184 const RCP<
const VectorSpaceBase<Scalar> > &domainSpace,
195 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
198 const RCP<
const VectorSpaceBase<Scalar> > &rangeSpace,
199 const RCP<
const VectorSpaceBase<Scalar> > &domainSpace,
200 const RCP<Tpetra::Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &tpetraOperator
205 op->initialize(rangeSpace, domainSpace, tpetraOperator);
214 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
217 const RCP<
const VectorSpaceBase<Scalar> > &rangeSpace,
218 const RCP<
const VectorSpaceBase<Scalar> > &domainSpace,
219 const RCP<
const Tpetra::Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &tpetraOperator
224 op->constInitialize(rangeSpace, domainSpace, tpetraOperator);
232 #endif // THYRA_TPETRA_LINEAR_OP_DECL_HPP
void initializeImpl(const RCP< const VectorSpaceBase< Scalar > > &rangeSpace, const RCP< const VectorSpaceBase< Scalar > > &domainSpace, const RCP< TpetraOperator_t > &tpetraOperator)
void constInitialize(const RCP< const VectorSpaceBase< Scalar > > &rangeSpace, const RCP< const VectorSpaceBase< Scalar > > &domainSpace, const RCP< const Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &tpetraOperator)
Initialize.
Abstract base class for all LinearOpBase objects that can return an Epetra_Operator view of themselve...
virtual void getRowStatImpl(const RowStatLinearOpBaseUtils::ERowStat rowStat, const Ptr< VectorBase< Scalar > > &rowStatVec) const
bool opSupportedImpl(Thyra::EOpTransp M_trans) const
RCP< const Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getConstTpetraOperator() const
Get embedded const Tpetra::Operator.
void applyImpl(const Thyra::EOpTransp M_trans, const Thyra::MultiVectorBase< Scalar > &X_in, const Teuchos::Ptr< Thyra::MultiVectorBase< Scalar > > &Y_inout, const Scalar alpha, const Scalar beta) const
virtual bool rowStatIsSupportedImpl(const RowStatLinearOpBaseUtils::ERowStat rowStat) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
RCP< const TpetraLinearOp< Scalar, LocalOrdinal, GlobalOrdinal, Node > > constTpetraLinearOp(const RCP< const VectorSpaceBase< Scalar > > &rangeSpace, const RCP< const VectorSpaceBase< Scalar > > &domainSpace, const RCP< const Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &tpetraOperator)
Nonmmeber constructor for TpetraLinearOp.
virtual bool supportsScaleLeftImpl() const
RCP< const Thyra::VectorSpaceBase< Scalar > > range() const
RCP< Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetraOperator()
Get embedded non-const Tpetra::Operator.
RCP< TpetraLinearOp< Scalar, LocalOrdinal, GlobalOrdinal, Node > > tpetraLinearOp(const RCP< const VectorSpaceBase< Scalar > > &rangeSpace, const RCP< const VectorSpaceBase< Scalar > > &domainSpace, const RCP< Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &tpetraOperator)
Nonmmeber constructor for TpetraLinearOp.
TpetraLinearOp()
Construct to uninitialized.
virtual void scaleLeftImpl(const VectorBase< Scalar > &row_scaling)
Teuchos::ConstNonconstObjectContainer< Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > tpetraOperator_
virtual void scaleRightImpl(const VectorBase< Scalar > &col_scaling)
RCP< const VectorSpaceBase< Scalar > > rangeSpace_
virtual bool supportsScaleRightImpl() const
RCP< const VectorSpaceBase< Scalar > > domainSpace_
void initialize(const RCP< const VectorSpaceBase< Scalar > > &rangeSpace, const RCP< const VectorSpaceBase< Scalar > > &domainSpace, const RCP< Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &tpetraOperator)
Initialize.
RCP< const Thyra::VectorSpaceBase< Scalar > > domain() const
Concrete Thyra::LinearOpBase subclass for Tpetra::Operator.