47 #ifndef THYRA_XPETRA_LINEAR_OP_HPP
48 #define THYRA_XPETRA_LINEAR_OP_HPP
55 #include "Xpetra_MapExtractor.hpp"
63 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
68 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
70 const RCP<
const VectorSpaceBase<Scalar> > &rangeSpace,
71 const RCP<
const VectorSpaceBase<Scalar> > &domainSpace,
72 const RCP<Xpetra::Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &xpetraOperator
75 initializeImpl(rangeSpace, domainSpace, xpetraOperator);
79 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
81 const RCP<
const VectorSpaceBase<Scalar> > &rangeSpace,
82 const RCP<
const VectorSpaceBase<Scalar> > &domainSpace,
83 const RCP<
const Xpetra::Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &xpetraOperator
86 initializeImpl(rangeSpace, domainSpace, xpetraOperator);
90 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
94 return xpetraOperator_.getNonconstObj();
98 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
102 return xpetraOperator_;
109 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
117 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
126 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
128 Thyra::EOpTransp M_trans)
const
133 if (M_trans == NOTRANS)
136 if (M_trans == CONJ) {
142 return xpetraOperator_->hasTransposeApply();
146 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
148 const Thyra::EOpTransp M_trans,
149 const Thyra::MultiVectorBase<Scalar> &X_in,
150 const Teuchos::Ptr<Thyra::MultiVectorBase<Scalar> > &Y_inout,
155 using Teuchos::rcpFromRef;
156 using Teuchos::rcpFromPtr;
162 Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::toXpetra(rcpFromRef(X_in), comm);
164 Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::toXpetra(rcpFromPtr(Y_inout), comm);
173 xpetraOperator_->apply(*tX_in, *tY_inout, transp, alpha, beta);
178 Teuchos::ptr_dynamic_cast<Thyra::ProductMultiVectorBase<Scalar> >(Y_inout);
179 if(prodY_inout != Teuchos::null) {
190 mueXop->GetHierarchy()->GetLevel(0)->template Get<RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal,Node> > >(
"A");
194 Teuchos::rcp_dynamic_cast<Xpetra::BlockedCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal,Node> >(A);
197 rgMapExtractor = bA->getRangeMapExtractor();
206 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
207 template<
class XpetraOperator_t>
209 const RCP<
const VectorSpaceBase<Scalar> > &rangeSpace,
210 const RCP<
const VectorSpaceBase<Scalar> > &domainSpace,
219 rangeSpace_ = rangeSpace;
220 domainSpace_ = domainSpace;
221 xpetraOperator_ = xpetraOperator;
228 #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.