45 #include "Epetra_MpiComm.h" 47 #include "Epetra_SerialComm.h" 49 #include "Epetra_CrsMatrix.h" 50 #include "Epetra_MultiVector.h" 51 #include "Epetra_Map.h" 52 #include "Epetra_BlockMap.h" 53 #include "Epetra_LinearProblem.h" 54 #include "Galeri_Maps.h" 55 #include "Galeri_CrsMatrices.h" 56 #include "Teuchos_ParameterList.hpp" 57 #include "Teuchos_RefCountPtr.hpp" 61 int main(
int argc,
char *argv[])
66 MPI_Init(&argc,&argv);
72 Teuchos::ParameterList GaleriList;
76 GaleriList.set(
"nx", nx);
77 GaleriList.set(
"ny", nx * Comm.
NumProc());
78 GaleriList.set(
"mx", 1);
79 GaleriList.set(
"my", Comm.
NumProc());
80 Teuchos::RefCountPtr<Epetra_Map> Map = Teuchos::rcp( Galeri::CreateMap(
"Cartesian2D", Comm, GaleriList) );
81 Teuchos::RefCountPtr<Epetra_RowMatrix> A = Teuchos::rcp( Galeri::CreateCrsMatrix(
"Laplace2D", &*Map, GaleriList) );
87 Teuchos::ParameterList List;
95 std::string PrecType =
"Amesos";
99 Teuchos::RefCountPtr<Ifpack_Preconditioner> Prec = Teuchos::rcp( Factory.
Create(PrecType, &*A, OverlapLevel) );
100 assert(Prec != Teuchos::null);
107 List.set(
"amesos: solver type",
"Amesos_Klu");
148 Solver.SetAztecOption(AZ_solver,AZ_gmres);
149 Solver.SetAztecOption(AZ_output,32);
152 Solver.SetPrecOperator(&*Prec);
157 Solver.Iterate(1550,1e-8);
163 return(EXIT_SUCCESS);
int main(int argc, char *argv[])
static Ifpack_Preconditioner * Create(EPrecType PrecType, Epetra_RowMatrix *Matrix, const int overlap=0, bool overrideSerialDefault=false)
Creates an instance of Ifpack_Preconditioner given the enum value of the preconditioner type (can not...
#define IFPACK_CHK_ERR(ifpack_err)