[petsc-users] DMPlex box mesh periodicity bug (?)

Matthew Knepley knepley at gmail.com
Mon Aug 2 08:48:38 CDT 2021


On Sat, Jul 31, 2021 at 6:01 AM Thibault Bridel-Bertomeu <
thibault.bridelbertomeu at gmail.com> wrote:

> Dear all,
>
> I have noticed what I think is a bug with a 3D DMPlex box mesh with
> periodic boundaries.
> When I project a function onto it, it behaves as if the last row of cells
> in X and in Y direction do not have the right coordinates.
>
> I attach to this email a minimal example that reproduces the bug (files
> mwe_periodic_3d.F90, wrapper_petsc.c, wrapper_petsc.h90, makefile), as well
> as the output of this code (initmesh.vtu for an output of the DM,
> solution.vtu for an output of the data projected onto the mesh). There is
> also a screenshot of what's going on.
> If one considers the function I project onto the mesh, what should
> normally happen is that there is a "hole" is the density field around the
> x=0, y=0 region, the rest being equal to one.
>
> I hope it is just a mishandling from my end !!
>

Hi Thibault,

1) The main thing happening here is that visualization has some problems
for completely periodic things. It is on my list to fix, but below other
things.

2) Second, it looks like you need to localize coordinates again after
creating ghost cells. Everything is in the right order if you use the
command line to create
    the mesh. I have attached a C example where I do this. In your code, I
think just adding Localize again will work.

In my example, you can see 2D as well as 3D, and change from non-periodic
to periodic to see what is happening.

  Thanks,

     Matt


> Thank you in advance for your help,
>
> Cheers,
>
> Thibault
>
>

-- 
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/20210802/8c01b1d2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: thibault.c
Type: application/octet-stream
Size: 2647 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210802/8c01b1d2/attachment.obj>


More information about the petsc-users mailing list