I'll add support for handling both A and M via Galerkin. It is easy to write
the code, picking a good simple API that doesn't break anything is more
difficult. I'm leaning to change PCMGSetGalerkin(PC,PetscBool) to
PCMGSetGalerkin(PC, PCMGGalerkinType) where
typedef enum { PC_MG_GALERKIN_BOTH,PC_MG_GALERKIN_PMAT,PC_MG_GALERKIN_MAT,
PC_MG_GALERKIN_NONE
} PCMGGalerkinType;
Barry
> On Jul 21, 2016, at 6:09 AM, Lawrence Mitchell
> <[email protected]> wrote:
>
>
>> On 21 Jul 2016, at 10:55, domenico lahaye <[email protected]> wrote:
>>
>> Apologies for being not sufficient clear in my previous message.
>>
>> I would like to be able to Galerkin coarsen A^h to obtain A^H
>> and to separately Galerkin coarsen M^h to obtain M^H.
>>
>> So, yes, the way in which I currently (partially) understand your
>> description of the new DMCreateMatrices would do the job.
>
> If you want to separately coarsen A and M via Galerkin, I think it will be
> easier to just change the code in PCSetUp_MG to handle the case where A and M
> are different on the coarse levels. Effectively you just need to replicate
> the code that computes the coarse grid "B" matrix to separately compute
> coarse grid A and B matrices and pass them in to KSPSetOperators.
>
> Cheers,
>
> Lawrence
>