<div class="gmail_quote">On Fri, Dec 3, 2010 at 21:09, Vijay S. Mahadevan <span dir="ltr">&lt;<a href="mailto:vijay.m@gmail.com">vijay.m@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":1j">Ah, I misunderstood your explanation earlier. If I do provide the<br>
restriction/prolongation along with a fine-grid shell matrix and opt<br>
to not use Galerkin MG, then how do I provide the coarse grid<br>
operators to petsc?</div></blockquote><div><br></div><div>PCMGSetResidual() and PCMGGetSmoother() followed by KSPSetOperators().</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":1j">I also just remembered from one of your earlier<br>
posts that you mentioned the use of non-Galerkin coarse operators<br>
requires a coarse mesh to be provided. </div></blockquote><div><br></div><div>No, this is not required. PCMG&#39;s interface is purely algebraic, you do not need to use DMMG or otherwise provide a &quot;mesh&quot;.  You have to provide coarse-level operators (as described above).  This is all in the users manual.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div id=":1j">
And I dont quite get what a matrix-free residual is.. Wouldn´t<br>
PCMGDefaultResidual compute the residual with just MatMult operation<br>
defined (b-Ax) for every level ? Why do I need a custom residual<br>
operator ?</div></blockquote></div><br><div>If you have wrapped your coarse-level operator in MatShell, then you can just pass that in and use PCMGDefaultResidual.  Also from the users manual:</div><div><br></div><div><div>
<i>The residual() function can be set to be PCMGDefaultResidual() if one’s operator is stored in a Mat format.</i></div><div><i>In certain circumstances, where it is much cheaper to calculate the residual directly, rather than through the</i></div>
<div><i>usual formula b − Ax, the user may wish to provide an alternative.</i></div></div><div><br></div><div>Jed</div>