<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Thank you for the explanation. My intent is to define periodicity from gmsh. With your tip I managed to do that!
<div class=""><br class="">
</div>
<div class="">-artur palha<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 12 Dec 2018, at 16:24, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" class="">stefano.zampini@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class=""><br class="">
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="">Il giorno mer 12 dic 2018 alle ore 17:45 Artur Palha Da Silva Clérigo - LR <<a href="mailto:A.PalhaDaSilvaClerigo@tudelft.nl" class="">A.PalhaDaSilvaClerigo@tudelft.nl</a>> ha scritto:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;" class=""><br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 12 Dec 2018, at 15:26, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" target="_blank" class="">stefano.zampini@gmail.com</a>> wrote:</div>
<br class="gmail-m_-6105557319661554426Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">What do you mean by "I always get the first numbering”?</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">I mean that if I use as input a periodic and a non-periodic mesh I get the following numbering in both cases:</div>
<div class=""><br class="">
</div>
<div class="">
<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 class="">
<div class="">
<div class="">
<div dir="ltr" class="">
<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 class="">
<div class="">1 3 5</div>
<div class="">X-------------X-------------X</div>
<div class="">| | |</div>
<div class="">| | |</div>
<div class="">| | |<br class="">
<div class="">X-------------X-------------X</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</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 class="">
<div class="">
<div class="">
<div dir="ltr" class="">
<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 class="">
<div class="">
<div class="">0 2 4</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
<div class="">That is, the numbering of the degrees of freedom is ignoring the periodicity in the mesh file.</div>
<div class=""><br class="">
</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="">I understand you are using GMSH right? To have PETSc read the periodic section of the .msh file, you need to pass -dm_plex_gmsh_periodic</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">I am not doing that. For an executable I see that you can do this by passing the -dm_plex_gmsh_periodic switch. Is there any way of doing that? For example using PetscOptionsSetValue? I ask this because I am using petsc4py so I do not see how
to pass the -dm_plex_gmsh_periodic switch in python.</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">$ python your_petsc_based.py -dm_plex_gmsh_periodic</div>
<div class=""><br class="">
</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;" class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="">Note that DMLocalizeCoordinates will localize coordinates ONLY if you use DMSetPerioidicity(), which is done in the GMSH reader</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Could you point me to an example of this? I do not see how to use DMSetPeriodicity() for a general domain.</div>
<div class=""><br class="">
</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">periodicity is a horrible beast. I would not recommend playing with it. They way it is done in DMPlex, is to have a coordinate section with dofs not only at mesgh vertices, but also located at selected cells (the cells that touch the periodic
boundary).</div>
<div class="">DMSetPeriodicity is a convenient API to tell PETSc that the mesh has some periodicity in it, so that PETSc can take the correct decision when it comes to do mesh refinement for examples</div>
<div class="">However, it is responsibility of the user to construct the proper localized coordinates, unless you have a simple mesh like the BoxMesh constructed with DMPlexCreateBoxMesh.</div>
<div class=""><br class="">
</div>
<div class="">As I said, all of this is done automatically when you load a periodic mesh from GMSH</div>
<div class=""> </div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;" class="">
<div class="">
<div class=""></div>
<div class="">Thank you.</div>
<div class=""><br class="">
</div>
<div class="">-artur palha</div>
<br class="">
<blockquote type="cite" class="">
<div class=""><br class="">
<div class="gmail_quote">
<div dir="ltr" class="">Il giorno mer 12 dic 2018 alle ore 17:17 Artur Palha Da Silva Clérigo - LR via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank" class="">petsc-users@mcs.anl.gov</a>> ha scritto:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class=""><br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 12 Dec 2018, at 15:14, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> wrote:</div>
<br class="gmail-m_-6105557319661554426gmail-m_8585104034508813738Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="gmail_quote">
<div dir="ltr" class="">On Wed, Dec 12, 2018 at 9:12 AM Artur Palha Da Silva Clérigo - LR <<a href="mailto:A.PalhaDaSilvaClerigo@tudelft.nl" target="_blank" class="">A.PalhaDaSilvaClerigo@tudelft.nl</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="">Dear Matt,
<div class=""><br class="">
</div>
<div class="">Thank you for your quick reply. As for your question: "why would there be a difference? They should be numbered in the same way.”</div>
<div class=""><br class="">
</div>
<div class="">I see the degrees of freedom living on the periodic domain as the ones living at boundaries between interior elements. This is what I expect for non-periodic domain for nodal scalar field:</div>
<div class=""><br class="">
</div>
<div class="">Non-periodic:</div>
<div class=""><br class="">
</div>
<div class="">1 3 5</div>
<div class="">X-------------X-------------X</div>
<div class="">| | |</div>
<div class="">| | |</div>
<div class="">| | |<br class="">
<div class="">X-------------X-------------X</div>
<div class="">0 2 4</div>
<div class=""><br class="">
</div>
<div class="">Periodic (vertical boundaries, topologically, the domain is a cylinder)</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">1 3 1</div>
<div class="">X-------------X-------------X</div>
<div class="">| | |</div>
<div class="">| | |</div>
<div class="">| | |<br class="">
<div class="">X-------------X-------------X</div>
<div class="">0 2 0</div>
</div>
</div>
<div class=""><br class="">
</div>
<div class="">This is not the expected behaviour?</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">What I mean is that each vertex in the periodic domain gets 1 dof. Same procedure as non-periodic.</div>
<div class="">We do not duplicate vertices or anything like that.</div>
</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Yes, I agree. That happens yes. What I meant was that for both the periodic and non-periodic case I always get the first numbering. Is this because I miss DMLocalizeCoordinates?</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="gmail_quote">
<div class=""><br class="">
</div>
<div class=""> Thanks,</div>
<div class=""><br class="">
</div>
<div class=""> Matt</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="">
<div class="">
<div class="">Once again thank you for your help.</div>
<div class=""><br class="">
</div>
<div class="">-artur palha</div>
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 12 Dec 2018, at 15:04, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> wrote:</div>
<br class="gmail-m_-6105557319661554426gmail-m_8585104034508813738m_7438610902563618406Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="gmail_quote">
<div dir="ltr" class="">On Wed, Dec 12, 2018 at 9:01 AM Artur Palha Da Silva Clérigo - LR via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank" class="">petsc-users@mcs.anl.gov</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="">Dear All,
<div class=""><br class="">
</div>
<div class="">I having been trying to add periodic domain functionality to my code. I am able to generate a periodic mesh with gmsh and load it using dmplex. The problem is that I am unable to have a numbering of the degrees of freedom that reflects the periodicity
(they are numbered as if there was no periodicity).</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Why would there be a difference? They should be numbered in the same way.</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="">
<div class="">I read this thread: <a href="https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2018-October/036539.html" target="_blank" class="">https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2018-October/036539.html</a></div>
<div class=""><br class="">
</div>
<div class="">There it is mentioned that DMLocalizeCoordinates is required after loading the mesh.</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Yes, this makes cell-wise coordinates, which have a jump at the periodic boundary.</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="">
<div class="">My questions are the following:</div>
<div class=""><br class="">
</div>
<div class="">1. Is it correct that I need to run DMLocalizeCoordinates on my DM?</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Yes.</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="">
<div class="">2. I am currently using petsc4py but I am unable to find DMLocalizeCoordinates. Is this functionality missing or is there an alternative to it?\</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Its possible no wrapper has been written for this yet. Lisandro, is it missing? (I am at a meeting, or I would check).</div>
<div class=""><br class="">
</div>
<div class=""> Thanks,</div>
<div class=""><br class="">
</div>
<div class=""> Matt</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="">
<div class="">Thank you for your time.</div>
<div class=""><br class="">
</div>
<div class="">Kind regards,</div>
<div class=""><br class="">
</div>
<div class="">-artur palha</div>
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div dir="ltr" class="gmail-m_-6105557319661554426gmail-m_8585104034508813738m_7438610902563618406gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">
-- Norbert Wiener</div>
<div class=""><br class="">
</div>
<div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div dir="ltr" class="gmail-m_-6105557319661554426gmail-m_8585104034508813738gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">
-- Norbert Wiener</div>
<div class=""><br class="">
</div>
<div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div dir="ltr" class="gmail-m_-6105557319661554426gmail_signature">Stefano</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div dir="ltr" class="gmail_signature">Stefano</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>