45 #include "Epetra_MpiComm.h" 47 #include "Epetra_SerialComm.h" 49 #include "Epetra_CrsMatrix.h" 50 #include "Epetra_MultiVector.h" 51 #include "Epetra_LinearProblem.h" 52 #include "Galeri_Maps.h" 53 #include "Galeri_CrsMatrices.h" 54 #include "Teuchos_ParameterList.hpp" 55 #include "Teuchos_RefCountPtr.hpp" 60 int main(
int argc,
char *argv[])
64 MPI_Init(&argc,&argv);
65 Epetra_MpiComm Comm( MPI_COMM_WORLD );
67 Epetra_SerialComm Comm;
74 GaleriList.
set(
"n", nx * nx);
75 GaleriList.
set(
"nx", nx);
76 GaleriList.
set(
"ny", nx);
77 Teuchos::RefCountPtr<Epetra_Map> Map =
Teuchos::rcp( Galeri::CreateMap(
"Linear", Comm, GaleriList) );
78 Teuchos::RefCountPtr<Epetra_RowMatrix>
A =
Teuchos::rcp( Galeri::CreateCrsMatrix(
"Laplace2D", &*Map, GaleriList) );
92 std::string PrecType =
"ILU";
96 Teuchos::RefCountPtr<Ifpack_Preconditioner> Prec =
Teuchos::rcp( Factory.
Create(PrecType, &*
A, OverlapLevel) );
97 assert(Prec != Teuchos::null);
100 List.
set(
"fact: drop tolerance", 1e-9);
101 List.
set(
"fact: level-of-fill", 1);
105 List.
set(
"schwarz: combine mode",
"Add");
125 Epetra_Vector LHS(
A->OperatorDomainMap());
126 Epetra_Vector
RHS(
A->OperatorDomainMap());
137 Epetra_LinearProblem Problem(&*
A,&LHS,&
RHS);
143 Solver.SetAztecOption(AZ_solver,AZ_gmres);
144 Solver.SetAztecOption(AZ_output,32);
147 Solver.SetPrecOperator(&*Prec);
150 Solver.Iterate(1550,1e-8);
158 return(EXIT_SUCCESS);
int main(int argc, char *argv[])
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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)