On Feb 17, 2012, at 2:38 PM, Jed Brown wrote:

> On Fri, Feb 17, 2012 at 14:09, <coco at dmi.unict.it> wrote:
> Indeed I would like to solve the whole linear system by a multigrid approach 
> and not by a lu factorization. Therefore I would like to use -ksp_type 
> richardson -pc_type mg.
> In this case, the preconditioned problem P^(-1) (f-A x^n) is solved exactly 
> or it performs just a V-cycle iteration? In both cases, since I am using a 
> one-grid multigrid (just for debugging), it should anyway provide the exact 
> solution at the first iteration, but it is not so.
> 
> -pc_type mg with one level just applies a normal smoother. I've sometimes 
> thought it should do a coarse-level solve instead, but I haven't messed with 
> it. Barry, why doesn't it do a direct solve?

    
1) Because MG is an accelerator of the basic smoother, MG is not a deccelerator 
of a direct solver.  That is the action of adding a coarser level is suppose to 
improve the convergence of the solver.

2) Because if you used a direct solver and the user switched from one to two 
levels they would be dismayed at the worsening of the convergence. If the user 
ran a large problem on one level it would run out of memory.

3) I don't think there is really a "correct" abstract or practical answer to 
which it should be (hence my two snide answers above)   I am happy with the 
current default

    
> 
> In general -pc_type mg does one multigrid cycle (usually a V or W cycle). If 
> you want to use multiple iterations, you can
> 
> -pc_type ksp -ksp_pc_type mg
> 
> which would use the default KSP (GMRES) as an iteration, preconditioned by 
> multigrid. The "outer" problem will see the result of this converged 
> iterative solve.

   You can use -pc_mg_multiplicative_cycles 2  to use 2 V or W cycles as the 
preconditioner etc.


    Barry



Reply via email to