Sounds correct.

> On Apr 10, 2025, at 2:04 PM, Anton Popov <po...@uni-mainz.de> wrote:
> 
> 
> Hi guys,
> I have a custom multigrid preconditioner that uses Galerkin coarsening for 
> the staggered grid finite difference. Now I want to replace a few top level 
> operators with the matrix-free shell matrices.
> Here is my plan:
> 1. Set PC_MG_GALERKIN_NONE
> 2. Call PCMGSetRestriction and PCMGSetInterpolation on all levels as I do it 
> already
> 3. Use a combination of PCMGGetSmoother and KSPSetOperators to communicate my 
> operators with PCMG
>     a. On the top levels just set the shell matrices minimalistically 
> equipped with MATOP_GET_DIAGONAL and MATOP_MULT.
>     b. On the bottom levels generate the operators by explicitly calling 
> MatMatMatMult (R is not the same as P in my case).
> 
>         Use MAT_INITIAL_MATRIX for the first time 
>         Use MAT_REUSE_MATRIX for the subsequent calls
> 
> Is this a proper way to do it, or there is something wrong? 
> If I want the restriction/interpolation matrices to be matrix-free on the top 
> levels as well, I would need to set MATOP_MULT_ADD for them. Is this enough, 
> or do I need something else?
> Thanks!
> Anton
> 

Reply via email to