<div dir="ltr">Thank you for your prompt assistance, Christophe. That was exactly my issue.<div><br></div><div>Best regards,</div><div>Robert Jaeger</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 27, 2018 at 11:42 AM Christophe Geuzaine <<a href="mailto:cgeuzaine@uliege.be">cgeuzaine@uliege.be</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
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.)<br>
<br>
Christophe<br>
<br>
> On 27 Dec 2018, at 20:21, Robbie Jaeger <<a href="mailto:rjaeger@gmail.com" target="_blank">rjaeger@gmail.com</a>> wrote:<br>
> <br>
> Hi,<br>
> <br>
> 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.<br>
> <br>
> The .geo commands for the box are as follows:<br>
> <br>
> SetFactory("OpenCASCADE");<br>
> Box(1) = {0, 0, 0, 10, 10, 5};<br>
> Physical Surface("DS") = {2};<br>
> Physical Surface("US") = {1};<br>
> Physical Volume("Solid") = {1};<br>
> Physical Surface("Other Surface") = {3, 5, 6, 4};<br>
> <br>
> 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: <br>
> 500 2 2 0 6 15 247 237<br>
> <br>
> 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:<br>
> 924 4 2 0 1 169 306 196 293<br>
> <br>
> Based on the documentation, I expected the first tag after the number of tags to be the physical entity tag:<br>
> <br>
> number-of-tags<br>
> 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;...<br>
> <br>
> 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?<br>
> <br>
> Best regards,<br>
> Robert Jaeger<br>
> _______________________________________________<br>
> gmsh mailing list<br>
> <a href="mailto:gmsh@onelab.info" target="_blank">gmsh@onelab.info</a><br>
> <a href="http://onelab.info/mailman/listinfo/gmsh" rel="noreferrer" target="_blank">http://onelab.info/mailman/listinfo/gmsh</a><br>
<br>
— <br>
Prof. Christophe Geuzaine<br>
University of Liege, Electrical Engineering and Computer Science <br>
<a href="http://www.montefiore.ulg.ac.be/~geuzaine" rel="noreferrer" target="_blank">http://www.montefiore.ulg.ac.be/~geuzaine</a><br>
<br>
Free software: <a href="http://gmsh.info" rel="noreferrer" target="_blank">http://gmsh.info</a> | <a href="http://getdp.info" rel="noreferrer" target="_blank">http://getdp.info</a> | <a href="http://onelab.info" rel="noreferrer" target="_blank">http://onelab.info</a><br>
<br>
</blockquote></div>