<div dir="ltr"><div dir="ltr">On Mon, Jun 14, 2021 at 7:47 PM Adrian Croucher <<a href="mailto:a.croucher@auckland.ac.nz">a.croucher@auckland.ac.nz</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>
<p>hi Matt,<br>
</p>
<div>On 14/06/21 9:54 pm, Matthew Knepley
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_quote">Okay, I think it is not so hard to get
what you want in parallel. There are only two kinds of faces
with supportSize == 1:
<div><br>
</div>
<div> a) Faces on the global boundary</div>
<div><br>
</div>
<div> b) Faces which are "shared"</div>
</div>
</div>
</blockquote>
<p>I think there is an unfortunate corner case in which faces can be
both on the global boundary *and* shared.<br>
</p>
<p>For example: consider a square 2D mesh which is partitioned down
the middle, so one process has the left half. With overlap = 1, a
row of ghost cells will be added along the right-hand edge of this
half of the mesh. The two faces at top and bottom of this row of
ghost cells are on the global boundary and also shared.</p>
<p>With your algorithm these would be labelled as flux faces, but
they shouldn't be (as they are on the global boundary). I can't
see a way to eliminate those kinds of shared faces - can you?</p></div></blockquote><div>I admit that it is becoming complicated, but this can also be handled.</div><div><br></div><div>The corner case only shows up when we distribute with overlap. Thus we could,</div><div><br></div><div>1) Distribute the mesh without overlap</div><div><br></div><div>2) Mark the global boundary using the former algorithm</div><div><br></div><div>3) Distribute overlap = 1 using DMPlexDistributeOverlap(). DMPlexDistribute() just does these two steps at once if you ask for overlap.</div><div><br></div><div>4) Use the former algorithm, with the boundary label we just made, to mark flux faces.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<p>- Adrian<br>
</p>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_quote">
<div><br>
</div>
<div>It is the second set that is somewhat confusing because
PetscSF does not have 2-sided information by default.
However, it can make it.</div>
<div>There is a two-step check for "shared":</div>
<div><br>
</div>
<div> 1) Is the face in the PetscSF? Here you just check for
it in the sorted "locals" array from PetscSFGetGraph()</div>
<div><br>
</div>
<div> 2) Is the face ghosted on another process? You can get
this from PetscSFGetRootRanks().</div>
<div><br>
</div>
<div>I just wrote a small function to check for "shared"
points. After that, I think you can just run</div>
<div><br>
</div>
<div> 1) After distribution, loop overall faces on current
process</div>
<div><br>
</div>
<div> If face on open boundary, label face as flux face</div>
<div><br>
</div>
<div> else:</div>
<div><br>
</div>
<div> if face has supportSize != 1 or (supportSize == 1
&& shared), label face as flux face</div>
<div><br>
</div>
<div> Thanks,</div>
<div><br>
</div>
<div> Matt </div>
</div>
<br>
</div>
</blockquote>
<pre cols="72">--
Dr Adrian Croucher
Senior Research Fellow
Department of Engineering Science
University of Auckland, New Zealand
email: <a href="mailto:a.croucher@auckland.ac.nz" target="_blank">a.croucher@auckland.ac.nz</a>
tel: +64 (0)9 923 4611</pre>
</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>