[petsc-users] multigrid preconditioning and adaptivity

Lukasz Kaczmarczyk Lukasz.Kaczmarczyk at glasgow.ac.uk
Mon Mar 7 10:28:20 CST 2016


Many thanks all for help. I started to implement function for DM.

I understand that minimal implementation is that for the DM i need to have, is to have  DMCoarsen and in each level for all DMs, set operators
DMKSPSetComputeOperators and DMCreateInterpolation. Matrix matrix free P from DMCreateInterpolation have to have operators for mult and mult_traspose. Is that is all?


Kind regards,
Lukasz



On 7 Mar 2016, at 15:55, Mark Adams <mfadams at lbl.gov<mailto:mfadams at lbl.gov>> wrote:

You can just set the coarse grid matrix/operator instead of using Galerkin.  If you have a shell (matrix free) P then you will need to create and set this yourself.  Our Galerkin requires a matrix P.

On Mon, Mar 7, 2016 at 9:32 AM, Lukasz Kaczmarczyk <Lukasz.Kaczmarczyk at glasgow.ac.uk<mailto:Lukasz.Kaczmarczyk at glasgow.ac.uk>> wrote:

> On 7 Mar 2016, at 14:21, Lawrence Mitchell <lawrence.mitchell at imperial.ac.uk<mailto:lawrence.mitchell at imperial.ac.uk>> wrote:
>
> On 07/03/16 14:16, Lukasz Kaczmarczyk wrote:
>>
>>> On 7 Mar 2016, at 13:50, Matthew Knepley <knepley at gmail.com<mailto:knepley at gmail.com>
>>> <mailto:knepley at gmail.com<mailto:knepley at gmail.com>>> wrote:
>>>
>>> On Mon, Mar 7, 2016 at 6:58 AM, Lukasz Kaczmarczyk
>>> <Lukasz.Kaczmarczyk at glasgow.ac.uk<mailto:Lukasz.Kaczmarczyk at glasgow.ac.uk>
>>> <mailto:Lukasz.Kaczmarczyk at glasgow.ac.uk<mailto:Lukasz.Kaczmarczyk at glasgow.ac.uk>>> wrote:
>>>
>>>    Hello,
>>>
>>>    I run multi-grid solver, with adaptivity, works well, however It
>>>    is some space for improving efficiency. I using hierarchical
>>>    approximation basis, for which
>>>    construction of interpolation operators is simple, it is simple
>>>    injection.
>>>
>>>    After each refinement level (increase of order of approximation
>>>    on some element) I rebuild multigrid pre-conditioner with
>>>    additional level. It is a way to add dynamically new levels
>>>    without need of rebuilding whole MG pre-conditioner.
>>>
>>>
>>> That does not currently exist, however it would not be hard to add,
>>> since the MG structure jsut consists of
>>> arrays of pointers.
>>>
>>>
>>>    Looking at execution profile I noticed that 50%-60% of time is
>>>    spent on MatPtAP function during PCSetUP stage.
>>>
>>>
>>> Which means you are using a Galerkin projection to define the coarse
>>> operator. Do you have a direct way of defining
>>> this operator (rediscretization)?
>>
>> Matt,
>>
>>
>> Thanks for swift response. You are right, I using Galerkin projection.
>>
>> Yes, I have a way to get directly coarse operator, it is some sub
>> matrix of whole matrix. I taking advantage here form hierarchical
>> approximation.
>>
>> I could reimplement PCSetUp_MG to set the MG structure directly, but
>> this probably not good approach, since my implementation which will
>> work with current petsc version could be incompatible which  future
>> changes in native MG data structures. The alternative option is to
>> hack MatPtAP itself, and until petsc MG will use this, whatever
>> changes you will make in MG in the future my code will work.
>
> Why not provide a shell DM to the KSP that knows how to compute the
> operators (and how to refine/coarsen and therefore
> restrict/interpolate).  Then there's no need to use Galerkin coarse
> grid operators, and the KSP will just call back to your code to create
> the appropriate matrices.

Hello Lawrence,

Thanks, it is good advice.
I have already my DM shell, however I have not looked yet how make it in the context of MG. Now is probably time to do that.

DM shell
http://userweb.eng.gla.ac.uk/lukasz.kaczmarczyk/MoFem/html/group__dm.html


Regards,
Lukasz


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160307/1ce461da/attachment.html>


More information about the petsc-users mailing list