[petsc-users] How can I get the global integer ids in a label?

Matthew Knepley knepley at gmail.com
Thu Dec 6 20:20:49 CST 2018


On Thu, Dec 6, 2018 at 9:08 PM leejearl <leejearl at mail.nwpu.edu.cn> wrote:

> Hi, Matt:
> Is the code in following page?
>
> /petsc-master/src/snes/examples/tutorials/ex12.c.html
>

https://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex12.c.html

  Matt


> Thanks
> leejearl
>
> On Thu, 2018-12-06 at 20:26 -0500, Matthew Knepley wrote:
>
> On Thu, Dec 6, 2018 at 8:06 PM leejearl <leejearl at mail.nwpu.edu.cn> wrote:
>
> Hi Matt:
> Thank you for your helps. I want to implement the periodic boundary in
> dmplex. For a cell or face, the donor cell or face might be not distributed
> in the same local dm. Maybe I should ask that how
> can I implement the topology of the periodic boundary in demplex.
>
>
> Plex directly encodes a periodic topology. For example, with a circle,
> each vertex is connected
> to two neighbors. There are example with periodic boundary conditions like
> SNES ex12.
>
>  Thanks,
>
>     Matt
>
>
> Thanks again for your kind reply.
>
> leejearl
> On Thu, 2018-12-06 at 12:02 -0500, Matthew Knepl
>
> On Thu, Dec 6, 2018 at 9:47 AM leejearl via petsc-users <
> petsc-users at mcs.anl.gov> wrote:
>
> Hi, Petsc developer:
>         I have a problem for helps.
>         There is a dmplex object, and I have distribute it use the
> routine DMPlexDistribute(). Then, I want to get the global integer ids
> in the label "Face Sets". The code is as follow,
>
>      ierr = DMGetLabelIdIS(dm, "Face Sets", &bcIdIS);CHKERRQ(ierr);
>
> The values of bcIdIs are the local integer ids. How can I get the
> global integer ids.
>
> The problem also can be described as follow. The global ids might look
> likes
>
> IS Object: 1 MPI processes
>   type: general
> Number of indices in set 4
> 0 1
> 1 4
> 2 3
> 3 2
>
> But after the dm is distributed, I can only get the local ids as follow
> using the routine "DMGetLabelIdIS"
>
> IS Object: 1 MPI processes
>   type: general
> [0] Number of indices in set 3
> [0] 0 1
> [0] 1 2
> [0] 2 4
>
> How can I get the global integer ids in a label after the dm is
> distributed?
>
> Any helps are appreciate!
>
>
> You can make a conversion from local point numbers to global point numbers
> using
>
>
> https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexCreatePointNumbering.html
>
> You could even make a replacement DMLabel with the global point numbers,
> but I think the win would be small
> or nonexistent for most cases.
>
>   Thanks,
>
>     Matt
>
>
> Thanks
>
> leejearl
>
>
>
>
>
>
>
>
>

-- 
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/20181206/57edcfa2/attachment.html>


More information about the petsc-users mailing list