2 #ifndef PACKAGES_MUELU_ADAPTERS_AZTECOO_MUELU_AZTECEPETRAOPERATOR_CPP_
3 #define PACKAGES_MUELU_ADAPTERS_AZTECOO_MUELU_AZTECEPETRAOPERATOR_CPP_
5 #include "Xpetra_EpetraMultiVector.hpp"
7 #include "MueLu_config.hpp"
8 #include "MueLu_RefMaxwell.hpp"
12 #if defined(HAVE_MUELU_SERIAL) and defined(HAVE_MUELU_EPETRA)
19 const Xpetra::EpetraMultiVectorT<GO,NO> eX(Teuchos::rcpFromRef(const_cast<Epetra_MultiVector&>(X)));
20 Xpetra::EpetraMultiVectorT<GO,NO> eY(Teuchos::rcpFromRef(Y));
22 if (X.Values() == Y.Values()) {
26 xOp_->apply(eX, *tmpY);
28 eY.update(1.0, *tmpY, 0.0);
35 }
catch (std::exception& e) {
37 std::cerr <<
"Caught an exception in MueLu::AztecEpetraOperator::ApplyInverse():" << std::endl
38 << e.what() << std::endl;
44 const Epetra_Comm& AztecEpetraOperator::Comm()
const {
45 const Epetra_Map emap = Xpetra::toEpetra(xOp_->getDomainMap());
49 const Epetra_Map& AztecEpetraOperator::OperatorDomainMap()
const {
52 RCP<const Xpetra::CrsMatrixWrap<SC,LO,GO,NO> > crsOp = rcp_dynamic_cast<
const Xpetra::CrsMatrixWrap<SC,LO,GO,NO> >(A);
53 if (crsOp == Teuchos::null)
54 throw Exceptions::BadCast(
"Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
55 const RCP<const Xpetra::EpetraCrsMatrix> &tmp_ECrsMtx = rcp_dynamic_cast<
const Xpetra::EpetraCrsMatrix>(crsOp->getCrsMatrix());
56 if (tmp_ECrsMtx == Teuchos::null)
57 throw Exceptions::BadCast(
"Cast from Xpetra::CrsMatrix to Xpetra::EpetraCrsMatrix failed");
58 return tmp_ECrsMtx->getEpetra_CrsMatrixNonConst()->DomainMap();
64 return Xpetra::toEpetra(map);
67 const Epetra_Map & AztecEpetraOperator::OperatorRangeMap()
const {
71 RCP<const Xpetra::CrsMatrixWrap<SC,LO,GO,NO> > crsOp = rcp_dynamic_cast<
const Xpetra::CrsMatrixWrap<SC,LO,GO,NO> >(A);
72 if (crsOp == Teuchos::null)
73 throw Exceptions::BadCast(
"Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
74 const RCP<const Xpetra::EpetraCrsMatrix> &tmp_ECrsMtx = rcp_dynamic_cast<
const Xpetra::EpetraCrsMatrix>(crsOp->getCrsMatrix());
75 if (tmp_ECrsMtx == Teuchos::null)
76 throw Exceptions::BadCast(
"Cast from Xpetra::CrsMatrix to Xpetra::EpetraCrsMatrix failed");
77 return tmp_ECrsMtx->getEpetra_CrsMatrixNonConst()->RangeMap();
83 return Xpetra::toEpetra(map);
Preconditioner (wrapped as a Xpetra::Operator) for Maxwell's equations in curl-curl form...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
const Epetra_Comm & Comm() const