10 #ifndef MUELU_TPETRAOPERATOR_DEF_HPP
11 #define MUELU_TPETRAOPERATOR_DEF_HPP
15 #include <Xpetra_BlockedMap.hpp>
17 #include <Xpetra_CrsMatrixWrap.hpp>
20 #include <Xpetra_TpetraMultiVector.hpp>
23 #include "MueLu_Hierarchy.hpp"
24 #include "MueLu_Utilities.hpp"
28 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
31 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
39 if (!Hierarchy_.is_null())
40 domainMap = Hierarchy_->GetLevel(0)->template Get<RCP<Matrix> >(
"A")->getDomainMap();
42 domainMap = Operator_->getDomainMap();
45 if (bDomainMap.
is_null() ==
false) {
51 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
58 if (!Hierarchy_.is_null())
59 rangeMap = Hierarchy_->GetLevel(0)->template Get<RCP<Matrix> >(
"A")->getRangeMap();
61 rangeMap = Operator_->getRangeMap();
64 if (bRangeMap.
is_null() ==
false) {
70 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
80 TMV& temp_x =
const_cast<TMV&
>(X);
81 const XTMV tX(rcpFromRef(temp_x));
82 XTMV tY(rcpFromRef(Y));
84 if (!Hierarchy_.is_null())
85 Hierarchy_->Iterate(tX, tY, 1,
true);
87 Operator_->apply(tX, tY);
89 }
catch (std::exception& e) {
90 std::cerr <<
"MueLu::TpetraOperator::apply : detected an exception" << std::endl
91 << e.what() << std::endl;
96 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
101 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
107 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
115 #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)
virtual ~TpetraOperator()
Destructor.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Tpetra::Map object associated with the range of this operator.
MueLu::DefaultScalar Scalar
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.
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. ...