46 #ifndef MUELU_XPETRAOPERATOR_DEF_HPP
47 #define MUELU_XPETRAOPERATOR_DEF_HPP
53 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
59 RCP<Matrix> A = Hierarchy_->GetLevel(0)->template Get<RCP<Matrix> >(
"A");
60 return A->getDomainMap();
63 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
69 RCP<Matrix> A = Hierarchy_->GetLevel(0)->template Get<RCP<Matrix> >(
"A");
70 return A->getRangeMap();
73 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
82 #ifdef HAVE_MUELU_DEBUG
84 RCP<Matrix> A = Hierarchy_->GetLevel(0)->template Get<RCP<Matrix> >(
"A");
92 "MueLu::XpetraOperator::apply: map of X is incompatible with range map of A");
94 "MueLu::XpetraOperator::apply: map of Y is incompatible with domain map of A");
96 Hierarchy_->Iterate(X, Y, 1,
true);
97 }
catch (std::exception& e) {
99 std::cerr <<
"Caught an exception in MueLu::XpetraOperator::apply():" << std::endl
100 << e.what() << std::endl;
104 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
110 R.
update(STS::one(), B, STS::zero());
116 #endif // MUELU_XPETRAOPERATOR_DEF_HPP
static Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &map, size_t NumVectors, bool zeroOut=true)
const Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Tpetra::Map object associated with the domain of this operator.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual void update(const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta)=0
MueLu::DefaultScalar Scalar
void apply(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar=Teuchos::ScalarTraits< Scalar >::one(), Scalar=Teuchos::ScalarTraits< Scalar >::one()) const
Returns in Y the result of a Xpetra::Operator applied to a Xpetra::MultiVector X. ...
void residual(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &R) const
Compute a residual R = B - (*this) * X.
const Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Tpetra::Map object associated with the range of this operator.
virtual size_t getNumVectors() const =0