Yes, it pulls the information from the DM. See src/ksp/pc/impls/mg/mg.c the 
function PCSetUp_MG.  Note this function has become horribly complex with 
people adding all kinds of crazy ways to set things up, and the code should be 
refactored to remove the complexity but anyways you'll see things like 
DMCoarsen(), DMCreateInterpolation() etc used to create what the MG algorithm 
needs.

  Barry


> On Feb 2, 2023, at 9:26 AM, Grosse-Bley, Paul 
> <[email protected]> wrote:
> 
> The documentation 
> <https://petsc.org/release/docs/manual/ksp/#multigrid-preconditioners> says 
> that
> 
> > The multigrid routines, which determine the solvers and 
> > interpolation/restriction operators that are used, are mandatory.
> 
> But using code that doesn't contain any multigrid-specific routines e.g. ex45 
> and running it with
> 
> -da_grid_x 129 -da_grid_y 129 -da_grid_z 129
> -pc_type mg
> -pc_mg_type multiplicative
> -pc_mg_cycle_type v
> -pc_mg_levels 5
> ...
> 
> seems to work fine and also not fall-back to algebraic multigrid/PCGAMG from 
> what I see with -log_view.
> 
> What interpolation/restriction operators are used by default with PCMG?
> Is it cleverly using the geometric information from DA?
> 
> Thanks,
> Paul
>  

Reply via email to