10 #ifndef THYRA_XPETRA_LINEAR_OP_HPP
11 #define THYRA_XPETRA_LINEAR_OP_HPP
18 #include "Xpetra_MapExtractor.hpp"
24 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
27 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
30 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
32 const RCP<
const VectorSpaceBase<Scalar> > &rangeSpace,
33 const RCP<
const VectorSpaceBase<Scalar> > &domainSpace,
35 initializeImpl(rangeSpace, domainSpace, xpetraOperator);
38 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
40 const RCP<
const VectorSpaceBase<Scalar> > &rangeSpace,
41 const RCP<
const VectorSpaceBase<Scalar> > &domainSpace,
43 initializeImpl(rangeSpace, domainSpace, xpetraOperator);
46 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
49 return xpetraOperator_.getNonconstObj();
52 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
55 return xpetraOperator_;
60 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
66 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
74 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 Thyra::EOpTransp M_trans)
const {
80 if (M_trans == NOTRANS)
83 if (M_trans == CONJ) {
89 return xpetraOperator_->hasTransposeApply();
92 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
94 const Thyra::EOpTransp M_trans,
95 const Thyra::MultiVectorBase<Scalar> &X_in,
96 const Teuchos::Ptr<Thyra::MultiVectorBase<Scalar> > &Y_inout,
99 using Teuchos::rcpFromPtr;
100 using Teuchos::rcpFromRef;
106 Xpetra::ThyraUtils<Scalar, LocalOrdinal, GlobalOrdinal, Node>::toXpetra(rcpFromRef(X_in), comm);
108 Xpetra::ThyraUtils<Scalar, LocalOrdinal, GlobalOrdinal, Node>::toXpetra(rcpFromPtr(Y_inout), comm);
117 xpetraOperator_->apply(*tX_in, *tY_inout, transp, alpha, beta);
122 Teuchos::ptr_dynamic_cast<Thyra::ProductMultiVectorBase<Scalar> >(Y_inout);
123 if (prodY_inout != Teuchos::null) {
134 mueXop->GetHierarchy()->GetLevel(0)->template Get<RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > >(
"A");
141 rgMapExtractor = bA->getRangeMapExtractor();
148 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
149 template <
class XpetraOperator_t>
151 const RCP<
const VectorSpaceBase<Scalar> > &rangeSpace,
152 const RCP<
const VectorSpaceBase<Scalar> > &domainSpace,
159 rangeSpace_ = rangeSpace;
160 domainSpace_ = domainSpace;
161 xpetraOperator_ = xpetraOperator;
166 #endif // THYRA_XPETRA_LINEAR_OP_HPP
bool is_null(const boost::shared_ptr< T > &p)
RCP< const Thyra::VectorSpaceBase< Scalar > > range() const
RCP< const Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getConstXpetraOperator() const
Get embedded const Xpetra::Operator.
bool is_null(const std::shared_ptr< T > &p)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
bool opSupportedImpl(Thyra::EOpTransp M_trans) const
RCP< const Thyra::VectorSpaceBase< Scalar > > domain() const
MueLu::DefaultScalar Scalar
void initializeImpl(const RCP< const VectorSpaceBase< Scalar > > &rangeSpace, const RCP< const VectorSpaceBase< Scalar > > &domainSpace, const RCP< XpetraOperator_t > &xpetraOperator)
XpetraLinearOp()
Construct to uninitialized.
Exception throws when you call an unimplemented method of MueLu.
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
RCP< Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getXpetraOperator()
Get embedded non-const Xpetra::Operator.
bool nonnull(const boost::shared_ptr< T > &p)
void initialize(const RCP< const VectorSpaceBase< Scalar > > &rangeSpace, const RCP< const VectorSpaceBase< Scalar > > &domainSpace, const RCP< Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &xpetraOperator)
Initialize.
Exception throws to report errors in the internal logical of the program.
#define TEUCHOS_ASSERT(assertion_test)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
void constInitialize(const RCP< const VectorSpaceBase< Scalar > > &rangeSpace, const RCP< const VectorSpaceBase< Scalar > > &domainSpace, const RCP< const Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &xpetraOperator)
Initialize.
Wraps an existing MueLu::Hierarchy as a Xpetra::Operator.