[petsc-users] DMPlex Interpolation

Matthew Knepley knepley at gmail.com
Mon Aug 29 12:58:07 CDT 2022


On Mon, Aug 29, 2022 at 10:22 AM Lawrence Mitchell <wence at gmx.li> wrote:

> On Mon, 29 Aug 2022 at 14:55, Matthew Knepley <knepley at gmail.com> wrote:
> >
> > On Sun, Aug 28, 2022 at 7:17 PM Matthew Knepley <knepley at gmail.com>
> wrote:
> >>
> >> On Sun, Aug 28, 2022 at 5:36 PM Mike Michell <mi.mike1021 at gmail.com>
> wrote:
> >>>
> >>> Thank you for the reply.
> >>>
> >>> I think it can be more helpful for me if the attached sample code
> (DMInterpolation_Mod.tar) could be checked by you.
> >>
> >>
> >> Okay, you are right. I will run it tomorrow.
> >
> >
> > The problem was somewhat conceptual. When you are restricting state,
> meaning a function you want to use directly, rather than
> > residuals, meaning some average or integral, you want to preserve scale.
> This is what the 'vscale' vector is for. I added the
> > VecPointwiseMult to your code (attached) to do this. I also changed to a
> more general mehs creation. To get your run, use
>
> The right answer is to use DMCreateInjection
> (https://petsc.org/release/docs/manualpages/DM/DMCreateInjection.html)
> to move fine grid state to coarse grid state (rather than
> DMCreateInterpolation and then VecPointwiseMult, which doesn't work
> for most discretisations).
>
> Matt: the interface to DMCreateInjection is now correct (it returns a
> Mat, rather than a VecScatter) so DMPlexComputeInjectorFEM
> (
> https://petsc.org/release/docs/manualpages/DMPLEX/DMPlexComputeInjectorFEM.html
> )
> should be updated to take advantage.
>

I am not sure Injection is going to "do the right thing" when you move
between spaces. At least my memory of the implementation
was that it just did local interpolation, which is not right when injecting
P0 into P1.

  Thanks,

      Matt


> Lawrence
>

-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220829/367e524d/attachment.html>


More information about the petsc-users mailing list