44 Teuchos::ParameterList& paramListIn) {
48 using NO = Xpetra::EpetraNode;
50 using Teuchos::ParameterList;
52 using MultiVector = Xpetra::MultiVector<SC, LO, GO, NO>;
53 using Matrix = Xpetra::Matrix<SC, LO, GO, NO>;
57 Teuchos::ParameterList& userList = paramListIn.sublist(
"user data");
58 if (userList.isParameter(
"Coordinates")) {
59 RCP<Xpetra::MultiVector<typename Teuchos::ScalarTraits<SC>::coordinateType, LO, GO, NO> > coordinates = Teuchos::null;
61 coordinates = EpetraMultiVector_To_XpetraMultiVector<typename Teuchos::ScalarTraits<SC>::coordinateType, LO, GO, NO>(userList.get<RCP<Epetra_MultiVector> >(
"Coordinates"));
62 }
catch (Teuchos::Exceptions::InvalidParameterType&) {
63 coordinates = userList.get<RCP<Xpetra::MultiVector<typename Teuchos::ScalarTraits<SC>::coordinateType, LO, GO, NO> > >(
"Coordinates");
65 if (Teuchos::nonnull(coordinates)) {
66 userList.set<RCP<Xpetra::MultiVector<typename Teuchos::ScalarTraits<SC>::coordinateType, LO, GO, NO> > >(
"Coordinates", coordinates);
69 if (userList.isParameter(
"Nullspace")) {
70 RCP<Xpetra::MultiVector<typename Teuchos::ScalarTraits<SC>::coordinateType, LO, GO, NO> > nullspace = Teuchos::null;
72 nullspace = EpetraMultiVector_To_XpetraMultiVector<SC, LO, GO, NO>(userList.get<RCP<Epetra_MultiVector> >(
"Nullspace"));
73 }
catch (Teuchos::Exceptions::InvalidParameterType&) {
74 nullspace = userList.get<RCP<Xpetra::MultiVector<SC, LO, GO, NO> > >(
"Nullspace");
76 if (Teuchos::nonnull(nullspace)) {
77 userList.set<RCP<Xpetra::MultiVector<typename Teuchos::ScalarTraits<SC>::coordinateType, LO, GO, NO> > >(
"Nullspace", nullspace);
81 RCP<Matrix> A = EpetraCrs_To_XpetraMatrix<SC, LO, GO, NO>(inA);
82 RCP<Hierarchy> H = MueLu::CreateXpetraPreconditioner<SC, LO, GO, NO>(A, paramListIn);
83 return rcp(
new EpetraOperator(H));
118 using NO = Xpetra::EpetraNode;
120 using Teuchos::ParameterList;
122 using Matrix = Xpetra::Matrix<SC, LO, GO, NO>;
125 RCP<Hierarchy> H = Op.GetHierarchy();
126 RCP<Matrix> A = EpetraCrs_To_XpetraMatrix<SC, LO, GO, NO>(inA);
128 MueLu::ReuseXpetraPreconditioner<SC, LO, GO, NO>(A, H);
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,...