47 #ifndef MUELU_TPETRAOPERATOR_DEF_HPP 48 #define MUELU_TPETRAOPERATOR_DEF_HPP 52 #ifdef HAVE_MUELU_TPETRA 60 #include "MueLu_Hierarchy.hpp" 61 #include "MueLu_Utilities.hpp" 66 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
67 Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >
71 RCP<Matrix> A = Hierarchy_->GetLevel(0)->template Get<RCP<Matrix> >(
"A");
75 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
79 RCP<Matrix> A = Hierarchy_->GetLevel(0)->template Get<RCP<Matrix> >(
"A");
83 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
85 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>& Y,
86 Teuchos::ETransp mode, Scalar alpha, Scalar beta)
const {
87 typedef Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> TMV;
91 TMV& temp_x =
const_cast<TMV &
>(X);
92 const XTMV tX(rcpFromRef(temp_x));
93 XTMV tY(rcpFromRef(Y));
95 tY.putScalar(Teuchos::ScalarTraits<Scalar>::zero());
96 Hierarchy_->Iterate(tX, tY, 1,
true);
98 }
catch (std::exception& e) {
99 std::cerr <<
"MueLu::TpetraOperator::apply : detected an exception" << std::endl
100 << e.what() << std::endl;
105 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
110 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
111 RCP<MueLu::Hierarchy<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
117 #endif //ifdef HAVE_MUELU_TPETRA 119 #endif //ifdef MUELU_TPETRAOPERATOR_DEF_HPP Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Tpetra::Map object associated with the domain of this 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.
Namespace for MueLu classes and methods.
RCP< MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node > > GetHierarchy() const
Direct access to the underlying MueLu::Hierarchy.
bool hasTransposeApply() const
Indicates whether this operator supports applying the adjoint operator.
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. ...