[petsc-users] Feature request for DMPlexCreateGmsh()/DMPlexCreateGmshFromFile()
Jed Brown
jed at jedbrown.org
Tue Apr 5 19:10:34 CDT 2022
It's sort of available (see -dm_plex_gmsh_use_regions), but we still plan to support a better version of the translation you want. I'd have done it long ago, but have had more urgent things.
https://gitlab.com/petsc/petsc/-/issues/689
If you'd like to start a merge request on this, we can mentor.
"Ferrand, Jesus A." <FERRANJ2 at my.erau.edu> writes:
> 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
More information about the petsc-users
mailing list