Skip to content

Nodes_and_Elements

Fabian Brinkmann edited this page Jul 15, 2022 · 1 revision

Mesh2HRTF stores all geometric data (Evaluation grids and 3D meshes) in two text files containing the nodes (vertices) and elements of the geometry.

Node Files

The files Nodes.txt containing the position of the nodes and have the following format (d: integer, f: float)

%d
%d %f %f %f
.
.
.
%d %f %f %f

where the first line contains the number of nodes in the file all following lines are given by

  1. Node number
  2. x-coordinate
  3. y-coordinate
  4. z-coordinate

The node number is used to identify a given node in the element list. Node numbers do not need to start with 0. Every node has to have a unique node number and node numbers should increase by 1 between nodes.

Element files

The files Elements.txt element data of your mesh. The files containing the element data have the format

%d
%d %d %d %d %d %d %d
.
.
.
%d %d %d %d %d %d %d

for triangular meshes and

%d
%d %d %d %d %d %d %d %d
.
.
.
%d %d %d %d %d %d %d %d

for quadrilateral meshes.

The first line contains the number of elements defined in the file followed by lines with

  1. Number of the element. This is needed for defining the boundary conditions 2)-4) or 2)-5) Number of the nodes (3 or 4) generating the element. The nodes should be given counter-clock wise, otherwise the normal vector points in the wrong direction. You haven’t really worked with BEM unless you have defined the normal vector wrong at least once, and wondered for about half a day why your results look so funny.
  2. or 6) Type of the element: 0 indicates an element on the boundary, 2 indicates an element of the evaluation mesh
  3. or 7) dummy: set it to 0
  4. or 8) number of the element group. As already mentioned it is possible to define element groups, for example if you only want to represent certain parts of your mesh. In general, we use 0 for boundary elements and 1 for evaluation elements. So how does NumCalc know if the element is a triangle or a quadrilateral? Quite simple, it counts entries in the line, if the line contains only 7 elements, the element is a triangle, if it contains 8 entries, we have a quadrilateral, otherwise NumCalc will stop with an error.

Example

2016 7938 7939 7940 7941 0 0 0
2017 7942 7943 7944 0 0 0

defines two elements on the boundary with numbers 2016 and 2017. The first one is a quadrilateral spanned by the nodes with numbers 7938, 7939, 7940, and 7941 the second one is a triangle spanned by nodes 7942, 7943, and 7944. Both elements are in the element group 0.

655 2522 2523 2524 2525 2 0 1

defines a quadrilateral of the evaluation mesh with element number 655 with nodes 2522, 2523, 2524, and 2525 as vertices. The element belongs to the element group 1. Like for the nodes, the element numbers must be unique and should increase by 1 from element to element.

Warning: It is only possible to define different element groups in the object mesh, each element of the evaluation mesh has to be in the same group.