46#ifndef XPETRA_EPETRAOPERATOR_HPP
47#define XPETRA_EPETRAOPERATOR_HPP
51#include <Epetra_Operator.h>
52#include <Epetra_Map.h>
54#include "Xpetra_Map.hpp"
56#include "Xpetra_MultiVector.hpp"
64 template<
class EpetraGlobalOrdinal,
class Node>
79 return toXpetra<GlobalOrdinal,Node>(
op_->OperatorDomainMap());
87 return toXpetra<GlobalOrdinal,Node>(
op_->OperatorRangeMap());
110 "Xpetra::EpetraOperator->apply(): can only accept mode == NO_TRANS or mode == TRANS");
112 "Xpetra::EpetraOperator->apply(): cannot apply transpose as underlying Epetra operator does not support it");
131 int err =
op_->SetUseTranspose(
true);
132 op_->SetUseTranspose(
false);
148 out <<
"Epetra_Operator" << std::endl;
164 R.
update(STS::one(),B,STS::zero());
177 template<
class EpetraGlobalOrdinal,
class Node>
190 return toXpetra<GlobalOrdinal,Node>(
op_->OperatorDomainMap());
196 return toXpetra<GlobalOrdinal,Node>(
op_->OperatorRangeMap());
217 "Xpetra::EpetraOperator->apply(): can only accept mode == NO_TRANS or mode == TRANS");
219 "Xpetra::EpetraOperator->apply(): cannot apply transpose as underlying Epetra operator does not support it");
236 int err =
op_->SetUseTranspose(
true);
237 op_->SetUseTranspose(
false);
252 out <<
"Epetra_Operator" << std::endl;
269 R.
update(STS::one(),B,STS::zero());
#define XPETRA_MONITOR(funcName)
#define XPETRA_ERR_CHECK(arg)
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
static const EVerbosityLevel verbLevel_default
virtual void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, 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 Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
The Map associated with the domain of this operator, which must be compatible with X....
std::string description() const
A simple one-line description of this object.
void residual(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &R) const
Compute a residual R = B - (*this) * X.
EpetraGlobalOrdinal GlobalOrdinal
RCP< Epetra_Operator > op_
The Tpetra::Operator which this class wraps.
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 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
The Map associated with the range of this operator, which must be compatible with Y....
EpetraInverseOperator(const Teuchos::RCP< Epetra_Operator > &op)
EpetraOperator constructor to wrap a Epetra_Operator object.
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....
void residual(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &R) const
Compute a residual R = B - (*this) * X.
std::string description() const
A simple one-line description of this object.
virtual bool hasTransposeApply() const
Whether this operator supports applying the transpose or conjugate transpose.
virtual void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, 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.
EpetraOperator(const Teuchos::RCP< Epetra_Operator > &op)
EpetraOperator constructor to wrap a Epetra_Operator object.
RCP< Epetra_Operator > op_
The Tpetra::Operator which this class wraps.
EpetraGlobalOrdinal GlobalOrdinal
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 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....
Exception throws when you call an unimplemented method of Xpetra.
Exception throws to report errors in the internal logical of the program.
virtual void update(const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta)=0
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)