<div dir="ltr"><div dir="ltr">On Mon, Aug 2, 2021 at 4:23 PM 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">Hi Matt,<div><br></div><div>Thank you for taking the time to take a look  !</div><div><br></div><div>1) Yea ... I know most visualization softwares and most storage formats do not like periodicity (a.k.a. infinity) ... but fo CFD-research it's a great tool so we keep trying ... x) The thing that surprised me is that my mwe works perfectly well in 2D, and not in 3D : that's why I ventured to call it a bug !</div><div><br></div><div>2) Hmm I tried adding a "DMLocalizeCoordinates" after the "DMPlexConstructGhostCells" but it does not change anything, the result is still exactly the same as I showed above.</div></div></blockquote><div><br></div><div>Hmm, I will try it. It should error telling you that VTK cannot handle meshes with localized coordinates, so something is going wrong there.</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>As for your code, it compiles fine and I can execute it as well, thanks ! However ...</div><div>1) when I run it in 2D and ask for the HDF5 output, and then run the petsc_gen_xdmf.py script, I get the attached result (sol_2D.png) : it seems either Paraview cannot handle what's in the HDF file or the HDF file does not contain something consistent,</div></div></blockquote><div><br></div><div>This is exactly what I get. Something is wrong with the periodic cut when I have a double point. If you use</div><div><br></div><div>  -dm_plex_box_bd periodic,none</div><div><br></div><div>it looks fine. This is the bug with periodic visualization that I was talking about.</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>2) when I run it in 3D and ask for the HDF5 output + run petsc_gen_xdmf.py I can see ... nothing : paraview does not show anything when I try to open the XDMF file, although it seems syntaxically correct (the HDF file as well)</div></div></blockquote><div><br></div><div>Yes, Paraview misunderstands the mesh connections, so I must be telling it something wrong with the periodic cut. You can see that each periodic dimension</div><div>vanishes from the display, but all the questions I ask it in tests are correct.</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>3) when I run it in 3D and ask for VTU output, I get exactly the same thing as what I got with my F90 program (see sol_3D.png attached) - my command line is <span style="font-variant-ligatures:no-common-ligatures;background-color:rgb(252,238,207);color:rgb(0,0,0);font-family:Menlo;font-size:11px">./thibault -dm_plex_dim 3 -dm_plex_simplex 0 -dm_plex_box_faces 16,16,16 -dm_plex_box_lower -5,-5,-5 -dm_plex_box_upper 5,5,5 -dm_plex_box_bd periodic,periodic,periodic -dm_plex_create_fv_ghost_cells -dm_plex_periodic_cut -vec_view vtk:sol.vtu</span></div></div></blockquote><div><br></div><div>Yes, VTU output does not work at all with periodicity. It was only really intended to work with DMDA. I do everything with HDF5 now since it can handle</div><div>multiple meshes, etc.</div><div><br></div><div>I think the right thing to do is fix the "periodic cut" support for multiply periodic things, and for 3D.</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>Does your piece of code yields different results on your end ?</div><div><br></div><div>(P.S. I am using the main branch, commit id ae6adb75dd).</div><div><br></div><div>Thank you very much for your support !!</div><div><br></div><div>Thibault</div>





<div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 2 août 2021 à 15:48, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> a écrit :<br></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 dir="ltr">On Sat, Jul 31, 2021 at 6:01 AM Thibault Bridel-Bertomeu <<a href="mailto:thibault.bridelbertomeu@gmail.com" target="_blank">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"><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>
</blockquote></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>