[petsc-users] Feature request for DMPlexCreateGmsh()/DMPlexCreateGmshFromFile()

Ferrand, Jesus A. FERRANJ2 at my.erau.edu
Tue Apr 5 18:22:35 CDT 2022


Greetings!

I am working with Gmsh meshes that I import to PETSc using DMPlexCreateGmshFromFile(). In Gmsh, users can set Physical groups to flag topology with integer ID's. DMPlexCreateGmsh() will read those physical groups as DMLabels with stratum values matching what the user set in Gmsh. When defining physical groups, Gmsh users may include strings so that the .msh file could have a section like:

$PhysicalNames
3
1 8 "string1"
1 9 "string2"
1 10 "string3"
$EndPhysicalNames

In lines 1062 to 1086 (which form the function GmshReadPhysicalNames()) of the source code of DMPlexCreateGmsh() [https://petsc.org/release/src/dm/impls/plex/plexgmsh.c.html#DMPlexCreateGmsh] one can see that the parser does in fact look for those strings and will store them (one at a time) in a variable "name" but does not output it. Within those same lines, the "name" variable is copied to a string array called "regionNames" that is part of C-struct. That same C-struct is explicitly available inside of DMPlexCreateGmsh().

Would it be possible to add an additional output argument to both DMPlexCreateGmsh() and DMPlexCreateGmshFromFile() where users may get a copy of the raw "regionNames"? My only way to access those strings is by using my own knockoff version of GmshReadPhysicalNames().
Mathematics and Computer Science | Argonne National Laboratory<https://petsc.org/release/src/dm/impls/plex/plexgmsh.c.html#DMPlexCreateGmsh>
Actual source code: plexgmsh.c. 1: #define PETSCDM_DLL 2: #include <petsc/private/dmpleximpl.h> 3: #include <petsc/private/hashmapi.h> 5: #include <../src/dm/impls ...
petsc.org



Sincerely:

J.A. Ferrand

Embry-Riddle Aeronautical University - Daytona Beach FL

M.Sc. Aerospace Engineering | May 2022

B.Sc. Aerospace Engineering

B.Sc. Computational Mathematics



Sigma Gamma Tau

Tau Beta Pi



Phone: (386)-843-1829

Email(s): ferranj2 at my.erau.edu

    jesus.ferrand at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220405/f5f92975/attachment.html>


More information about the petsc-users mailing list