[petsc-users] DMPlex Interpolation

Mike Michell mi.mike1021 at gmail.com
Sun Aug 28 07:51:26 CDT 2022

Hi, thank you for the reply.

I was able to manage mapping from cell-center to vertex. Basically, in
Fortran, it seems DMCreateInterpolation() requires the optional scaling
vector as a mandatory argument, which is strange.

My dmplex has zero overlap layer over the procs, and there is no ghost cell
inside physical boundary. In this case, it seems mapping between cell
center to vertex returns zero (in case the global cell vector initialized
to zero) value at the nodes, which are located at physical boundary. To
manage this problem, is it mandatory to have ghost cells. Is this correct

Also, my mapping accuracy itself seems to be improved. For simple test,
cell-center's x-coordinate value of each cell mapped to node and printed to
the vertex field as .vtu format, and the mapped x-vertex-coordinate is
quite different with the actual nodal coordinate values what PETSc
intrinsically provides through DMGetCoordinatesLocal(). I believe I am
doing something wrong, probably arguments in PetscFECreateLagrange() can
improve the mapping accuracy in finite-element space?


> On Thu, Aug 25, 2022 at 7:12 PM Mike Michell <mi.mike1021 at gmail.com>
> wrote:
>> Hi, this is a duplication of
>> https://lists.mcs.anl.gov/pipermail/petsc-users/2022-August/046746.html
>> for in-depth question.
>> I wrote a short code as attached to test interpolation between two DMPlex
>> objects. Goal is to map solution field defined on cell-centroid(DMPlex-1)
>> into vertex(DMPlex-2) field or vice versa.
>> Basically, DMCreateInterpolation() fails in the example code and it was
>> not allowed to get useful error messages. The DMPlex is created by loading
>> a 2D square box in Gmsh. Can I get some comments on that?
> Sure, I am looking at it.
>   Thanks,
>      Matt
>> Thanks,
> --
> 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/20220828/1c0a32f1/attachment.html>

More information about the petsc-users mailing list