47 #ifndef MUELU_SHIFTEDLAPLACIANOPERATOR_DEF_HPP 48 #define MUELU_SHIFTEDLAPLACIANOPERATOR_DEF_HPP 52 #ifdef HAVE_MUELU_TPETRA 61 #include "MueLu_Hierarchy.hpp" 62 #include "MueLu_Utilities.hpp" 69 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
70 Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >
76 RCP<MueLu::Level> L0 = Hierarchy_->GetLevel (0);
77 RCP<XMatrix> A = L0->Get<RCP<XMatrix> > (
"A");
79 RCP<Xpetra::BlockedCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > tpbA =
81 if (tpbA != Teuchos::null) {
85 RCP<Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > tpA =
87 return tpA->getDomainMap ();
92 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
93 Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >
99 RCP<MueLu::Level> L0 = Hierarchy_->GetLevel(0);
100 RCP<XMatrix> A = L0->Get< RCP<XMatrix> >(
"A");
102 RCP<Xpetra::BlockedCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > tpbA =
104 if(tpbA != Teuchos::null)
107 RCP< Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > tpA =
109 return tpA->getRangeMap();
114 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
116 Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>& Y,
117 Teuchos::ETransp mode, Scalar alpha, Scalar beta)
const {
119 typedef Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> TMV;
123 TMV & temp_x =
const_cast<TMV &
>(X);
124 const XTMV tX(rcpFromRef(temp_x));
125 XTMV tY(rcpFromRef(Y));
129 Hierarchy_->Iterate(tX, tY, cycles_,
true);
132 catch(std::exception& e) {
134 std::cerr <<
"Caught an exception in MueLu::ShiftedLaplacianOperator::ApplyInverse():" << std::endl
135 << e.what() << std::endl;
169 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
175 #endif //ifdef HAVE_MUELU_TPETRA 177 #endif //ifdef MUELU_SHIFTEDLAPLACIANOPERATOR_DEF_HPP
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.
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. ...
Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Tpetra::Map object associated with the domain of this operator.
static RCP< Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Op2NonConstTpetraCrs(RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Op)
bool hasTransposeApply() const
Indicates whether this operator supports applying the adjoint operator.