Simulation files
Gmsh physical-group census
Count elements by physical tag and dimension in an ASCII MSH 2.2 file.
Your inputs
Start with an exampleYour result
Example resultAa — A small example of your colors.
How it works
Resolve element node IDs, map supported element types to dimensions and group by the first element tag. Match PhysicalNames by dimension and tag.
The sample has a line in physical group 7 and a triangle in group 8, with one element in each.
Limits
MSH 2.2 ASCII, types 1–15, up to 20000 nodes/elements in one Nodes/Elements section. Field-data sections are ignored. Tag 0 means untagged. Partition semantics, high-order types beyond 15 and geometric quality are excluded; MSH 4 is not guessed.