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

Matthew Knepley knepley at gmail.com
Thu Dec 6 11:02:42 CST 2018


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/c04b27e3/attachment.html>


More information about the petsc-users mailing list