[petsc-users] Multigrid with defect correction

Matthew Knepley knepley at gmail.com
Sat Feb 25 14:45:52 CST 2017


On Sat, Feb 25, 2017 at 2:21 PM, Matt Landreman <matt.landreman at gmail.com>
wrote:

> Thanks everyone for the help.
>
> On item 1 (using Amat different from Pmat with geometric multigrid), I
> tried Barry's suggestion but it did not seem to resolve the issue. For
> example, in ksp ex25.c, I tried adding the following lines after line 112:
>   if (J == jac) {
>
>     ierr = PetscPrintf(PETSC_COMM_WORLD,"Creating a new Amat\n");
>
>     ierr = DMCreateMatrix(da,&J);
>
>     ierr = KSPSetOperators(ksp,J,jac);
>
>   }
>   ierr = MatShift(J,1.0);
>
> This change should set Amat (J) to be different from Pmat (jac),
> (specifically Amat=identity matrix), so the solution from KSP should be
> completely different from the original ex25.c. But viewing the solution
> vector, the solution is unchanged. It seems PETSc is ignoring the Amat
> created in this approach.
>
> Matt K's suggestion of switching from KSP to SNES does work, allowing Amat
> to differ from Pmat on the finest multigrid level. (On coarser levels, it
> seems PETSc still forces Amat=Pmat on entry to computeMatrix).
>

You should not be using computeMatrix() anymore with SNES, which is why it
will work. You use the DM callback. See for DA SNES ex5,
or for Plex see SNES ex12.

  Thanks

     Matt


> On Jed's comment, the application I have in mind is indeed a
> convection-dominated equation (a steady linear 3D convection-diffusion
> equation with smoothly varying anisotropic coefficients and recirculating
> convection). Gamg and hypre-boomerAMG have been working on it ok if I
> discretize with low-order upwind differences in Pmat and use Amat=Pmat, but
> I'd like higher order accuracy. Using gmres with a higher-order
> discretization in Amat and low-order Pmat works ok, but the number of KSP
> iterations required gets large as the diffusion gets small compared to
> convection, even with -pc_type lu. So I'm working to see if geometric mg
> with defect correction at each level can do better.
>
> Thanks,
> Matt Landreman
>
>
>
>
> On Thu, Feb 23, 2017 at 5:23 PM, Jed Brown <jed at jedbrown.org> wrote:
>
>> Matt Landreman <matt.landreman at gmail.com> writes:
>> > 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?
>>
>> Note that defect correction is most commonly used for
>> transport-dominated processes for which the high order discretization is
>> not h-elliptic.  AMG heuristics are typically really bad for such
>> problems so stabilizing a smoother isn't really a relevant issue.  Also,
>> it is usually used for strongly nonlinear problems where AMG's setup
>> costs are likely overkill.  This is not to say that defect correction
>> AMG won't work, but there is reason to believe that it doesn't matter
>> for many important problems.
>>
>
>


-- 
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/20170225/a1b57dc3/attachment.html>


More information about the petsc-users mailing list