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

Sylvain Barbot sylbar.vainbot at gmail.com
Fri Dec 3 14:25:58 CST 2010


Hi all,

Very interesting discussion. It would be great to have available a
simple multi-grid example using matrix-free methods. I think it would
greatly clarify the existing documentation about the multi-grid tools
in Petsc. I suggest showing a simple 1-D linear ODE solved with
multigrid, so that one can focus on the architecture. Existing
documentation is clear only retrospectively to most of us.

Best wishes,
Sylvain

2010/12/3 Jed Brown <jed at 59a2.org>:
> 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


More information about the petsc-users mailing list