My guess is that you have selected "Save all elements" (or have "Mesh.SaveAll = 
1" in your option file). In the MSH2 format, this option discards the physical 
group definitions. (The MSH4 format's behaviour is more intuitive - it keeps 
the physical groups.)

Christophe

> On 27 Dec 2018, at 20:21, Robbie Jaeger <[email protected]> wrote:
> 
> 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
> _______________________________________________
> gmsh mailing list
> [email protected]
> http://onelab.info/mailman/listinfo/gmsh

— 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science 
http://www.montefiore.ulg.ac.be/~geuzaine

Free software: http://gmsh.info | http://getdp.info | http://onelab.info


_______________________________________________
gmsh mailing list
[email protected]
http://onelab.info/mailman/listinfo/gmsh

Reply via email to