<div dir="ltr"><div dir="ltr">On Wed, Feb 7, 2024 at 8:30 AM Mark Adams <<a href="mailto:mfadams@lbl.gov">mfadams@lbl.gov</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">Wait for Matt to chime in, but I think you will need to start from scratch and use <a href="https://petsc.org/release/manualpages/DMPlex/DMPlexBuildFromCellList" target="_blank">https://petsc.org/release/manualpages/DMPlex/DMPlexBuildFromCellList</a></div></blockquote><div><br></div><div>Let me restate things to make sure I get it. You want to select a submesh that retains its labels? There are many different kinds of submeshes. The easiest one is</div><div><br></div><div> <a href="https://petsc.org/main/manualpages/DMPlex/DMPlexFilter/">https://petsc.org/main/manualpages/DMPlex/DMPlexFilter/</a></div><div><br></div><div>The selects a subset of cells. Since you always get the closure of any mesh point, I am not sure it makes sense to select vertices independently of cells, but maybe you can explain that to me. You just mark the cells you want with another label and call that function. All labels will be propagated (along with everything else).</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>Mark</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 7, 2024 at 5:36 AM Vilmer Dahlberg via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div dir="ltr">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Dear PETSc dev team,</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div><span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">I am working on an application which makes use of DMPlex. I would like to extract a
subsection of the dm based on some field metric defined on its vertices or cells. I am using DMLabel to mark my boundary conditions and would like the child mesh to retain some of the labels. Is there a simple way of doing this? I could spend some time writing
my own implementation, looping over cells and building a new DM from scratch or using something like DMPlexBuildFromCellListParallel, but I feel like there should exist a solution. Could you point me in the right direction?</span></div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Thanks in advance!</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Best,</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Vilmer</div>
</div>
</div></blockquote></div>
</blockquote></div><br clear="all"><div><br></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>