<div dir="ltr"><div dir="ltr">On Wed, May 17, 2023 at 10:02 AM Berend van Wachem <<a href="mailto:berend.vanwachem@ovgu.de">berend.vanwachem@ovgu.de</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">Dear PETSc Team,<br>
<br>
We are using DMPlex, and we create a mesh using<br>
<br>
DMPlexCreateBoxMesh (.... );<br>
<br>
and get a uniform mesh. The mesh is periodic.<br>
<br>
We typically want to "scale" the coordinates (vertices) of the mesh, and <br>
to achieve this, we call<br>
<br>
DMGetCoordinatesLocal(dm, &coordinates);<br>
<br>
and scale the entries in the Vector coordinates appropriately.<br>
<br>
and then<br>
<br>
DMSetCoordinatesLocal(dm, coordinates);<br>
<br>
<br>
After this, we localise the coordinates by calling<br>
<br>
DMLocalizeCoordinates(dm);<br>
<br>
This worked fine up to PETSc 3.18, but with versions after this, the <br>
coordinates we get from the call<br>
<br>
DMPlexGetCellCoordinates(dm, CellID, &isDG, &CoordSize, <br>
&ArrayCoordinates, &Coordinates);<br>
<br>
are no longer correct if the mesh is periodic. A number of the <br>
coordinates returned from calling DMPlexGetCellCoordinates are wrong.<br>
<br>
I think, this is because DMLocalizeCoordinates is now automatically <br>
called within the routine DMPlexCreateBoxMesh.<br>
<br>
So, my question is: How should we scale the coordinates from a periodic <br>
DMPlex mesh so that they are reflected correctly when calling both <br>
DMGetCoordinatesLocal and DMPlexGetCellCoordinates, with PETSc versions <br>
>= 3.18?<br></blockquote><div><br></div><div>I think we might have to add an API function. For now, when you scale the coordinates,</div><div>can you scale both copies?</div><div><br></div><div> DMGetCoordinatesLocal()</div><div> DMGetCellCoordinatesLocal();</div><div><br></div><div>and then set them back.</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">
Many thanks, Berend.</blockquote></div><span class="gmail_signature_prefix">-- </span><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>