A..0.0.2.1 Example :
To write in binary the following mesh:
MeshVersionFormatted 2

Dimension 3

Vertices
4
0 0 0 1
1 0 1 1
0 1 1 1
1 1 1 1

Tetrahedra
1
1 2 3 4 52

End

you have to write in binary file the following number:

1 2 3 20 3 4 132 0. 0. 0. 1 1 0. 1. 1 0. 1. 1. 1 1. 1. 1. 1 8 1 2 3 4 52 54

Explanation :

1 : MeshVersionFormatted
2 : version number
3 : Dimension
20 : file position at the end of the information concerning the keyword Dimension
4 : Vertices
140 : file position at the end of the information concerning the keyword Vertices: each vertex is composed by three double precision real and an integer (reference), and a double precision real is stored on 8 bits thus each vertex information is composed by 8*3+4=28bits. There are 4 vertex so 112 bits. Then we add the integers for the keyword and the number of vertices (2*4 bits) and 20 bits for the previous fields. The result is well 140.
8 : Tetrahedra
168 : file position at the end of the information concerning the keyword Tetrahedra: each tetrahedron information is composed by 5 integers.
54 : End

back to the content

back to the content


Dobrzynski 2012-03-23