[petsc-users] How to get Gmsh boundary edge/face tags

Matthew Knepley knepley at gmail.com
Fri May 3 05:11:32 CDT 2019


On Fri, May 3, 2019 at 2:42 AM Praveen C via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Dear all
>
> In a 2d mesh I save some tags like this
>
> Physical Line(100) = {1,2};
> Physical Line(200) = {3,4};
>
> so that I can identify boundary portions on which bc is to be applied.
>
> How can I access this tag (100,200 in above example) after reading the msh
> file into a DMPlex ?
>

Plex uses DMLabel objects to store tags like this. You would first retrieve
the label. We store them by name,
determined from the input file. For GMsh I think it should be "Face Sets",

  DMGetLabel(dm, "Face Sets", &label);

You can always check the names using -dm_view. Next you can get all the
point with a given label values using

  DMLabelGetStratumIS(label, 3, &pointIS);

or check the label of a particular point,

  DMLabelGetValue(label, point, &val);

  Thanks,

     Matt


> Thanks
> praveen



-- 
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/20190503/b2dfd932/attachment-0001.html>


More information about the petsc-users mailing list