<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">To read periodic meshes from GMSH, you need to use the option -dm_plex_gmsh_periodic and DMPlexCreateFromFile</div><div>See src/dm/impls/plex/examples/tests/ex1.c. An example runs</div><div><br></div><div>$ ./ex1 -filename ${PETSC_DIR}/share/petsc/datafiles/meshes/cube_periodic_bin.msh -dm_plex_gmsh_periodic -dm_view ::ascii_info_detail -interpolate -test_shape</div><div><br></div><div>generating periodic meshes in gmsh may be tricky, Lisandro for sure may advice.</div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">Il giorno mer 24 ott 2018 alle ore 13:51 Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Oct 24, 2018 at 6:29 AM Lawrence Mitchell <<a href="mailto:wence@gmx.li" target="_blank">wence@gmx.li</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Max,<br>
<br>
(I'm cc'ing in the petsc-users mailing list which may have more advice, if you are using PETSc you should definitely subscribe!<br>
<br>
> On 24 Oct 2018, at 09:27, Maximilian Hartig <<a href="mailto:imilian.hartig@gmail.com" target="_blank">imilian.hartig@gmail.com</a>> wrote:<br>
> <br>
> Hello Lawrence,<br>
> <br>
> sorry to message you out of the blue. My name is Max and I found your post on GitHub (<a href="https://github.com/firedrakeproject/firedrake/issues/1246" rel="noreferrer" target="_blank">https://github.com/firedrakeproject/firedrake/issues/1246</a> ) on DMPlex being able to read periodic gmsh files. I am currently trying to do just that (creating a periodic DMPlex mesh with gmsh) in the context of my PhD work. So far I haven’ t found any documentation on the periodic BC’s with DMPlex and gmsh in the official petsc documentation. <br>
> I was wondering whether you’d be so kind as to point me in a general direction concerning how to achieve this. You seem experienced in using petsc and I would greatly appreciate your help. <br>
<br>
<br>
I think the answer is "it depends". If you're just using DMPlex directly and all the of the functionality with PetscDS, then I /think/ that reading periodic meshes via gmsh (assuming you're using the appropriate gmsh mesh format [v2]) "just works".<br></blockquote><div><br></div><div>There are two phases here: topological and geometric. DMPlex represents the periodic topological entity directly. For example, a circle is just a segment with one end hooked to the other. Vertices are not duplicated, or mapped to each other. This makes topology simple and easy to implement. However, then geometry is more complicated. What Plex does is allow coordinates to be represented by a discontinuous field taking values on cells, in addition to vertices. In our circle example, each cells near the cut will have 2 coordinates, one for each vertex, but they will not agree across the cut. If you define a periodic domain, then Plex can construct this coordinate field automatically using DMPlexLocalize(). These DG coordinates are then used by the integration routines.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
>From my side, the issue is to do with mapping that coordinate field into one that I understand (within Firedrake). You may not have this problem.<br></blockquote><div><br></div><div>Firedrake uses its own coordinate mapping and integration routines, so they must manage the second part independently. I hope to get change this slightly soon by making the Firedrake representation a DMField, so that it looks the same to Plex.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks,<br>
<br>
Lawrence</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-3445011052547355922gmail_signature" data-smartmail="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>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Stefano</div>