[petsc-users] flux vector

Matthew Knepley knepley at gmail.com
Mon Jun 14 19:21:49 CDT 2021


On Mon, Jun 14, 2021 at 7:47 PM Adrian Croucher <a.croucher at auckland.ac.nz>
wrote:

> hi Matt,
> On 14/06/21 9:54 pm, Matthew Knepley wrote:
>
> 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:
>
>   a) Faces on the global boundary
>
>   b) Faces which are "shared"
>
> I think there is an unfortunate corner case in which faces can be both on
> the global boundary *and* shared.
>
> 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.
>
> 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?
>
I admit that it is becoming complicated, but this can also be handled.

The corner case only shows up when we distribute with overlap. Thus we
could,

1) Distribute the mesh without overlap

2) Mark the global boundary using the former algorithm

3) Distribute overlap = 1 using DMPlexDistributeOverlap().
DMPlexDistribute() just does these two steps at once if you ask for overlap.

4) Use the former algorithm, with the boundary label we just made, to mark
flux faces.

  Thanks,

      Matt

> - Adrian
>
>
> It is the second set that is somewhat confusing because PetscSF does not
> have 2-sided information by default. However, it can make it.
> There is a two-step check for "shared":
>
>   1) Is the face in the PetscSF? Here you just check for it in the sorted
> "locals" array from PetscSFGetGraph()
>
>   2) Is the face ghosted on another process? You can get this from
> PetscSFGetRootRanks().
>
> I just wrote a small function to check for "shared" points. After that, I
> think you can just run
>
>   1) After distribution, loop overall faces on current process
>
>      If face on open boundary, label face as flux face
>
>      else:
>
>        if face has supportSize != 1 or (supportSize == 1 && shared), label
> face as flux face
>
>   Thanks,
>
>      Matt
>
> --
> Dr Adrian Croucher
> Senior Research Fellow
> Department of Engineering Science
> University of Auckland, New Zealand
> email: a.croucher at auckland.ac.nz
> tel: +64 (0)9 923 4611
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210614/80d70024/attachment.html>


More information about the petsc-users mailing list