Problem with multiple physicals for one elementary region -- .msh format logic
When several physical entities are defined on the same elementary entity, the .msh format saves several elements (with different tags)--one for each physical region.
This is not bad in itself, but when gmsh reads the .msh file again, it stores the duplicate elements in the (single, uniaue) elementary region, and subsequent queries as to which element belongs to which physical group cannot be answered! Indeed, the physical information is stored in the elementary region (not in the element).
The cleanest solution would be to NEVER generate duplicate elements. The .msh format should si,ply have a $PhysicalGroups field that stores the Physical-to-Elemnetary/ies relationship.
A first pass at MSH3 is implemented. You can give it a try by specifying
Mesh.MshFileVersion = 3;
PS : we should also fix this in all the formats that support some sort of "grouping" mechanisms.
As of r15204, the Abaqus (INP) format is fixed. We should definitely fix UNV, too. The others are probably less important.
In any case, we should never, ever duplicate elements again when saving a mesh file.