[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9. File formats

This chapter describes Gmsh's native "MSH" file format, used to store meshes and associated post-processing datasets. The MSH format exists in two flavors: ASCII and binary. The format has a version number (currently: 2.0) that is independent of Gmsh's main version number.

9.1 MSH ASCII file format  
9.2 MSH binary file format  
9.3 Node ordering  
9.4 Legacy formats  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.1 MSH ASCII file format

The MSH ASCII file format contains one mandatory section giving information about the file ($MeshFormat), followed by several optional sections defining the nodes ($Nodes), elements ($Elements), region names ($PhysicalName) and post-processing datasets ($NodeData, $ElementData, $ElementNodeData). Sections can be repeated in the same file, and post-processing sections can be put into separate files (e.g. one file per time step).

The format is defined as follows:

 
$MeshFormat
version-number file-type data-size
$EndMeshFormat
$Nodes
number-of-nodes
node-number x-coord y-coord z-coord
...
$EndNodes
$Elements
number-of-elements
elm-number elm-type number-of-tags < tag > ... node-number-list
...
$EndElements
$PhysicalNames
number-of-names
phyical-number "physical-name"
...
$EndPhysicalNames
$NodeData
number-of-string-tags
< "string-tag" >
...
number-of-real-tags
< real-tag >
...
number-of-integer-tags
< integer-tag >
...
node-number value ...
...
$EndNodeData
$ElementData
number-of-string-tags
< "string-tag" >
...
number-of-real-tags
< real-tag >
...
number-of-integer-tags
< integer-tag >
...
elm-number value ...
...
$EndElementData
$ElementNodeData
number-of-string-tags
< "string-tag" >
...
number-of-real-tags
< real-tag >
...
number-of-integer-tags
< integer-tag >
...
elm-number number-of-nodes-per-element value ...
...
$ElementEndNodeData

where

version-number
is a real number equal to 2.0

file-type
is an integer equal to 0 in the ASCII file format.

data-size
is an integer equal to the size of the floating point numbers used in the file (currently only data-size = sizeof(double) is supported).

number-of-nodes
is the number of nodes in the mesh.

node-number
is the number (index) of the n-th node in the mesh; node-number must be a postive (non-zero) integer. Note that the node-numbers do not necessarily have to form a dense nor an ordered sequence.

x-coord y-coord z-coord
are the floating point values giving the X, Y and Z coordinates of the n-th node.

number-of-elements
is the number of elements in the mesh.

elm-number
is the number (index) of the n-th element in the mesh; elm-number must be a postive (non-zero) integer. Note that the elm-numbers do not necessarily have to form a dense nor an ordered sequence.

elm-type
defines the geometrical type of the n-th element:
1
2-node line.
2
3-node triangle.
3
4-node quadrangle.
4
4-node tetrahedron.
5
8-node hexahedron.
6
6-node prism.
7
5-node pyramid.
8
3-node second order line (2 nodes associated with the vertices and 1 with the edge).
9
6-node second order triangle (3 nodes associated with the vertices and 3 with the edges).
10
9-node second order quadrangle (4 nodes associated with the vertices, 4 with the edges and 1 with the face).
11
10-node second order tetrahedron (4 nodes associated with the vertices and 6 with the edges).
12
27-node second order hexahedron (8 nodes associated with the vertices, 12 with the edges, 6 with the faces and 1 with the volume).
13
18-node second order prism (6 nodes associated with the vertices, 9 with the edges and 3 with the quadrangular faces).
14
14-node second order pyramid (5 nodes associated with the vertices, 8 with the edges and 1 with the quadrangular face).
15
1-node point.
16
8-node second order quadrangle (4 nodes associated with the vertices and 4 with the edges).
17
20-node second order hexahedron (8 nodes associated with the vertices and 12 with the edges).
18
15-node second order prism (6 nodes associated with the vertices and 9 with the edges).
19
13-node second order pyramid (5 nodes associated with the vertices and 8 with the edges).
See below for the ordering of the nodes.

number-of-tags
gives the number of integer tags that follow for the n-th element. By default, the first tag is the number of the physical entity to which the element belongs; the second is the number of the elementary geometrical entity to which the element belongs; the third is the number of a mesh partition to which the element belongs. All tags must be postive integers, or zero. A zero tag is equivalent to no tag.

node-number-list
is the list of the node numbers of the n-th element. The ordering of the nodes is given in 9.3 Node ordering.

number-of-string-tags
gives the number of string tags that follow. By default the first string-tag is interpreted as the name of the post-processing view, and the second as the name of the interpolation scheme.

number-of-real-tags
gives the number of real number tags that follow.

number-of-integer-tags
gives the number of integer tags that follow. By default the first integer-tag is interpreted as a time step number, the second as the number of field components of the data in the view, the third as the number of entities (nodes or elements) in the view, and the fourth as the partition index for the view data.

number-of-nodes-per-elements
gives the number of node values for an element in an element-based view.

value
is a real number giving the value associated with a node or an element. For NodeData (respectively ElementData) views, there are ncomp values per node (resp. per element), where ncomp is the number of field components. For ElementNodeData views, there are ncomp times number-of-nodes-per-elements values per element.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.2 MSH binary file format

The binary file format is similar to the ASCII format described above:

 
$MeshFormat
version-number file-type data-size
one-binary
$EndMeshFormat
$Nodes
number-of-nodes
nodes-binary
$EndNodes
$Elements
number-of-elements
element-header-binary
elements-binary
element-header-binary
elements-binary
...
$EndElements

[ all other sections are identical to ASCII, except that node-number,
  elm-number, number-of-nodes-per-element and values are written in
  binary format ]

where

version-number
is a real number equal to 2.0.

file-type
is an integer equal to 1.

data-size
has the same meaning as in the ASCII file format. Currently only data-size = sizeof(double) is supported.

one-binary
is an integer of value 1 written in binary form. This integer is used for detecting if the computer on which the binary file was written and the computer on which the file is read are of the same type (little or big endian).

Here is a pseudo C code to write one-binary:
 
int one = 1;
fwrite(&one, sizeof(int), 1, file);

number-of-nodes
has the same meaning as in the ASCII file format.

nodes-binary
is the list of nodes in binary form, i.e., a array of number-of-nodes * (4 + 3 * data-size) bytes. For each node, the first 4 bytes contain the node number and the next (3 * data-size) bytes contain the three floating point coordinates.

Here is a pseudo C code to write nodes-binary:
 
for(i = 0; i < number_of_nodes; i++){
  fwrite(&num_i, sizeof(int), 1, file);
  double xyz[3] = {node_i_x, node_i_y, node_i_z};
  fwrite(&xyz, sizeof(double), 3, file);
}

number-of-elements
has the same meaning as in the ASCII file format.

element-header-binary
is a list of 3 integers in binary form, i.e., an array of (3 * 4) bytes: the first four bytes contain the type of the elements that follow (same as elm-type in the ASCII format), the next four contain the number of elements that follow, and the last four contain the number of tags per element (same as number-of-tags in the ASCII format).

Here is a pseudo C code to write element-header-binary:
 
int header[3] = {elm_type, num_elm_follow, num_tags};
fwrite(&header, sizeof(int), 3, file);

elements-binary
is a list of elements in binary form, i.e., an array of "number of elements that follow" * (4 + number-of-tags * 4 + #node-number-list * 4) bytes. For each element, the first four bytes contain the element number, the next (number-of-tags * 4) contain the tags, and the last (#node-number-list * 4) contain the node indices.

Here is a pseudo C code to write elements-binary for triangles with the 3 standard tags (the physical and elementary regions, and the mesh partition):
 
for(i = 0; i < number_of_triangles; i++){
  int data[7] = {num_i, physical, elementary, partition, 
                 node_i_1, node_i_2, node_i_3};
  fwrite(data, sizeof(int), 7, file);
}


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.3 Node ordering

For all mesh and post-processing file formats, the reference elements are defined as follows.

 
Line:                   Line3:
                                                
0----------1 --> u      0-----2----1

 
Triangle:               Triangle6:

v
^
|
2                       2           
|`\                     |`\         
|  `\                   |  `\       
|    `\                 5    `4     
|      `\               |      `\   
|        `\             |        `\ 
0----------1 --> u      0-----3----1

 
Quadrangle:            Quadrangle8:            Quadrangle9:

      v
      ^
      |
3-----------2          3-----6-----2           3-----6-----2 
|     |     |          |           |           |           | 
|     |     |          |           |           |           | 
|     +---- | --> u    7           5           7     8     5 
|           |          |           |           |           | 
|           |          |           |           |           | 
0-----------1          0-----4-----1           0-----4-----1 

 
Tetrahedron:                          Tetrahedron10:

                   v
                 .
               ,/
              /
           2                                     2           
         ,/|`\                                 ,/|`\         
       ,/  |  `\                             ,/  |  `\       
     ,/    '.   `\                         ,6    '.   `5     
   ,/       |     `\                     ,/       8     `\   
 ,/         |       `\                 ,/         |       `\ 
0-----------'.--------1 --> u         0--------4--'.--------1
 `\.         |      ,/                 `\.         |      ,/ 
    `\.      |    ,/                      `\.      |    ,9   
       `\.   '. ,/                           `7.   '. ,/     
          `\. |/                                `\. |/       
             `3                                    `3        
                `\.
                   ` w

 
Hexahedron:             Hexahedron20:          Hexahedron27:

       v
3----------2            3----13----2           3----13----2     
|\     ^   |\           |\         |\          |\         |\    
| \    |   | \          | 15       | 14        |15    24  | 14  
|  \   |   |  \         9  \       11 \        9  \ 20    11 \  
|   7------+---6        |   7----19+---6       |   7----19+---6 
|   |  +-- |-- | -> u   |   |      |   |       |22 |  26  | 23| 
0---+---\--1   |        0---+-8----1   |       0---+-8----1   | 
 \  |    \  \  |         \  17      \  18       \ 17    25 \  18
  \ |     \  \ |         10 |        12|        10 |  21    12| 
   \|      w  \|           \|         \|          \|         \| 
    4----------5            4----16----5           4----16----5 

 
Prism:                      Prism15:               Prism18:

           w
           ^
           |
           3                       3                      3        
         ,/|`\                   ,/|`\                  ,/|`\      
       ,/  |  `\               12  |  13              12  |  13    
     ,/    |    `\           ,/    |    `\          ,/    |    `\  
    4------+------5         4------14-----5        4------14-----5 
    |      |      |         |      8      |        |      8      | 
    |    ,/|`\    |         |      |      |        |    ,/|`\    | 
    |  ,/  |  `\  |         |      |      |        |  15  |  16  | 
    |,/    |    `\|         |      |      |        |,/    |    `\| 
   ,|      |      `\        10     |      11       10-----17-----11
 ,/ |      0      | `\      |      0      |        |      0      | 
u   |    ,/ `\    |    v    |    ,/ `\    |        |    ,/ `\    | 
    |  ,/     `\  |         |  ,6     `7  |        |  ,6     `7  | 
    |,/         `\|         |,/         `\|        |,/         `\| 
    1-------------2         1------9------2        1------9------2 

 
Pyramid:                     Pyramid13:                   Pyramid14:

               4                            4                            4
             ,/|\                         ,/|\                         ,/|\
           ,/ .'|\                      ,/ .'|\                      ,/ .'|\
         ,/   | | \                   ,/   | | \                   ,/   | | \
       ,/    .' | `.                ,/    .' | `.                ,/    .' | `.
     ,/      |  '.  \             ,7      |  12  \             ,7      |  12  \
   ,/       .' w |   \          ,/       .'   |   \          ,/       .'   |   \
 ,/         |  ^ |    \       ,/         9    |    11      ,/         9    |    11
0----------.'--|-3    `.     0--------6-.'----3    `.     0--------6-.'----3    `.
 `\        |   |  `\    \      `\        |      `\    \     `\        |      `\    \
   `\     .'   +----`\ - \ -> v  `5     .'        10   \      `5     .' 13     10   \
     `\   |    `\     `\  \        `\   |           `\  \       `\   |           `\  \ 
       `\.'      `\     `\`          `\.'             `\`         `\.'             `\` 
          1----------------2            1--------8-------2           1--------8-------2
                    `\
                       u


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.4 Legacy formats

This section describes Gmsh's older native file formats. Future versions of Gmsh will continue to support these formats, but we recommend that you do not use them in new aplications.

9.4.1 MSH file format version 1.0  
9.4.2 POS ASCII file format  
9.4.3 POS binary file format  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.4.1 MSH file format version 1.0

The MSH file format version 1.0 is Gmsh's old native mesh file format, now superseded by the format described in 9.1 MSH ASCII file format. It is defined as follows:

 
$NOD
number-of-nodes
node-number x-coord y-coord z-coord
...
$ENDNOD
$ELM
number-of-elements
elm-number elm-type reg-phys reg-elem number-of-nodes node-number-list
...
$ENDELM

where

number-of-nodes
is the number of nodes in the mesh.

node-number
is the number (index) of the n-th node in the mesh; node-number must be a postive (non-zero) integer. Note that the node-numbers do not necessarily have to form a dense nor an ordered sequence.

x-coord y-coord z-coord
are the floating point values giving the X, Y and Z coordinates of the n-th node.

number-of-elements
is the number of elements in the mesh.

elm-number
is the number (index) of the n-th element in the mesh; elm-number must be a postive (non-zero) integer. Note that the elm-numbers do not necessarily have to form a dense nor an ordered sequence.

elm-type
defines the geometrical type of the n-th element:
1
2-node line.
2
3-node triangle.
3
4-node quadrangle.
4
4-node tetrahedron.
5
8-node hexahedron.
6
6-node prism.
7
5-node pyramid.
8
3-node second order line (2 nodes associated with the vertices and 1 with the edge).
9
6-node second order triangle (3 nodes associated with the vertices and 3 with the edges).
10
9-node second order quadrangle (4 nodes associated with the vertices, 4 with the edges and 1 with the face).
11
10-node second order tetrahedron (4 nodes associated with the vertices and 6 with the edges).
12
27-node second order hexahedron (8 nodes associated with the vertices, 12 with the edges, 6 with the faces and 1 with the volume).
13
18-node second order prism (6 nodes associated with the vertices, 9 with the edges and 3 with the quadrangular faces).
14
14-node second order pyramid (5 nodes associated with the vertices, 8 with the edges and 1 with the quadrangular face).
15
1-node point.
16
8-node second order quadrangle (4 nodes associated with the vertices and 4 with the edges).
17
20-node second order hexahedron (8 nodes associated with the vertices and 12 with the edges).
18
15-node second order prism (6 nodes associated with the vertices and 9 with the edges).
19
13-node second order pyramid (5 nodes associated with the vertices and 8 with the edges).
See below for the ordering of the nodes.

reg-phys
is the number of the physical entity to which the element belongs; reg-phys must be a postive integer, or zero. If reg-phys is equal to zero, the element is considered not to belong to any physical entity.

reg-elem
is the number of the elementary entity to which the element belongs; reg-elem must be a postive (non-zero) integer.

number-of-nodes
is the number of nodes for the n-th element. This is redundant, but kept for backward compatibility.

node-number-list
is the list of the number-of-nodes node numbers of the n-th element. The ordering of the nodes is given in 9.3 Node ordering.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.4.2 POS ASCII file format

The POS ASCII file is Gmsh's old native pot-processing format, now superseded by the format described in 9.1 MSH ASCII file format. It is defined as follows:

 
$PostFormat
1.4 file-type data-size
$EndPostFormat
$View
view-name nb-time-steps
nb-scalar-points nb-vector-points nb-tensor-points
nb-scalar-lines nb-vector-lines nb-tensor-lines
nb-scalar-triangles nb-vector-triangles nb-tensor-triangles
nb-scalar-quadrangles nb-vector-quadrangles nb-tensor-quadrangles
nb-scalar-tetrahedra nb-vector-tetrahedra nb-tensor-tetrahedra
nb-scalar-hexahedra nb-vector-hexahedra nb-tensor-hexahedra
nb-scalar-prisms nb-vector-prisms nb-tensor-prisms
nb-scalar-pyramids nb-vector-pyramids nb-tensor-pyramids
nb-scalar-lines2 nb-vector-lines2 nb-tensor-lines2
nb-scalar-triangles2 nb-vector-triangles2 nb-tensor-triangles2
nb-scalar-quadrangles2 nb-vector-quadrangles2 nb-tensor-quadrangles2
nb-scalar-tetrahedra2 nb-vector-tetrahedra2 nb-tensor-tetrahedra2
nb-scalar-hexahedra2 nb-vector-hexahedra2 nb-tensor-hexahedra2
nb-scalar-prisms2 nb-vector-prisms2 nb-tensor-prisms2
nb-scalar-pyramids2 nb-vector-pyramids2 nb-tensor-pyramids2
nb-text2d nb-text2d-chars nb-text3d nb-text3d-chars
time-step-values
< scalar-point-value > ... < vector-point-value > ... 
    < tensor-point-value > ...
< scalar-line-value > ... < vector-line-value > ... 
    < tensor-line-value > ...
< scalar-triangle-value > ... < vector-triangle-value > ...
    < tensor-triangle-value > ...
< scalar-quadrangle-value > ... < vector-quadrangle-value > ...
    < tensor-quadrangle-value > ...
< scalar-tetrahedron-value > ... < vector-tetrahedron-value > ...
    < tensor-tetrahedron-value > ...
< scalar-hexahedron-value > ... < vector-hexahedron-value > ...
    < tensor-hexahedron-value > ...
< scalar-prism-value > ... < vector-prism-value > ...
    < tensor-prism-value > ...
< scalar-pyramid-value > ... < vector-pyramid-value > ...
    < tensor-pyramid-value > ...
< scalar-line2-value > ... < vector-line2-value > ...
    < tensor-line2-value > ...
< scalar-triangle2-value > ... < vector-triangle2-value > ...
    < tensor-triangle2-value > ...
< scalar-quadrangle2-value > ... < vector-quadrangle2-value > ...
    < tensor-quadrangle2-value > ...
< scalar-tetrahedron2-value > ... < vector-tetrahedron2-value > ...
    < tensor-tetrahedron2-value > ...
< scalar-hexahedron2-value > ... < vector-hexahedron2-value > ...
    < tensor-hexahedron2-value > ...
< scalar-prism2-value > ... < vector-prism2-value > ...
    < tensor-prism2-value > ...
< scalar-pyramid2-value > ... < vector-pyramid2-value > ...
    < tensor-pyramid2-value > ...
< text2d > ... < text2d-chars > ...
< text3d > ... < text3d-chars > ...
$EndView

where

file-type
is an integer equal to 0 in the ASCII file format.

data-size
is an integer equal to the size of the floating point numbers used in the file (usually, data-size = sizeof(double)).

view-name
is a string containing the name of the view (max. 256 characters).

nb-time-steps
is an integer giving the number of time steps in the view.

nb-scalar-points
nb-vector-points
...
are integers giving the number of scalar points, vector points, ..., in the view.

nb-text2d
nb-text3d
are integers giving the number of 2D and 3D text strings in the view.

nb-text2d-chars
nb-text3d-chars
are integers giving the total number of characters in the 2D and 3D strings.

time-step-values
is a list of nb-time-steps double precision numbers giving the value of the time (or any other variable) for which an evolution was saved.

scalar-point-value
vector-point-value
...
are lists of double precision numbers giving the node coordinates and the values associated with the nodes of the nb-scalar-points scalar points, nb-vector-points vector points, ..., for each of the time-step-values.

For example, vector-triangle-value is defined as:
 
coord1-node1 coord1-node2 coord1-node3
coord2-node1 coord2-node2 coord2-node3
coord3-node1 coord3-node2 coord3-node3
comp1-node1-time1 comp2-node1-time1 comp3-node1-time1
comp1-node2-time1 comp2-node2-time1 comp3-node2-time1
comp1-node3-time1 comp2-node3-time1 comp3-node3-time1
comp1-node1-time2 comp2-node1-time2 comp3-node1-time2
comp1-node2-time2 comp2-node2-time2 comp3-node2-time2
comp1-node3-time2 comp2-node3-time2 comp3-node3-time2
...

The ordering of the nodes is given in 9.3 Node ordering.

text2d
is a list of 4 double precision numbers:
 
coord1 coord2 style index
where coord1 and coord2 give the X-Y position of the 2D string in screen coordinates (measured from the top-left corner of the window) and where index gives the starting index of the string in text2d-chars. If coord1 (respectively coord2) is negative, the position is measured from the right (respectively bottom) edge of the window. If coord1 (respectively coord2) is larger than 99999, the string is centered horizontally (respectively vertically). If style is equal to zero, the text is aligned bottom-left and displayed using the default font and size. Otherwise, style is converted into an integer whose eight lower bits give the font size, whose eight next bits select the font (the index corresponds to the position in the font menu in the GUI), and whose eight next bits define the text alignment (0=bottom-left, 1=bottom-center, 2=bottom-right, 3=top-left, 4=top-center, 5=top-right, 6=center-left, 7=center-center, 8=center-right).

text2d-chars
is a list of nb-text2d-chars characters. Substrings are separated with the null `\0' character.

text3d
is a list of 5 double precision numbers
 
coord1 coord2 coord3 style index
where coord1, coord2 and coord3 give the XYZ coordinates of the string in model (real world) coordinates, index gives the starting index of the string in text3d-chars, and style has the same meaning as in text2d.

text3d-chars
is a list of nb-text3d-chars chars. Substrings are separated with the null `\0' character.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.4.3 POS binary file format

The POS binary file format is the same as the POS ASCII file format described in 9.4.2 POS ASCII file format, except that:

  1. file-type equals 1.
  2. all lists of floating point numbers and characters are written in binary format
  3. there is an additional integer, of value 1, written before time-step-values. This integer is used for detecting if the computer on which the binary file was written and the computer on which the file is read are of the same type (little or big endian).

Here is a pseudo C code to write a post-processing file in binary format:

 
int one = 1;

fprintf(file, "$PostFormat\n");
fprintf(file, "%g %d %d\n", 1.4, 1, sizeof(double));
fprintf(file, "$EndPostFormat\n");
fprintf(file, "$View\n");
fprintf(file, "%s %d "
  "%d %d %d %d %d %d %d %d %d "
  "%d %d %d %d %d %d %d %d %d "
  "%d %d %d %d %d %d %d %d %d "
  "%d %d %d %d %d %d %d %d %d "
  "%d %d %d %d %d %d %d %d %d "
  "%d %d %d %d\n", 
  view-name, nb-time-steps,
  nb-scalar-points, nb-vector-points, nb-tensor-points,
  nb-scalar-lines, nb-vector-lines, nb-tensor-lines,
  nb-scalar-triangles, nb-vector-triangles, nb-tensor-triangles,
  nb-scalar-quadrangles, nb-vector-quadrangles, nb-tensor-quadrangles,
  nb-scalar-tetrahedra, nb-vector-tetrahedra, nb-tensor-tetrahedra,
  nb-scalar-hexahedra, nb-vector-hexahedra, nb-tensor-hexahedra,
  nb-scalar-prisms, nb-vector-prisms, nb-tensor-prisms,
  nb-scalar-pyramids, nb-vector-pyramids, nb-tensor-pyramids,
  nb-scalar-lines2, nb-vector-lines2, nb-tensor-lines2,
  nb-scalar-triangles2, nb-vector-triangles2, nb-tensor-triangles2,
  nb-scalar-quadrangles2, nb-vector-quadrangles2, nb-tensor-quadrangles2,
  nb-scalar-tetrahedra2, nb-vector-tetrahedra2, nb-tensor-tetrahedra2,
  nb-scalar-hexahedra2, nb-vector-hexahedra2, nb-tensor-hexahedra2,
  nb-scalar-prisms2, nb-vector-prisms2, nb-tensor-prisms2,
  nb-scalar-pyramids2, nb-vector-pyramids2, nb-tensor-pyramids2,
  nb-text2d, nb-text2d-chars, nb-text3d, nb-text3d-chars);
fwrite(&one, sizeof(int), 1, file);
fwrite(time-step-values, sizeof(double), nb-time-steps, file);
fwrite(all-scalar-point-values, sizeof(double), ..., file);
...
fprintf(file, "\n$EndView\n");
In this pseudo-code, all-scalar-point-values is the array of double precision numbers containing all the scalar-point-value lists, put one after each other in order to form a long array of doubles. The principle is the same for all other kinds of values.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

Back to geuz.org/gmsh