<div dir="ltr"><div dir="ltr">On Sat, Mar 20, 2021 at 10:07 AM Nicolas Barral <<a href="mailto:nicolas.barral@math.u-bordeaux.fr">nicolas.barral@math.u-bordeaux.fr</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">Hi all,<br>
<br>
I'm building a plex from elements arrays using <br>
DMPlexCreateFromCellListParallelPetsc. Once the plex is built, I need to <br>
set up boundary labels. I have an array of faces containing a series of <br>
3 vertex local indices. To rebuild boundary labels, I need to loop over <br>
the array and get the join of 3 consecutive points to find the <br>
corresponding face point in the DAG.<br></blockquote><div><br></div><div>This is very common. We should have a built-in thing that does this.</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">
Problem, vertices get reordered by DMPlexCreateFromCellListParallelPetsc <br>
so that locally owned vertices are before remote ones, so local indices <br>
are changed and the indices in the face array are not good anymore.<br></blockquote><div><br></div><div>This is not exactly what happens. I will talk through the algorithm so that maybe we can find a good</div><div>interface. I can probably write the code quickly:</div><div><br></div><div>1) We take in cells[numCells, numCorners], which is a list of all the vertices in each cell</div><div><br></div><div> The vertex numbers do not have to be a contiguous set. You can have any integers you want.</div><div><br></div><div>2) We create a sorted list of the unique vertex numbers on each process. The new local vertex numbers</div><div> are the locations in this list.</div><div><br></div><div>Here is my proposed interface. We preserve this list of unique vertices, just as we preserve the vertexSF.</div><div>Then after DMPlexCreateFromCellListParallelPetsc(), can DMPlexInterpolate(), you could call</div><div><br></div><div> DMPlexBuildFaceLabelsFromCellList(dm, numFaces, faces, labelName, labelValues)</div><div><br></div><div>Would that work for you? I think I could do that in a couple of hours.</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">
Is there a way to track this renumbering ? For owned vertices, I can <br>
find the local index from the global one (so do old local index -> <br>
global index -> new local index). For the remote ones, I'm not sure. I <br>
can hash global indices, but is there a more idiomatic way ?<br>
<br>
Thanks,<br>
<br>
-- <br>
Nicolas<br>
<br>
</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>