<div dir="ltr"><div dir="ltr">On Sat, Jul 31, 2021 at 6:01 AM Thibault Bridel-Bertomeu <<a href="mailto:thibault.bridelbertomeu@gmail.com">thibault.bridelbertomeu@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear all, <div><br></div><div>I have noticed what I think is a bug with a 3D DMPlex box mesh with periodic boundaries.</div><div>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.</div><div><br></div><div>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.</div><div>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.</div><div><br></div><div>I hope it is just a mishandling from my end !!</div></div></blockquote><div><br></div><div>Hi Thibault,</div><div><br></div><div>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.</div><div><br></div><div>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</div><div> the mesh. I have attached a C example where I do this. In your code, I think just adding Localize again will work.</div><div><br></div><div>In my example, you can see 2D as well as 3D, and change from non-periodic to periodic to see what is happening.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thank you in advance for your help, </div><div><br></div><div>Cheers, </div><div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><div><div><div><div>Thibault </div></div></div></div></div><div><br></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>