47 #ifndef MUELU_TPETRAOPERATOR_DEF_HPP
48 #define MUELU_TPETRAOPERATOR_DEF_HPP
52 #ifdef HAVE_MUELU_TPETRA
59 #include <Xpetra_TpetraMultiVector.hpp>
62 #include "MueLu_Hierarchy.hpp"
63 #include "MueLu_Utilities.hpp"
68 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 if(!Hierarchy_.is_null()) domainMap = Hierarchy_->GetLevel(0)->template Get<RCP<Matrix> >(
"A")->getDomainMap();
77 else domainMap = Operator_->getDomainMap();
81 if(bDomainMap.
is_null() ==
false) {
87 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
95 if(!Hierarchy_.is_null()) rangeMap = Hierarchy_->GetLevel(0)->template Get<RCP<Matrix> >(
"A")->getRangeMap();
96 else rangeMap = Operator_->getRangeMap();
99 if(bRangeMap.
is_null() ==
false) {
105 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
107 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>& Y,
109 typedef Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> TMV;
113 TMV& temp_x =
const_cast<TMV &
>(X);
114 const XTMV tX(rcpFromRef(temp_x));
115 XTMV tY(rcpFromRef(Y));
118 if(!Hierarchy_.is_null())
119 Hierarchy_->Iterate(tX, tY, 1,
true);
121 Operator_->apply(tX, tY);
123 }
catch (std::exception& e) {
124 std::cerr <<
"MueLu::TpetraOperator::apply : detected an exception" << std::endl
125 << e.what() << std::endl;
130 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
135 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
141 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
147 #ifdef HAVE_MUELU_DEPRECATED_CODE
148 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
149 template <
class NewNode>
153 if(!Hierarchy_.is_null())
156 return Teuchos::null;
162 #endif //ifdef HAVE_MUELU_TPETRA
164 #endif //ifdef MUELU_TPETRAOPERATOR_DEF_HPP
bool hasTransposeApply() const
Indicates whether this operator supports applying the adjoint operator.
const RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > toTpetraNonZero(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Tpetra::Map object associated with the range of this operator.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
RCP< Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > GetOperator() const
Direct access to the underlying MueLu::Operator.
Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Tpetra::Map object associated with the domain of this operator.
Wraps an existing MueLu::Hierarchy as a Tpetra::Operator.
RCP< MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node > > GetHierarchy() const
Direct access to the underlying MueLu::Hierarchy.
void apply(const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::one()) const
Returns in Y the result of a Tpetra::Operator applied to a Tpetra::MultiVector X. ...