1 #ifndef MUELU_CREATE_EPETRA_PRECONDITIONER_CPP
2 #define MUELU_CREATE_EPETRA_PRECONDITIONER_CPP
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)
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);
88 const std::string& xmlFileName)
121 RCP<Matrix> A = EpetraCrs_To_XpetraMatrix<SC,LO,GO,NO>(inA);
123 MueLu::ReuseXpetraPreconditioner<SC,LO,GO,NO>(A, H);
126 #ifdef HAVE_MUELU_DEPRECATED_CODE
154 using Hierarchy = Hierarchy<SC,LO,GO,NO>;
155 using HierarchyManager = HierarchyManager<SC,LO,GO,NO>;
157 RCP<Matrix> A = EpetraCrs_To_XpetraMatrix<SC, LO, GO, NO>(inA);
160 RCP<MultiVector> coordinates = Teuchos::null;
162 coordinates = EpetraMultiVector_To_XpetraMultiVector<SC,LO,GO,NO>(inCoords);
165 userParamList.
set<RCP<MultiVector> >(
"Coordinates", coordinates);
167 RCP<MultiVector> nullspace = Teuchos::null;
169 nullspace = EpetraMultiVector_To_XpetraMultiVector<SC, LO, GO, NO>(inNullspace);
172 userParamList.
set<RCP<MultiVector> >(
"Nullspace", nullspace);
175 RCP<Hierarchy> H = MueLu::CreateXpetraPreconditioner<SC,LO,GO,NO>(A, paramListIn);
203 using Hierarchy = Hierarchy<SC,LO,GO,NO>;
204 using HierarchyManager = HierarchyManager<SC,LO,GO,NO>;
206 RCP<Matrix> A = EpetraCrs_To_XpetraMatrix<SC, LO, GO, NO>(inA);
209 RCP<MultiVector> coordinates = Teuchos::null;
211 coordinates = EpetraMultiVector_To_XpetraMultiVector<SC,LO,GO,NO>(inCoords);
214 userParamList.
set<RCP<MultiVector> >(
"Coordinates", coordinates);
217 RCP<Hierarchy> H = MueLu::CreateXpetraPreconditioner<SC,LO,GO,NO>(A, paramListIn);
244 RCP<MultiVector> coordinates = Teuchos::null;
246 coordinates = EpetraMultiVector_To_XpetraMultiVector<SC,LO,GO,NO>(inCoords);
249 userParamList.
set<RCP<MultiVector> >(
"Coordinates", coordinates);
252 RCP<MultiVector> nullspace = Teuchos::null;
254 nullspace = EpetraMultiVector_To_XpetraMultiVector<SC,LO,GO,NO>(inNullspace);
285 RCP<MultiVector> coordinates = Teuchos::null;
287 coordinates = EpetraMultiVector_To_XpetraMultiVector<SC,LO,GO,NO>(inCoords);
290 userParamList.
set<RCP<MultiVector> >(
"Coordinates", coordinates);
308 const std::string& xmlFileName,
323 RCP<MultiVector> coordinates = Teuchos::null;
324 if (inCoords != Teuchos::null) {
325 coordinates = EpetraMultiVector_To_XpetraMultiVector<SC,LO,GO,NO>(inCoords);
328 userParamList.
set<RCP<MultiVector> >(
"Coordinates", coordinates);
331 RCP<MultiVector> nullspace = Teuchos::null;
332 if (inCoords != Teuchos::null) {
333 nullspace = EpetraMultiVector_To_XpetraMultiVector<SC,LO,GO,NO>(inNullspace);
353 const std::string& xmlFileName,
367 RCP<MultiVector> coordinates = Teuchos::null;
368 if (inCoords != Teuchos::null) {
369 coordinates = EpetraMultiVector_To_XpetraMultiVector<SC,LO,GO,NO>(inCoords);
372 userParamList.
set<RCP<MultiVector> >(
"Coordinates", coordinates);
378 #endif // HAVE_MUELU_DEPRECATED_CODE
381 #endif // HAVE_MUELU_SERIAL and HAVE_MUELU_EPETRA
383 #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)
Kokkos::Compat::KokkosSerialWrapperNode EpetraNode
EpetraOperatorT< int > EpetraOperator
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...
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
const Epetra_Comm & Comm() const
Provides methods to build a multigrid hierarchy and apply multigrid cycles.