[petsc-users] Is PCMG a generic PC object ?
Vijay S. Mahadevan
vijay.m at gmail.com
Tue Dec 7 00:42:52 CST 2010
Jed,
I stumbled onto an issue and it is probably my lack of complete
understanding still. I'll try to be as clear as possible but if it is
unclear, do let me know.
When I use PCMG as a preconditioner to solve a fine grid system using
a linear solver, how do I set the interpolation to the linear system
being solved. i.e., my preconditioner starts at max_levels and
hierarchy proceeds to 0 (coarsest) and my linear system is technically
at max_levels+1. I have a vector length incompatibility since I cannot
seem to set the prolongation to go from max_levels to max_levels+1,
where the linear solver subspace resides. I am probably not setting
the right projection matrices at the right levels but it is slightly
confusing since the coarsest level does not take any projection
matrices. Hence my question is, when PCMG proceeds with the richardson
iteration at every linear iteration on finest grid problem (with say
FGMRES), how does the action of the preconditioner return a vector of
right length ?
I thought of adding the original fine grid problem to the PCMG levels
(now max_levels=max_levels+1) but this by philosophy uses PCMG itself
as a solver. Does it not ? Or did I misunderstand and make a wrong
assumption here ?
I've been stuck on this for a while and looking at DMMG implementation
didn't help with my problem either. Any help is much appreciated.
Vijay
On Fri, Dec 3, 2010 at 2:37 PM, Vijay S. Mahadevan <vijay.m at gmail.com> wrote:
> The custom residual makes sense now. I can find the residual itself in
> the same way my matrix application works and this should result in
> some savings..
>
> Jed, thanks a ton for these detailed explanations. I think I
> understand enough to get going with this. If I hit a roadblock, I will
> post a question here. Thanks and have a great day.
>
> Vijay
>
> On Fri, Dec 3, 2010 at 2:16 PM, Jed Brown <jed at 59a2.org> wrote:
>> 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