[Gmsh] Physical groups in msh file

D Haley mycae at yahoo.com
Tue Aug 17 13:48:09 CEST 2010


Hello,

I am trying to write .msh files for use in Elmer, however I am having some problems with boundary condition grouping. 

What is the correct way to either (1) use GMSH to export simple groupings in msh files (It always seems to drop the physical groups?) or (2) write physical groups to a .msh file. I am looking for an example that I can copy from. 

The documentation did not seem quite clear, at least to me in the description of the physical names. As far as I can see, a valid  section  might be something like:

$PhysicalNames
1
2  (Something) "description"
$EndPhysicalNames

But I am unclear on the "Something", and the "description" secions

So using an example to clarify, I have the following unit cube, with surface triangles:

$MeshFormat
2.1 0 8
$EndMeshFormat
$Nodes
8
1 0 0 0
2 0 0 1
3 0 1 0
4 0 1 1
5 1 0 0
6 1 0 1
7 1 1 0
8 1 1 1
$EndNodes
$Elements
12
1 2 3 0 1 0 1 3 7
2 2 3 0 1 0 1 5 7
3 2 3 0 1 0 6 8 5
4 2 3 0 1 0 5 8 7
5 2 3 0 1 0 5 1 2
6 2 3 0 1 0 5 2 6
7 2 3 0 1 0 1 3 4
8 2 3 0 1 0 1 2 4
9 2 3 0 1 0 3 4 7
10 2 3 0 1 0 7 8 4
11 2 3 0 1 0 2 8 4
12 2 3 0 1 0 6 2 8
$EndElements

I might, say, like to group the top 2 triangles together (z=1), such that I can assign them in Elmer to a single boundary condition, so what would the PhysicalNames section look like? I can't quite seem to get it to work... Would the following be right?

$PhysicalNames
1
2 11 12 "Top Boundary"
$EndPhysicalNames

Thanks,

D. Haley