46 #ifndef BELOS_XPETRA_ADAPTER_OPERATOR_HPP 47 #define BELOS_XPETRA_ADAPTER_OPERATOR_HPP 53 #ifdef HAVE_XPETRA_EPETRA 54 #include <Epetra_config.h> 55 #include <BelosOperator.hpp> 62 using Teuchos::rcpFromRef;
92 template <
class Scalar,
97 public OperatorT<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
98 #ifdef HAVE_XPETRA_TPETRA 99 ,
public OperatorT<Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
125 "Belos::XpetraOp::Apply, transpose mode != NOTRANS not supported.");
133 #ifdef HAVE_XPETRA_TPETRA 142 "Belos::MueLuTpetraOp::Apply, transpose mode != NOTRANS not supported.");
157 RCP<const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getOperator()
const {
return Op_; }
161 RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
Op_;
164 #ifdef HAVE_MUELU_EPETRA 165 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 177 public OperatorT<Xpetra::MultiVector<double, int, int, Xpetra::EpetraNode> >
178 #ifdef HAVE_XPETRA_TPETRA 179 #if !((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ 180 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) 181 ,
public OperatorT<Tpetra::MultiVector<double, int, int, Xpetra::EpetraNode> >
184 #ifdef HAVE_XPETRA_EPETRA 201 "Belos::XpetraOp::Apply, transpose mode != NOTRANS not supported.");
209 #ifdef HAVE_XPETRA_TPETRA 210 #if !((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ 211 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) 214 "Belos::MueLuTpetraOp::Apply, transpose mode != NOTRANS not supported.");
229 #ifdef HAVE_XPETRA_EPETRA 236 void Apply (
const Epetra_MultiVector& x, Epetra_MultiVector& y, ETrans trans=NOTRANS )
const {
237 TEUCHOS_TEST_FOR_EXCEPTION(trans!=NOTRANS, XpetraOpFailure,
238 "Belos::MueLuTpetraOp::Apply, transpose mode != NOTRANS not supported.");
240 Epetra_MultiVector & temp_x =
const_cast<Epetra_MultiVector &
>(x);
252 RCP<const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getOperator()
const {
return Op_; }
256 RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
Op_;
258 #endif // !EPETRA_NO_32BIT_GLOBAL_INDICES 259 #endif // HAVE_MUELU_EPETRA 261 #ifdef HAVE_MUELU_EPETRA 262 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 275 public OperatorT<Xpetra::MultiVector<double, int, long long, Xpetra::EpetraNode> >
276 #ifdef HAVE_XPETRA_TPETRA 277 #if !((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \ 278 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))) 279 ,
public OperatorT<Tpetra::MultiVector<double, int, long long, Xpetra::EpetraNode> >
282 #ifdef HAVE_XPETRA_EPETRA 299 "Belos::XpetraOp::Apply, transpose mode != NOTRANS not supported.");
307 #ifdef HAVE_XPETRA_TPETRA 308 #if !((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \ 309 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))) 312 "Belos::MueLuTpetraOp::Apply, transpose mode != NOTRANS not supported.");
327 #ifdef HAVE_XPETRA_EPETRA 334 void Apply (
const Epetra_MultiVector& x, Epetra_MultiVector& y, ETrans trans=NOTRANS )
const {
335 TEUCHOS_TEST_FOR_EXCEPTION(trans!=NOTRANS, XpetraOpFailure,
336 "Belos::MueLuTpetraOp::Apply, transpose mode != NOTRANS not supported.");
338 Epetra_MultiVector & temp_x =
const_cast<Epetra_MultiVector &
>(x);
350 RCP<const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getOperator()
const {
return Op_; }
354 RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
Op_;
356 #endif // !EPETRA_NO_64BIT_GLOBAL_INDICES 357 #endif // HAVE_MUELU_EPETRA 363 #endif // BELOS_XPETRA_ADAPTER_OPERATOR_HPP
RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getOperator() const
RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getOperator() const
RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Op_
virtual void putScalar(const Scalar &value)=0
virtual ~XpetraOp()
Destructor.
XpetraOp(const RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &Op)
Default constructor.
void Apply(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x, Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &y, ETrans trans=NOTRANS) const
This routine takes the Xpetra::MultiVector x and applies the operator to it resulting in the Xpetra::...
XpetraOpFailure(const std::string &what_arg)
RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getOperator() const
void Apply(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x, Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &y, ETrans trans=NOTRANS) const
This routine takes the Belos::MultiVec x and applies the operator to it resulting in the Belos::Multi...
XpetraOp(const RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &Op)
Implementation of the Belos::XpetraOp. It derives from the Belos::OperatorT templated on the Xpetra::...
XpetraOpFailure is thrown when a return value from an MueLu call on an Xpetra::Operator or MueLu::Hie...
XpetraOp(const RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &Op)
RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Op_
RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Op_
void Apply(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x, Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &y, ETrans trans=NOTRANS) const
This routine takes the Belos::MultiVec x and applies the operator to it resulting in the Belos::Multi...