32 #include "Epetra_MpiComm.h" 34 #include "Epetra_SerialComm.h" 36 #include "Epetra_CrsMatrix.h" 37 #include "Epetra_MultiVector.h" 38 #include "Epetra_Map.h" 39 #include "Epetra_BlockMap.h" 40 #include "Epetra_LinearProblem.h" 41 #include "Galeri_Maps.h" 42 #include "Galeri_CrsMatrices.h" 43 #include "Teuchos_ParameterList.hpp" 44 #include "Teuchos_RefCountPtr.hpp" 48 int main(
int argc,
char *argv[])
53 MPI_Init(&argc,&argv);
59 Teuchos::ParameterList GaleriList;
63 GaleriList.set(
"nx", nx);
64 GaleriList.set(
"ny", nx * Comm.
NumProc());
65 GaleriList.set(
"mx", 1);
66 GaleriList.set(
"my", Comm.
NumProc());
67 Teuchos::RefCountPtr<Epetra_Map> Map = Teuchos::rcp( Galeri::CreateMap64(
"Cartesian2D", Comm, GaleriList) );
68 Teuchos::RefCountPtr<Epetra_RowMatrix> A = Teuchos::rcp( Galeri::CreateCrsMatrix(
"Laplace2D", &*Map, GaleriList) );
74 Teuchos::ParameterList List;
82 std::string PrecType =
"Amesos";
86 Teuchos::RefCountPtr<Ifpack_Preconditioner> Prec = Teuchos::rcp( Factory.
Create(PrecType, &*A, OverlapLevel) );
87 assert(Prec != Teuchos::null);
94 List.set(
"amesos: solver type",
"Amesos_Klu");
135 Solver.SetAztecOption(AZ_solver,AZ_gmres);
136 Solver.SetAztecOption(AZ_output,32);
139 Solver.SetPrecOperator(&*Prec);
144 Solver.Iterate(1550,1e-8);
150 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)