1 #ifndef MUELU_CREATE_EPETRA_PRECONDITIONER_CPP
2 #define MUELU_CREATE_EPETRA_PRECONDITIONER_CPP
5 #include <Xpetra_CrsMatrix.hpp>
6 #include <Xpetra_MultiVector.hpp>
7 #include <Xpetra_MultiVectorFactory.hpp>
13 #include <MueLu_Hierarchy.hpp>
16 #include <MueLu_MLParameterListInterpreter.hpp>
17 #include <MueLu_ParameterListInterpreter.hpp>
18 #include <MueLu_Utilities.hpp>
19 #include <MueLu_HierarchyUtils.hpp>
23 #if defined(HAVE_MUELU_EPETRA)
45 using MultiVector = Xpetra::MultiVector<SC, LO, GO, NO>;
46 using Matrix = Xpetra::Matrix<SC, LO, GO, NO>;
54 coordinates = EpetraMultiVector_To_XpetraMultiVector<typename Teuchos::ScalarTraits<SC>::coordinateType,LO,GO,NO>(userList.
get<
RCP<Epetra_MultiVector> >(
"Coordinates"));
74 RCP<Matrix> A = EpetraCrs_To_XpetraMatrix<SC, LO, GO, NO>(inA);
75 RCP<Hierarchy> H = MueLu::CreateXpetraPreconditioner<SC,LO,GO,NO>(A, paramListIn);
76 return rcp(
new EpetraOperator(H));
88 const std::string& xmlFileName)
117 using Matrix = Xpetra::Matrix<SC, LO, GO, NO>;
121 RCP<Matrix> A = EpetraCrs_To_XpetraMatrix<SC,LO,GO,NO>(inA);
123 MueLu::ReuseXpetraPreconditioner<SC,LO,GO,NO>(A, H);
128 #endif // HAVE_MUELU_SERIAL and HAVE_MUELU_EPETRA
130 #endif //ifndef MUELU_CREATE_EPETRA_PRECONDITIONER_CPP
Various adapters that will create a MueLu preconditioner that is an Xpetra::Matrix.
void ReuseEpetraPreconditioner(const Teuchos::RCP< Epetra_CrsMatrix > &inA, MueLu::EpetraOperator &Op)
T & get(const std::string &name, T def_value)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
bool nonnull(const std::shared_ptr< T > &p)
bool isParameter(const std::string &name) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< MueLu::EpetraOperator > CreateEpetraPreconditioner(const Teuchos::RCP< Epetra_CrsMatrix > &inA, Teuchos::ParameterList ¶mListIn)
Helper function to create a MueLu preconditioner that can be used by Epetra.Given a EpetraCrs_Matrix...
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
Kokkos::Compat::KokkosSerialWrapperNode EpetraNode
const Epetra_Comm & Comm() const
Provides methods to build a multigrid hierarchy and apply multigrid cycles.