Hi everybody,
I am having a curious issue over here. I implemented a solver for basic Sokes equation and wanted to play with preconditioners.
I know from theory that with an ideal preconditioner I get a system whose solution takes a number of GMRES steps independent of the grid, so I tried to implement this.
The main point of all the code is this:
1. linearSolver = new PETScKrylovSolver("gmres","hypre_amg");
[... stuff, including assembling the preconditioner P]
2. linearSolver->set_operators(A, P);
Now, with these two lines of code I get the expected result: my problem [I am using the cavity problem] is solved in about 26 iterations for systems ranging from ~7k to ~700k unknowns.
The curious effect is that if I replace "hypre_amg" with "petsc_amg" or "ilu", the solver takes forever or fails to converge within 10k iterations. The same happens if I don't set P as a preconditioner, of course.
I expected, in case of a custom preconditioner P set as in line 2, the parameter "hypre_amg" to affect the solution of the auxiliary system Pz = r, but this is not what is happening, for changing the preconditioner should give me more or less costly iterations, not more iterations.
What's going on here? What did I miss?
Thanks for help.
Massimiliano