A triangulation is defined by
As vertices are stored in an array (a line for each vertex in file trace.msh), they have a number: the line position in the file, for instance.
Similarly, the very fact of specifying each triangle by a line in the file "trace.msh", means that triangles have been numbered.
In addition, it is convenient to associate to each vertex and to each triangle a reference number. For vertices it indicates on which boundary it is, with the convention that 0 indicates an interior point.
To read a triangulation file we must first define a standard format:
Each vertex receives a number corresponding to its line position in the file; this number can be used to identify the vertex. The number "where" is a convenience to find out quickly if a vertex is strictly inside the domain (where=0) or on the boundary. The number "where" for the triangle is convenient when there are several medium in the domain, such as on iron part and one copper part in electromagnetism for instance.

Figure: A tiny triangulation and its file of data.