<div class="gmail_quote">On Fri, Feb 17, 2012 at 14:09, <span dir="ltr"><<a href="mailto:coco@dmi.unict.it">coco@dmi.unict.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":1cq">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.<br>
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.</div>
</blockquote></div><br><div>-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?</div>
<div><br></div><div>In general -pc_type mg does one multigrid cycle (usually a V or W cycle). If you want to use multiple iterations, you can</div><div><br></div><div>-pc_type ksp -ksp_pc_type mg</div><div><br></div><div>
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.</div>