70bool Test(
const Teuchos::RefCountPtr<Epetra_RowMatrix>& Matrix, Teuchos::ParameterList& List)
74 bool UseTranspose =
false;
82 Matrix->Multiply(UseTranspose,LHSexact,
RHS);
86 Teuchos::RefCountPtr<T> Prec;
88 Prec = Teuchos::rcp(
new T(&*Matrix) );
89 assert(Prec != Teuchos::null);
96 AztecOO AztecOOSolver(Problem);
99 AztecOOSolver.SetAztecOption(AZ_solver,AZ_gmres);
100 AztecOOSolver.SetAztecOption(AZ_output,32);
102 AztecOOSolver.SetPrecOperator(&*Prec);
106 AztecOOSolver.Iterate(1550,1e-8);
111 LHS.
Update(1.0,LHSexact,-1.0);
114 cout <<
"Norm[" << i <<
"] = " << Norm[i] << endl;
122int main(
int argc,
char *argv[])
126 MPI_Init(&argc,&argv);
134 Teuchos::ParameterList GaleriList;
136 GaleriList.set(
"n", nx * nx);
137 GaleriList.set(
"nx", nx);
138 GaleriList.set(
"ny", nx);
139 Teuchos::RefCountPtr<Epetra_Map> Map = Teuchos::rcp( Galeri::CreateMap(
"Linear", Comm, GaleriList) );
140 Teuchos::RefCountPtr<Epetra_RowMatrix> Matrix = Teuchos::rcp( Galeri::CreateCrsMatrix(
"Laplace2D", &*Map, GaleriList) );
142 Teuchos::ParameterList List, DefaultList;
145 int TestPassed =
true;
147 if (!Test<Ifpack_Chebyshev>(Matrix,List))
152 List.set(
"polynomial: degree",3);
153 if (!Test<Ifpack_Polynomial>(Matrix,List))
159 List.set(
"krylov: tolerance", 1e-14);
160 List.set(
"krylov: iterations", 100);
161 List.set(
"krylov: preconditioner", 2);
162 List.set(
"krylov: block size", 9);
163 List.set(
"krylov: number of sweeps", 2);
164 if (!Test<Ifpack_Krylov>(Matrix,List))
169 if (!
Test< Ifpack_AdditiveSchwarz<Ifpack_Krylov> >(Matrix,List)) {
174 if (!Test<Ifpack_Amesos>(Matrix,List))
188 List.set(
"relaxation: type",
"Gauss-Seidel");
189 if (!Test<Ifpack_PointRelaxation>(Matrix,List)) {
195 List.set(
"relaxation: type",
"symmetric Gauss-Seidel");
196 List.set(
"relaxation: sweeps", 5);
197 List.set(
"partitioner: local parts", 128);
198 List.set(
"partitioner: type",
"linear");
199 if (!
Test<Ifpack_BlockRelaxation<Ifpack_DenseContainer> >(Matrix,List)) {
205 List.set(
"relaxation: type",
"symmetric Gauss-Seidel");
206 List.set(
"partitioner: local parts", 128);
207 List.set(
"partitioner: type",
"linear");
214 List.set(
"relaxation: type",
"symmetric Gauss-Seidel");
215 List.set(
"partitioner: local parts", 128);
216 List.set(
"partitioner: type",
"linear");
221 cerr <<
"Test `TestAll.exe' FAILED!" << endl;
229 cout <<
"Test `TestAll.exe' passed!" << endl;
231 return(EXIT_SUCCESS);
int main(int argc, char *argv[])
bool Test(const Teuchos::RefCountPtr< Epetra_RowMatrix > &Matrix, Teuchos::ParameterList &List)