1 #ifndef MUELU_CREATE_EPETRA_PRECONDITIONER_HPP 2 #define MUELU_CREATE_EPETRA_PRECONDITIONER_HPP 4 #include <Teuchos_XMLParameterListHelpers.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) 35 Teuchos::RCP<MueLu::EpetraOperator>
38 Teuchos::ParameterList& paramListIn,
39 const Teuchos::RCP<Epetra_MultiVector>& inCoords = Teuchos::null,
40 const Teuchos::RCP<Epetra_MultiVector>& inNullspace = Teuchos::null)
47 using Teuchos::ParameterList;
54 RCP<Matrix> A = EpetraCrs_To_XpetraMatrix<SC, LO, GO, NO>(inA);
55 RCP<MultiVector> coordinates = Teuchos::null;
56 if (inCoords != Teuchos::null) {
57 coordinates = EpetraMultiVector_To_XpetraMultiVector<SC,LO,GO,NO>(inCoords);
59 RCP<MultiVector> nullspace = Teuchos::null;
60 if (inNullspace != Teuchos::null) {
61 nullspace = EpetraMultiVector_To_XpetraMultiVector<SC, LO, GO, NO>(inNullspace);
63 RCP<Hierarchy> H = MueLu::CreateXpetraPreconditioner<SC,LO,GO,NO>(A,paramListIn,coordinates,nullspace);
75 Teuchos::RCP<MueLu::EpetraOperator>
77 const Teuchos::RCP<Epetra_MultiVector>& inCoords = Teuchos::null,
78 const Teuchos::RCP<Epetra_MultiVector>& inNullspace = Teuchos::null) {
79 Teuchos::ParameterList paramList;
92 Teuchos::RCP<MueLu::EpetraOperator>
94 const std::string& xmlFileName,
95 const Teuchos::RCP<Epetra_MultiVector>& inCoords = Teuchos::null,
96 const Teuchos::RCP<Epetra_MultiVector>& inNullspace = Teuchos::null)
98 Teuchos::ParameterList paramList;
99 Teuchos::updateParametersFromXmlFileAndBroadcast(xmlFileName, Teuchos::Ptr<Teuchos::ParameterList>(¶mList), *
Xpetra::toXpetra(A->Comm()));
111 typedef MueLu ::Hierarchy<SC,LO,GO,NO>
Hierarchy;
113 RCP<Hierarchy> H = Op.GetHierarchy();
114 RCP<Matrix> A = EpetraCrs_To_XpetraMatrix<SC,LO,GO,NO>(inA);
116 MueLu::ReuseXpetraPreconditioner<SC,LO,GO,NO>(A, H);
120 #endif // HAVE_MUELU_SERIAL and HAVE_MUELU_EPETRA 122 #endif //ifndef MUELU_CREATE_EPETRA_PRECONDITIONER_HPP
void ReuseEpetraPreconditioner(const Teuchos::RCP< Epetra_CrsMatrix > &inA, MueLu::EpetraOperator &Op)
Namespace for MueLu classes and methods.
EpetraOperatorT< int > EpetraOperator
Teuchos::RCP< MueLu::EpetraOperator > CreateEpetraPreconditioner(const Teuchos::RCP< Epetra_CrsMatrix > &inA, Teuchos::ParameterList ¶mListIn, const Teuchos::RCP< Epetra_MultiVector > &inCoords=Teuchos::null, const Teuchos::RCP< Epetra_MultiVector > &inNullspace=Teuchos::null)
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)
Provides methods to build a multigrid hierarchy and apply multigrid cycles.