Setting of Boundary Flags from MSH2.2 and MSH4.1 files
While working on #271 (closed), I came again across something that had been bothering me with our current reader for MSH2.2 files, which is the following.
I find the way our current reader for MSH2.2 files sets the primitives' boundary flags less than consistent. The way this is currently done is as follows:
- all vertices are generated from the Nodes section and receive a boundary flag of 0 (physical tags for nodes, available in the Elements section are discarded)
- all tetrahedrons are flagged as 0, too, independent of their physical tags present in the file
- the boundary flags of faces on the other hand are set to the physical tag present (even for 2D meshes, where one might argue, as for tets in 3D, that they are 'inner' by default)
- edges are also flagged by their physical tags
- derived edges and faces, however, are always set to 0; this means that theoretically edges inside of the domain could have different flags than their faces in a 2D setting, if the file flags the latter with a different value than 0.
Additionally, the reader implicitly assumes that there are always precisely two tags per element in the Elements section, ignoring the given number of tags for the element. Thus, it is not super flexible.
In the light of the MSH2.2 format being out-dated, I don't necessarily think it is worth the effort to change this behaviour. However, am planing to have the reader for MSH4.1 offer two options:
- Ignore the physical tags inside the file completely. This will allow to import mesh files without an Entities section. The flags then need to be set inside of the app.
- Alternatively we can consistently flag all primitives we find in the file by their physical tags. Derived primitives should inherit the physical tags of their "parent". The latter should be always possible unambiguously, since the former requires all mesh entities to be present.