[petsc-users] Is PCMG a generic PC object ?

Jed Brown jed at 59A2.org
Fri Dec 3 14:16:01 CST 2010


On Fri, Dec 3, 2010 at 21:09, Vijay S. Mahadevan <vijay.m at gmail.com> wrote:

> Ah, I misunderstood your explanation earlier. If I do provide the
> restriction/prolongation along with a fine-grid shell matrix and opt
> to not use Galerkin MG, then how do I provide the coarse grid
> operators to petsc?
>

PCMGSetResidual() and PCMGGetSmoother() followed by KSPSetOperators().


> I also just remembered from one of your earlier
> posts that you mentioned the use of non-Galerkin coarse operators
> requires a coarse mesh to be provided.
>

No, this is not required. PCMG's interface is purely algebraic, you do not
need to use DMMG or otherwise provide a "mesh".  You have to provide
coarse-level operators (as described above).  This is all in the users
manual.


> And I dont quite get what a matrix-free residual is.. Wouldn´t
> PCMGDefaultResidual compute the residual with just MatMult operation
> defined (b-Ax) for every level ? Why do I need a custom residual
> operator ?
>

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:

*The residual() function can be set to be PCMGDefaultResidual() if one’s
operator is stored in a Mat format.*
*In certain circumstances, where it is much cheaper to calculate the
residual directly, rather than through the*
*usual formula b − Ax, the user may wish to provide an alternative.*

Jed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101203/d4f48c99/attachment.htm>


More information about the petsc-users mailing list