10 #ifndef XPETRA_TPETRAOPERATOR_HPP
11 #define XPETRA_TPETRAOPERATOR_HPP
15 #include <Tpetra_Operator.hpp>
16 #include <Tpetra_Details_residual.hpp>
18 #include "Xpetra_Map.hpp"
19 #include "Xpetra_TpetraMap.hpp"
20 #include "Xpetra_MultiVector.hpp"
21 #include "Xpetra_TpetraMultiVector.hpp"
28 template <
class Scalar,
31 class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
37 virtual const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getDomainMap()
const {
43 virtual const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getRangeMap()
const {
57 Teuchos::ETransp mode = Teuchos::NO_TRANS,
58 Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(),
59 Scalar beta = Teuchos::ScalarTraits<Scalar>::zero())
const {
65 return op_->hasTransposeApply();
76 return op_->description();
80 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
82 op_->describe(out, verbLevel);
93 TpetraOperator(
const Teuchos::RCP<Tpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &op)
97 virtual RCP<Tpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getOperator() {
return op_; }
100 virtual RCP<const Tpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getOperatorConst()
const {
return op_; }
113 RCP<Tpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
op_;
117 #if ((!defined(HAVE_TPETRA_INST_SERIAL)) && (!defined(HAVE_TPETRA_INST_INT_INT)) && defined(HAVE_XPETRA_EPETRA))
121 :
public Operator<double, int, int, EpetraNode> {
131 virtual Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >
getDomainMap()
const {
132 return Teuchos::null;
136 virtual Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >
getRangeMap()
const {
137 return Teuchos::null;
149 Teuchos::ETransp mode = Teuchos::NO_TRANS,
150 Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(),
151 Scalar beta = Teuchos::ScalarTraits<Scalar>::zero())
const {}
165 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
173 TpetraOperator(
const Teuchos::RCP<Tpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &op) {}
176 RCP<Tpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getOperator() {
return Teuchos::null; }
188 #if ((!defined(HAVE_TPETRA_INST_SERIAL)) && (!defined(HAVE_TPETRA_INST_INT_LONG_LONG)) && defined(HAVE_XPETRA_EPETRA))
192 :
public Operator<double, int, long long, EpetraNode> {
202 virtual Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >
getDomainMap()
const {
203 return Teuchos::null;
207 virtual Teuchos::RCP<const Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >
getRangeMap()
const {
208 return Teuchos::null;
220 Teuchos::ETransp mode = Teuchos::NO_TRANS,
221 Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(),
222 Scalar beta = Teuchos::ScalarTraits<Scalar>::zero())
const {}
236 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
244 TpetraOperator(
const Teuchos::RCP<Tpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &op) {}
247 RCP<Tpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getOperator() {
return Teuchos::null; }
260 #define XPETRA_TPETRAOPERATOR_SHORT
261 #endif // XPETRA_TPETRAOPERATOR_HPP
virtual void apply(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
Computes the operator-multivector application.
virtual Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
The Map associated with the range of this operator, which must be compatible with Y...
std::string description() const
A simple one-line description of this object.
virtual const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
The Map associated with the range of this operator, which must be compatible with Y...
virtual bool hasTransposeApply() const
Whether this operator supports applying the transpose or conjugate transpose.
virtual Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
The Map associated with the domain of this operator, which must be compatible with X...
virtual RCP< Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getOperator()
Gets the operator out.
std::string description() const
A simple one-line description of this object.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with the given verbosity level to a FancyOStream.
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
virtual RCP< const Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getOperatorConst() const
Gets the operator out.
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
virtual bool hasTransposeApply() const
Whether this operator supports applying the transpose or conjugate transpose.
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.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
virtual Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
The Map associated with the domain of this operator, which must be compatible with X...
TpetraOperator(const Teuchos::RCP< Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &op)
TpetraOperator constructor to wrap a Tpetra::Operator object.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with the given verbosity level to a FancyOStream.
virtual void apply(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
Computes the operator-multivector application.
RCP< Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > op_
The Tpetra::Operator which this class wraps.
TpetraOperator(const Teuchos::RCP< Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &op)
TpetraOperator constructor to wrap a Tpetra::Operator object.
std::string description() const
A simple one-line description of this object.
virtual void apply(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
Computes the operator-multivector application.
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with the given verbosity level to a FancyOStream.
RCP< Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getOperator()
Gets the operator out.
#define XPETRA_MONITOR(funcName)
virtual const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
The Map associated with the domain of this operator, which must be compatible with X...
TpetraOperator(const Teuchos::RCP< Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &op)
TpetraOperator constructor to wrap a Tpetra::Operator object.
RCP< Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getOperator()
Gets the operator out.
virtual Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
The Map associated with the range of this operator, which must be compatible with Y...
virtual bool hasTransposeApply() const
Whether this operator supports applying the transpose or conjugate transpose.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)