11 #include <Xpetra_CrsMatrixWrap.hpp>
18 #if defined(HAVE_MUELU_SERIAL) and defined(HAVE_MUELU_EPETRA)
28 if (X.Values() == Y.Values()) {
33 bool initialGuessZero =
true;
36 Hierarchy_->Iterate(eX, *tmpY, 1, initialGuessZero);
38 eY.update(1.0, *tmpY, 0.0);
44 bool initialGuessZero =
true;
46 Hierarchy_->Iterate(eX, eY, 1, initialGuessZero);
49 }
catch (std::exception& e) {
51 std::cerr <<
"Caught an exception in MueLu::EpetraOperator::ApplyInverse():" << std::endl
52 << e.what() << std::endl;
59 RCP<Matrix> A = Hierarchy_->GetLevel(0)->Get<RCP<Matrix>>(
"A");
63 if (epbA != Teuchos::null) {
64 RCP<const Xpetra::Matrix<SC, LO, GO, NO>> blockMat = epbA->
getMatrix(0, 0);
66 if (blockCrsWrap == Teuchos::null)
67 throw Exceptions::BadCast(
"MueLu::EpetraOperator::Comm(): Cast from block (0,0) to CrsMatrixWrap failed. Could be a block matrix. TODO implement recursive support for block matrices.");
69 if (tmp_ECrsMtx == Teuchos::null)
70 throw Exceptions::BadCast(
"MueLu::EpetraOperator::Comm(): Cast from Xpetra::CrsMatrix to Xpetra::EpetraCrsMatrix failed");
71 RCP<Epetra_CrsMatrix> epA = tmp_ECrsMtx->getEpetra_CrsMatrixNonConst();
76 if (crsOp == Teuchos::null)
77 throw Exceptions::BadCast(
"Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
79 if (tmp_ECrsMtx == Teuchos::null)
80 throw Exceptions::BadCast(
"Cast from Xpetra::CrsMatrix to Xpetra::EpetraCrsMatrix failed");
81 return tmp_ECrsMtx->getEpetra_CrsMatrixNonConst()->Comm();
84 const Epetra_Map& EpetraOperator::OperatorDomainMap()
const {
85 RCP<Xpetra::Matrix<SC, LO, GO, NO>> A = Hierarchy_->GetLevel(0)->Get<RCP<Matrix>>(
"A");
88 if (epbA != Teuchos::null)
92 if (crsOp == Teuchos::null)
93 throw Exceptions::BadCast(
"Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
95 if (tmp_ECrsMtx == Teuchos::null)
96 throw Exceptions::BadCast(
"Cast from Xpetra::CrsMatrix to Xpetra::EpetraCrsMatrix failed");
97 return tmp_ECrsMtx->getEpetra_CrsMatrixNonConst()->DomainMap();
100 const Epetra_Map& EpetraOperator::OperatorRangeMap()
const {
101 RCP<Xpetra::Matrix<SC, LO, GO, NO>> A = Hierarchy_->GetLevel(0)->Get<RCP<Matrix>>(
"A");
104 if (epbA != Teuchos::null)
108 if (crsOp == Teuchos::null)
109 throw Exceptions::BadCast(
"Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
111 if (tmp_ECrsMtx == Teuchos::null)
112 throw Exceptions::BadCast(
"Cast from Xpetra::CrsMatrix to Xpetra::EpetraCrsMatrix failed");
113 return tmp_ECrsMtx->getEpetra_CrsMatrixNonConst()->RangeMap();
118 #endif // #if defined(HAVE_MUELU_SERIAL) and defined(HAVE_MUELU_EPETRA)
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< Matrix > getMatrix(size_t r, size_t c) const