[petsc-users] Multigrid with defect correction

Matthew Knepley knepley at gmail.com
Thu Feb 23 09:41:04 CST 2017


On Wed, Feb 22, 2017 at 4:53 AM, Matt Landreman <matt.landreman at gmail.com>
wrote:

> Hi, PETSc developers,
>
> 1. Consider solving a linear problem with -pc_type mg, assembling the
> matrix using KSPSetComputeOperators(ksp,ComputeMatrix,&user) and
> MatSetValuesStencil as in ksp ex25.c.  I’d like Pmat to be different than
> Amat (a stable low-order discretization and a high-order discretization,
> respectively.) However the two Mat arguments that PETSc passes to
> ComputeMatrix appear to be the same object, so Pmat and Amat are forced to
> be the same.  (For example in ex25, J==jac). How do I allow Amat and Pmat
> to differ?
>

You are correct that this is a shortcoming of the interface. We really
should rework it so that (possibly) two operators are constructed. I think
the
right way to do this would end up having most of the DM infrastructure
duplicated for the second matrix, since the DM is holding the construction
routine.

You can see my example of this idea in PetscDS, which holds two sets of
creation routines, one for the Jacobian and one for its preconditioning
matrix. However
this is not yet universally agreed in PETSc. For the time being, I believe
switching to the nonlinear interface in SNES will give you what you want.


> 2. I suppose if the above issue were resolved, the resulting gmres/mg
> iteration would amount to doing defect correction on only the finest grid.
> Another defect correction method is to use a different Mat for smoothing
> and residual computation at every level. (Stable low-order for smoothing,
> high-order for residual.) This latter approach is recommended on page 103
> of Brandt’s multigrid guide (http://www.wisdom.weizmann.
> ac.il/~achi/classics.pdf). What would be the best way to do this second
> kind of defect correction in PETSc mg? Perhaps loop over every multigrid
> level and call PCMGSetResidual(pc,l,PCMGResidualDefault,Amat) on each
> level, after calling ComputeMatrix to build the appropriately-sized Amat?
>

I do not understand the point here. If you could indeed construct a P and A
on each level, then you can do exactly what you want. In fact,
this is just Newton with KSPPREONLY, or preconditioned Richardson (I
think). It should be easy to build whatever you want since each
smoother can be independently configured with options. Can you write
exactly what you want in algebraic terms?


> 3. Is it at all sensible to do this second kind of defect correction with
> _algebraic_ multigrid? Perhaps Amat for each level could be formed from the
> high-order matrix at the fine level by the Galerkin operator R A P, after
> getting all the restriction matrices created by gamg for Pmat?
>

Mark responded.

  Thanks,

     Matt


> Thanks,
> Matt Landreman
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170223/b4b5f104/attachment.html>


More information about the petsc-users mailing list