<div dir="ltr"><div dir="ltr">On Thu, Jun 16, 2022 at 11:11 AM Zongze Yang <<a href="mailto:yangzongze@gmail.com">yangzongze@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"><div>Hi, if I load a `gmsh` file with second-order elements, the coordinates will be stored in a DG-P2 space. After obtaining the coordinates of a cell, how can I map the coordinates to vertex and edge? </div></div></blockquote><div><br></div><div>By default, they are stored as P2, not DG.</div><div><br></div><div>You can ask for the coordinates of a vertex or an edge directly using</div><div><br></div><div>  <a href="https://petsc.org/main/docs/manualpages/DMPLEX/DMPlexPointLocalRead/">https://petsc.org/main/docs/manualpages/DMPLEX/DMPlexPointLocalRead/</a></div><div><br></div><div>by giving the vertex or edge point. You can get all the coordinates on a cell, in the closure order, using</div><div><br></div><div>  <a href="https://petsc.org/main/docs/manualpages/DMPLEX/DMPlexVecGetClosure/">https://petsc.org/main/docs/manualpages/DMPLEX/DMPlexVecGetClosure/</a></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>Below is some code load the gmsh file, I want to know the relation between `cl` and `cell_coords`.</div><div><br></div>```<div>import firedrake as fd<br>import numpy as np<br><br># Load gmsh file (2rd)<br>plex = fd.mesh._from_gmsh('test-fd-load-p2-rect.msh')<br><br>cs, ce = plex.getHeightStratum(0)<br><br>cdm = plex.getCoordinateDM()<br>csec = dm.getCoordinateSection()<br>coords_gvec = dm.getCoordinates()<br><br>for i in range(cs, ce):<br>    cell_coords = cdm.getVecClosure(csec, coords_gvec, i)<br>    print(f'coordinates for cell {i} :\n{cell_coords.reshape([-1, 3])}')<br>    cl = dm.getTransitiveClosure(i)<br>    print('closure:', cl)<br>    break</div><div>```<br clear="all"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><br></div><div dir="ltr">Best wishes,</div></div><div>Zongze</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>