32 #include "Epetra_MpiComm.h" 34 #include "Epetra_SerialComm.h" 36 #include "Epetra_CrsMatrix.h" 37 #include "Epetra_MultiVector.h" 38 #include "Epetra_LinearProblem.h" 39 #include "Galeri_Maps.h" 40 #include "Galeri_CrsMatrices.h" 41 #include "Teuchos_ParameterList.hpp" 42 #include "Teuchos_RefCountPtr.hpp" 47 int main(
int argc,
char *argv[])
51 MPI_Init(&argc,&argv);
52 Epetra_MpiComm Comm( MPI_COMM_WORLD );
54 Epetra_SerialComm Comm;
57 Teuchos::ParameterList GaleriList;
61 GaleriList.set(
"n", nx * nx);
62 GaleriList.set(
"nx", nx);
63 GaleriList.set(
"ny", nx);
64 Teuchos::RefCountPtr<Epetra_Map> Map = Teuchos::rcp( Galeri::CreateMap64(
"Linear", Comm, GaleriList) );
65 Teuchos::RefCountPtr<Epetra_RowMatrix> A = Teuchos::rcp( Galeri::CreateCrsMatrix(
"Laplace2D", &*Map, GaleriList) );
71 Teuchos::ParameterList List;
79 std::string PrecType =
"ILU";
83 Teuchos::RefCountPtr<Ifpack_Preconditioner> Prec = Teuchos::rcp( Factory.
Create(PrecType, &*A, OverlapLevel) );
84 assert(Prec != Teuchos::null);
87 List.set(
"fact: drop tolerance", 1e-9);
88 List.set(
"fact: level-of-fill", 1);
92 List.set(
"schwarz: combine mode",
"Add");
112 Epetra_Vector LHS(A->OperatorDomainMap());
113 Epetra_Vector
RHS(A->OperatorDomainMap());
124 Epetra_LinearProblem Problem(&*A,&LHS,&
RHS);
130 Solver.SetAztecOption(AZ_solver,AZ_gmres);
131 Solver.SetAztecOption(AZ_output,32);
134 Solver.SetPrecOperator(&*Prec);
137 Solver.Iterate(1550,1e-8);
145 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)