[Gmsh] Trouble Exporting Physical Entity Tags for Surface Elements and Volume Elements in .msh File

Robbie Jaeger rjaeger at gmail.com
Thu Dec 27 20:21:22 CET 2018


Hi,

I'm having difficulty exporting a .msh ASCII file (format version 2) that
includes the physical entity tags for elements. I've created a box volume
and have assigned the 6 surfaces and volume to separate physical groups.
I'd like to export the mesh as a .msh ASCII file (format version 2) as an
input for a finite element program. As such, I am using the physical groups
to identify regions where boundary conditions apply and where material
types are assigned. I'm using gmsh version 4.0.7 Win64 on Windows 10.

The .geo commands for the box are as follows:

SetFactory("OpenCASCADE");
Box(1) = {0, 0, 0, 10, 10, 5};
Physical Surface("DS") = {2};
Physical Surface("US") = {1};
Physical Volume("Solid") = {1};
Physical Surface("Other Surface") = {3, 5, 6, 4};

I created 1d, 2d, and 3d meshes using the GUI. When I export this to a .msh
file (format version 2), the elements are exported with their elementary
tags rather than their physical tags. For example, here is the line from
the .msh file for element 500 which falls on elementary surface 6 and
physical surface 4:
500 2 2 0 6 15 247 237

Three-dimensional elements are similarly exported using their elementary
surface tags. Here is a 4-node tetrahedron within elementary volume 1 and
physical volume 5:
924 4 2 0 1 169 306 196 293

Based on the documentation, I expected the first tag after the number of
tags to be the physical entity tag:

number-of-tags

gives the number of integer tags that follow for the n-th element. By
default, the first tag is the tag of the physical entity to which the
element belongs; the second is the tag of the elementary geometrical entity
to which the element belongs;...

However, I'm receiving a zero tag for all elements. Am I misunderstanding
the documentation or is this the intended behavior? Is there a way to
export a .msh with the physical entity tags or do I need to go about this
in a different way?

Best regards,
Robert Jaeger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20181227/1817eb63/attachment.html>


More information about the gmsh mailing list