2374
2396
@var{char-expression}. If the path in @var{char-expression} is not absolute,
2375
2397
@var{char-expression} is appended to the path of the current file.
2377
@item View "@var{string}" @{ @var{string} ( @var{expression-list} ) @{ @var{expression-list} @}; @dots{} @};
2378
Creates a new post-processing view, named @code{"@var{string}"}. This is the
2379
easiest way to create a post-processing view, but also the least efficient
2380
(the view is read through Gmsh's script parser, which can become a bit slow
2381
if the view is very large---e.g., with one million elements). Nevertheless,
2382
this ``parsed'' post-processing format (explained in detail in @ref{Parsed
2383
post-processing file format}) is very powerful, since all the values are
2384
@var{expressions}. Two other formats, better suited for very large data
2385
sets, are described in @ref{ASCII post-processing file format}, and
2386
@ref{Binary post-processing file format}.
2399
@item View "@var{string}" @{ @var{string} < ( @var{expression-list} ) > @{ @var{expression-list} @}; @dots{} @};
2400
Creates a new post-processing view, named @code{"@var{string}"}. This
2401
is an easy and quite powerful way to import post-processing data: all
2402
the values are @var{expressions}, you can embed datasets directly into
2403
your geometrical descriptions (see, e.g., @ref{t4.geo}), the data can be
2404
easily generated ``on-the-fly'' (there is no header containing @emph{a
2405
priori} information on the size of the dataset). The syntax is also very
2406
permissive, which makes it ideal for testing purposes.
2408
However this ``parsed format'' is read by Gmsh's script parser, which
2409
makes it inefficient if there are many elements in the dataset. Also,
2410
there is no connectivity information in parsed views and all the
2411
elements are independent (all fields can be discontinuous), so a lot of
2412
information can be duplicated. For large datasets, you should thus use
2413
the mesh-based post-processing file format described in @ref{File
2414
formats}, or use one of the standard formats like MED.
2416
More explicitly, the syntax for a parsed @code{View} is the following
2420
View "@var{string}" @{
2421
< TIME @{ @var{expression-list} @}; >
2422
@var{type} ( @var{list-of-coords} ) @{ @var{list-of-values} @};
2428
where the 47 object @w{@var{type}s} that can be displayed are:
2431
@var{type} #@var{list-of-coords} #@var{list-of-values}
2432
--------------------------------------------------------------------
2433
Scalar point SP 3 1 * @var{nb-time-steps}
2434
Vector point VP 3 3 * @var{nb-time-steps}
2435
Tensor point TP 3 9 * @var{nb-time-steps}
2436
Scalar line SL 6 2 * @var{nb-time-steps}
2437
Vector line VL 6 6 * @var{nb-time-steps}
2438
Tensor line TL 6 18 * @var{nb-time-steps}
2439
Scalar triangle ST 9 3 * @var{nb-time-steps}
2440
Vector triangle VT 9 9 * @var{nb-time-steps}
2441
Tensor triangle TT 9 27 * @var{nb-time-steps}
2442
Scalar quadrangle SQ 12 4 * @var{nb-time-steps}
2443
Vector quadrangle VQ 12 12 * @var{nb-time-steps}
2444
Tensor quadrangle TQ 12 36 * @var{nb-time-steps}
2445
Scalar tetrahedron SS 12 4 * @var{nb-time-steps}
2446
Vector tetrahedron VS 12 12 * @var{nb-time-steps}
2447
Tensor tetrahedron TS 12 36 * @var{nb-time-steps}
2448
Scalar hexahedron SH 24 8 * @var{nb-time-steps}
2449
Vector hexahedron VH 24 24 * @var{nb-time-steps}
2450
Tensor hexahedron TH 24 72 * @var{nb-time-steps}
2451
Scalar prism SI 18 6 * @var{nb-time-steps}
2452
Vector prism VI 18 18 * @var{nb-time-steps}
2453
Tensor prism TI 18 54 * @var{nb-time-steps}
2454
Scalar pyramid SY 15 5 * @var{nb-time-steps}
2455
Vector pyramid VY 15 15 * @var{nb-time-steps}
2456
Tensor pyramid TY 15 45 * @var{nb-time-steps}
2457
2nd order scalar line SL2 9 3 * @var{nb-time-steps}
2458
2nd order vector line VL2 9 9 * @var{nb-time-steps}
2459
2nd order tensor line TL2 9 27 * @var{nb-time-steps}
2460
2nd order scalar triangle ST2 18 6 * @var{nb-time-steps}
2461
2nd order vector triangle VT2 18 18 * @var{nb-time-steps}
2462
2nd order tensor triangle TT2 18 54 * @var{nb-time-steps}
2463
2nd order scalar quadrangle SQ2 27 9 * @var{nb-time-steps}
2464
2nd order vector quadrangle VQ2 27 27 * @var{nb-time-steps}
2465
2nd order tensor quadrangle TQ2 27 81 * @var{nb-time-steps}
2466
2nd order scalar tetrahedron SS2 30 10 * @var{nb-time-steps}
2467
2nd order vector tetrahedron VS2 30 30 * @var{nb-time-steps}
2468
2nd order tensor tetrahedron TS2 30 90 * @var{nb-time-steps}
2469
2nd order scalar hexahedron SH2 81 27 * @var{nb-time-steps}
2470
2nd order vector hexahedron VH2 81 81 * @var{nb-time-steps}
2471
2nd order tensor hexahedron TH2 81 243* @var{nb-time-steps}
2472
2nd order scalar prism SI2 54 18 * @var{nb-time-steps}
2473
2nd order vector prism VI2 54 54 * @var{nb-time-steps}
2474
2nd order tensor prism TI2 54 162* @var{nb-time-steps}
2475
2nd order scalar pyramid SY2 42 14 * @var{nb-time-steps}
2476
2nd order vector pyramid VY2 42 42 * @var{nb-time-steps}
2477
2nd order tensor pyramid TY2 42 126* @var{nb-time-steps}
2478
2D text T2 3 arbitrary
2479
3D text T3 4 arbitrary
2482
The coordinates are given `by node', i.e.,
2486
@code{(@var{coord1}, @var{coord2}, @var{coord3})} for a point,
2488
@code{(@var{coord1-node1}, @var{coord2-node1}, @var{coord3-node1},}@*
2489
@code{ @var{coord1-node2}, @var{coord2-node2}, @var{coord3-node2})} for a line,
2491
@code{(@var{coord1-node1}, @var{coord2-node1}, @var{coord3-node1},}@*
2492
@code{ @var{coord1-node2}, @var{coord2-node2}, @var{coord3-node2},}@*
2493
@code{ @var{coord1-node3}, @var{coord2-node3}, @var{coord3-node3})} for a triangle,
2498
The ordering of the nodes is given in @ref{Node ordering}. For second
2499
order elements, the first order nodes are given first, followed by the nodes
2500
associated with the edges, followed by the nodes associated with the
2501
quadrangular faces (if any), followed by the nodes associated with the
2502
volume (if any). The ordering of these additional nodes follows the ordering
2503
of the edges and quadrangular faces given in @ref{Node ordering}.
2505
The values are given by time step, by node and by component, i.e.:
2507
@var{comp1-node1-time1}, @var{comp2-node1-time1}, @var{comp3-node1-time1},
2508
@var{comp1-node2-time1}, @var{comp2-node2-time1}, @var{comp3-node2-time1},
2509
@var{comp1-node3-time1}, @var{comp2-node3-time1}, @var{comp3-node3-time1},
2510
@var{comp1-node1-time2}, @var{comp2-node1-time2}, @var{comp3-node1-time2},
2511
@var{comp1-node2-time2}, @var{comp2-node2-time2}, @var{comp3-node2-time2},
2512
@var{comp1-node3-time2}, @var{comp2-node3-time2}, @var{comp3-node3-time2},
2516
For the 2D text objects, the two first @w{@var{expression}s} in
2517
@var{list-of-coords} give the X-Y position of the string in screen
2518
coordinates, measured from the top-left corner of the window. If the first
2519
(respectively second) @var{expression} is negative, the position is measured
2520
from the right (respectively bottom) edge of the window. If the value of the
2521
first (respectively second) @var{expression} is larger than 99999, the
2522
string is centered horizontally (respectively vertically). If the third
2523
@var{expression} is equal to zero, the text is aligned bottom-left and
2524
displayed using the default font and size. Otherwise, the third
2525
@var{expression} is converted into an integer whose eight lower bits give
2526
the font size, whose eight next bits select the font (the index corresponds
2527
to the position in the font menu in the GUI), and whose eight next bits
2528
define the text alignment (0=bottom-left, 1=bottom-center, 2=bottom-right,
2529
3=top-left, 4=top-center, 5=top-right, 6=center-left, 7=center-center,
2532
For the 3D text objects, the three first @w{@var{expression}s} in
2533
@var{list-of-coords} give the XYZ position of the string in model (real
2534
world) coordinates. The fourth @var{expression} has the same meaning as the
2535
third @var{expression} in 2D text objects.
2537
For both 2D and 3D text objects, the @var{list-of-values} can contain an
2538
arbitrary number of @w{@var{char-expression}s}.
2540
The optional @code{TIME} list can contain a list of expressions giving the
2541
value of the time (or any other variable) for which an evolution was saved.
2389
2544
@c -------------------------------------------------------------------------
2801
2956
@cindex File formats
2803
This chapter describes Gmsh's native mesh and post-processing file
2804
formats. (These formats have version numbers that are independent of Gmsh's
2805
main version number.)
2807
All non-parsed file formats have sections enclosed between @code{$Key} and
2808
@code{$EndKey} tags.
2958
This chapter describes Gmsh's native ``MSH'' file format, used to store
2959
meshes and associated post-processing datasets. The MSH format exists in
2960
two flavors: ASCII and binary. The format has a version number
2961
(currently: 2.0) that is independent of Gmsh's main version number.
2811
* Gmsh mesh file formats::
2812
* Gmsh post-processing file formats::
2813
* Gmsh node ordering::
2964
* MSH ASCII file format::
2965
* MSH binary file format::
2816
2970
@c -------------------------------------------------------------------------
2817
@c Gmsh mesh file formats
2971
@c MSH ASCII file format
2818
2972
@c -------------------------------------------------------------------------
2820
@node Gmsh mesh file formats, Gmsh post-processing file formats, File formats, File formats
2821
@section Gmsh mesh file formats
2974
@node MSH ASCII file format, MSH binary file format, File formats, File formats
2975
@section MSH ASCII file format
2823
2977
@cindex Mesh, file format
2824
2978
@cindex File format, mesh
2825
@cindex @file{.msh} file
2827
Please note that the list of nodes and elements in Gmsh's mesh files do
2828
not have to be dense or ordered (i.e., the node and element numbers do
2829
not have to be given in a consecutive or even an ordered way).
2833
* Version 2.0 ASCII::
2834
* Version 2.0 Binary::
2837
@c .........................................................................
2839
@c .........................................................................
2841
@node Version 1.0, Version 2.0 ASCII, Gmsh mesh file formats, Gmsh mesh file formats
2842
@subsection Version 1.0
2844
The @file{.msh} file format, version 1.0, is Gmsh's old native mesh file
2845
format, now superseded by the format described in @ref{Version 2.0 ASCII}.
2847
In the @file{.msh} file format, version 1.0, the file is divided in two
2848
sections, defining the nodes (@code{$NOD}-@code{$ENDNOD}) and the elements
2849
(@code{$ELM}-@code{$ENDELM}) in the mesh:
2853
@var{number-of-nodes}
2854
@var{node-number} @var{x-coord} @var{y-coord} @var{z-coord}
2858
@var{number-of-elements}
2859
@var{elm-number} @var{elm-type} @var{reg-phys} @var{reg-elem} @var{number-of-nodes} @var{node-number-list}
2867
@item @var{number-of-nodes}
2868
is the number of nodes in the mesh.
2870
@item @var{node-number}
2871
is the number (index) of the @var{n}-th node in the mesh. Note that the
2872
@w{@var{node-number}s} do not have to be given in a consecutive (or even an
2875
@item @var{x-coord} @var{y-coord} @var{z-coord}
2876
are the floating point values giving the X, Y and Z coordinates of the
2879
@item @var{number-of-elements}
2880
is the number of elements in the mesh.
2882
@item @var{elm-number}
2883
is the number (index) of the @var{n}-th element in the mesh. Note that the
2884
@w{@var{elm-number}s} do not have to be given in a consecutive (or even an
2887
@item @var{elm-type}
2888
defines the geometrical type of the @var{n}-th element:
2905
3-node second order line (2 nodes associated with the vertices and 1
2908
6-node second order triangle (3 nodes associated with the vertices and 3
2911
9-node second order quadrangle (4 nodes associated with the vertices, 4
2912
with the edges and 1 with the face).
2914
10-node second order tetrahedron (4 nodes associated with the vertices
2915
and 6 with the edges).
2917
27-node second order hexahedron (8 nodes associated with the vertices,
2918
12 with the edges, 6 with the faces and 1 with the volume).
2920
18-node second order prism (6 nodes associated with the vertices, 9 with
2921
the edges and 3 with the quadrangular faces).
2923
14-node second order pyramid (5 nodes associated with the vertices, 8
2924
with the edges and 1 with the quadrangular face).
2928
8-node second order quadrangle (4 nodes associated with the vertices and
2931
20-node second order hexahedron (8 nodes associated with the vertices
2932
and 12 with the edges).
2934
15-node second order prism (6 nodes associated with the vertices and 9
2937
13-node second order pyramid (5 nodes associated with the vertices and 8
2940
See below for the ordering of the nodes.
2942
@item @var{reg-phys}
2943
is the number of the physical entity to which the element belongs.
2945
@item @var{reg-elem}
2946
is the number of the elementary entity to which the element belongs.
2948
@item @var{number-of-nodes}
2949
is the number of nodes for the @var{n}-th element. This is redundant, but
2950
kept for backward compatibility.
2952
@item @var{node-number-list}
2953
is the list of the @var{number-of-nodes} node numbers of the @var{n}-th
2954
element. The ordering of the nodes is given in @ref{Gmsh node ordering}; for
2955
second order elements, the first order nodes are given first, followed by
2956
the nodes associated with the edges, followed by the nodes associated with
2957
the quadrangular faces (if any), followed by the nodes associated with the
2958
volume (if any). The ordering of these additional nodes follows the ordering
2959
of the edges and quadrangular faces given in @ref{Gmsh node ordering}.
2962
@c .........................................................................
2963
@c Version 2.0 ASCII
2964
@c .........................................................................
2966
@node Version 2.0 ASCII, Version 2.0 Binary, Version 1.0, Gmsh mesh file formats
2967
@subsection Version 2.0 ASCII
2969
The version 2.0 of the @file{.msh} file format is Gmsh's new native mesh
2970
file format. It is very similar to the old one (@pxref{Version 1.0}),
2971
but is more general: it contains information about itself and allows to
2972
associate an arbitrary number of integer tags with each element. Ialso
2973
exists in both ASCII and binary form.
2975
The @file{.msh} file format, version 2.0, is divided in three main
2976
sections, defining the file format
2977
(@code{$MeshFormat}-@code{$EndMeshFormat}), the nodes
2978
(@code{$Nodes}-@code{$EndNodes}) and the elements
2979
(@code{$Elements}-@code{$EndElements}) in the mesh:
2981
The MSH ASCII file format contains one mandatory section giving
2982
information about the file (@code{$MeshFormat}), followed by several
2983
optional sections defining the nodes (@code{$Nodes}), elements
2984
(@code{$Elements}), region names (@code{$PhysicalName}) and
2985
post-processing datasets (@code{$NodeData}, @code{$ElementData},
2986
@code{$ElememtNodeData}). Sections can be repeated in the same file, and
2987
post-processing sections can be put into separate files (e.g. one file
2990
The format is defined as follows:
2983
2.0 @var{file-type} @var{data-size}
2994
@var{version-number} @var{file-type} @var{data-size}
2986
2997
@var{number-of-nodes}
3080
3140
See below for the ordering of the nodes.
3082
3142
@item @var{number-of-tags}
3083
gives the number of tags for the @var{n}-th element. By default, Gmsh
3084
generates meshes with two tags and reads files with an arbitrary number of
3088
is an integer tag associated with the @var{n}-th element. By default, the
3089
first tag is the number of the physical entity to which the element belongs;
3090
the second is the number of the elementary geometrical entity to which the
3091
element belongs; the third is the number of a mesh partition to which the
3143
gives the number of integer tags that follow for the @var{n}-th
3144
element. By default, the first @var{tag} is the number of the physical
3145
entity to which the element belongs; the second is the number of the
3146
elementary geometrical entity to which the element belongs; the third is
3147
the number of a mesh partition to which the element belongs. All tags
3148
must be postive integers, or zero. A zero tag is equivalent to no tag.
3094
3150
@item @var{node-number-list}
3095
3151
is the list of the node numbers of the @var{n}-th element. The ordering of
3096
the nodes is given in @ref{Gmsh node ordering}; for second order elements,
3152
the nodes is given in @ref{Node ordering}; for second order elements,
3097
3153
the first order nodes are given first, followed by the nodes associated with
3098
3154
the edges, followed by the nodes associated with the quadrangular faces (if
3099
3155
any), followed by the nodes associated with the volume (if any). The
3100
3156
ordering of these additional nodes follows the ordering of the edges and
3101
quadrangular faces given in @ref{Gmsh node ordering}.
3157
quadrangular faces given in @ref{Node ordering}.
3159
@item @var{number-of-string-tags}
3160
gives the number of string tags that follow. By default the first
3161
@var{string-tag} is interpreted as the name of the post-processing view,
3162
and the second as the name of the interpolation scheme.
3164
@item @var{number-of-real-tags}
3165
gives the number of real number tags that follow.
3167
@item @var{number-of-integer-tags}
3168
gives the number of integer tags that follow. By default the first
3169
@var{integer-tag} is interpreted as a time step number, the second as
3170
the number of field components of the data in the view, the third as the
3171
number of entities (nodes or elements) in the view, and the fourth as
3172
the partition index for the view data.
3174
@item @var{number-of-nodes-per-elements}
3175
gives the number of node values for an element in an element-based view.
3178
is a real number giving the value associated with a node or an
3179
element. For @code{NodeData} (respectively @code{ElementData}) views,
3180
there are @var{ncomp} values per node (resp. per element), where
3181
@var{ncomp} is the number of field components. For
3182
@code{ElementNodeData} views, there are @var{ncomp} times
3183
@var{number-of-nodes-per-elements} values per element.
3104
Additional sections can be present in the file, which an external parser
3105
can simply ignore. One such additional section
3106
(@code{$PhysicalNames}-@code{$EndPhysicalNames}) associates names with
3107
physical entity identification numbers:
3110
@var{number-of-names}
3111
@var{phyical-number} "@var{physical-name}"
3115
@c .........................................................................
3116
@c Version 2.0 BINARY
3117
@c .........................................................................
3119
@node Version 2.0 Binary, , Version 2.0 ASCII, Gmsh mesh file formats
3120
@subsection Version 2.0 Binary
3122
The binary file format is similar to the ASCII format described in
3123
@ref{Version 2.0 ASCII}:
3186
@c -------------------------------------------------------------------------
3187
@c MSH binary file format
3188
@c -------------------------------------------------------------------------
3190
@node MSH binary file format, Node ordering, MSH ASCII file format, File formats
3191
@section MSH binary file format
3193
The binary file format is similar to the ASCII format described above:
3127
2.0 @var{file-type} @var{data-size}
3197
@var{version-number} @var{file-type} @var{data-size}
3128
3198
@var{one-binary}
3220
The same additional sections as in the ASCII format can be present in
3223
@c -------------------------------------------------------------------------
3224
@c Gmsh post-processing file formats
3225
@c -------------------------------------------------------------------------
3227
@node Gmsh post-processing file formats, Gmsh node ordering, Gmsh mesh file formats, File formats
3228
@section Gmsh post-processing file formats
3230
@cindex @file{.pos} file
3232
Gmsh can read and write data sets in three different file formats: the
3233
``parsed'', ``ASCII'' and ``binary'' file formats. The parsed format is the
3234
oldest and most flexible, but also the slowest to read/write. The ASCII and
3235
binary formats are less flexible but allow for faster read/write operations,
3236
which is useful for (very) large data sets.
3238
Gmsh can convert any format to any other, either in a script (cf. @code{Save
3239
View} and @code{PostProcessing.Format} in @ref{Post-processing commands},
3240
and @ref{Post-processing options}, respectively) or in the graphical user
3241
interface (using the `View->Save As' menu).
3297
@c -------------------------------------------------------------------------
3299
@c -------------------------------------------------------------------------
3301
@node Node ordering, Legacy formats, MSH binary file format, File formats
3302
@section Node ordering
3304
@cindex Nodes, ordering
3305
@cindex Edges, ordering
3306
@cindex Faces, ordering
3308
For all mesh and post-processing file formats, the reference elements
3309
are defined as follows. For high-order elements, the ordering of the
3310
edges/quad faces defines the ordering of high-order vertices associated
3313
@c FIXME: changer la doc des faces pour les definir de maniere sensee
3314
@c sans butterflies.
3359
edge 1: nodes 1 2 quad. face 1: nodes 1 2 3 4
3393
edge 1: nodes 1 2 quad. face 1: nodes 1 4 3 2
3397
4----|--3 5: 2 6 5: 3 4 8 7
3398
|\ | |\ 6: 3 4 6: 5 6 7 8
3400
| | ----|---u 8: 4 8
3412
edge 1: nodes 1 2 quad. face 1: nodes 1 2 5 4
3414
3 | 3: 1 4 3: 2 3 6 5
3431
edge 1: nodes 1 2 quad. face 1: nodes 1 4 3 2
3446
@c -------------------------------------------------------------------------
3448
@c -------------------------------------------------------------------------
3450
@node Legacy formats, , Node ordering, File formats
3451
@section Legacy formats
3453
This section describes Gmsh's older native file formats. Future versions
3454
of Gmsh will continue to support these formats, but we recommend that
3455
you do not use them in new aplications.
3457
@c .........................................................................
3458
@c MSH file format version 1.0
3459
@c .........................................................................
3244
* Parsed post-processing file format::
3245
* ASCII post-processing file format::
3246
* Binary post-processing file format::
3462
* MSH file format version 1.0::
3463
* POS ASCII file format::
3464
* POS binary file format::
3249
@c .........................................................................
3250
@c Parsed post-processing file format
3251
@c .........................................................................
3253
@node Parsed post-processing file format, ASCII post-processing file format, Gmsh post-processing file formats, Gmsh post-processing file formats
3254
@subsection Parsed post-processing file format
3256
@cindex Post-processing, parsed file format
3257
@cindex File format, post-processing, parsed
3258
@cindex @file{.pos} file
3260
Gmsh's oldest post-processing format (``parsed'') is read by Gmsh's script
3261
parser (see also @ref{Post-processing commands}). You can thus, for example,
3262
embed parsed post-processing views directly into your geometrical
3263
descriptions (see, e.g., @ref{t4.geo}).
3265
The parsed format is very powerful, since all the values are
3266
@var{expressions}, and it can be easily generated ``on-the-fly'', as there
3267
is no header containing @emph{a priori} information on the size of the data
3268
set. Its syntax is also very permissive, which makes it ideal for testing
3269
purposes. Its main disadvantage resides in the overhead introduced by the
3270
parser, which makes loading a view in parsed format slower than loading a
3271
view in ASCII or binary format. This is only a disadvantage for very large
3274
A post-processing view in parsed format is defined as follows (there can be
3275
one or more views in the same file):
3279
View "@var{string}" @{
3280
< TIME @{ @var{expression-list} @}; >
3281
@var{type} ( @var{list-of-coords} ) @{ @var{list-of-values} @};
3287
where the 47 object @w{@var{type}s} that can be displayed are:
3290
@var{type} #@var{list-of-coords} #@var{list-of-values}
3291
--------------------------------------------------------------------
3292
Scalar point SP 3 1 * @var{nb-time-steps}
3293
Vector point VP 3 3 * @var{nb-time-steps}
3294
Tensor point TP 3 9 * @var{nb-time-steps}
3295
Scalar line SL 6 2 * @var{nb-time-steps}
3296
Vector line VL 6 6 * @var{nb-time-steps}
3297
Tensor line TL 6 18 * @var{nb-time-steps}
3298
Scalar triangle ST 9 3 * @var{nb-time-steps}
3299
Vector triangle VT 9 9 * @var{nb-time-steps}
3300
Tensor triangle TT 9 27 * @var{nb-time-steps}
3301
Scalar quadrangle SQ 12 4 * @var{nb-time-steps}
3302
Vector quadrangle VQ 12 12 * @var{nb-time-steps}
3303
Tensor quadrangle TQ 12 36 * @var{nb-time-steps}
3304
Scalar tetrahedron SS 12 4 * @var{nb-time-steps}
3305
Vector tetrahedron VS 12 12 * @var{nb-time-steps}
3306
Tensor tetrahedron TS 12 36 * @var{nb-time-steps}
3307
Scalar hexahedron SH 24 8 * @var{nb-time-steps}
3308
Vector hexahedron VH 24 24 * @var{nb-time-steps}
3309
Tensor hexahedron TH 24 72 * @var{nb-time-steps}
3310
Scalar prism SI 18 6 * @var{nb-time-steps}
3311
Vector prism VI 18 18 * @var{nb-time-steps}
3312
Tensor prism TI 18 54 * @var{nb-time-steps}
3313
Scalar pyramid SY 15 5 * @var{nb-time-steps}
3314
Vector pyramid VY 15 15 * @var{nb-time-steps}
3315
Tensor pyramid TY 15 45 * @var{nb-time-steps}
3316
Second order scalar line SL2 9 3 * @var{nb-time-steps}
3317
Second order vector line VL2 9 9 * @var{nb-time-steps}
3318
Second order tensor line TL2 9 27 * @var{nb-time-steps}
3319
Second order scalar triangle ST2 18 6 * @var{nb-time-steps}
3320
Second order vector triangle VT2 18 18 * @var{nb-time-steps}
3321
Second order tensor triangle TT2 18 54 * @var{nb-time-steps}
3322
Second order scalar quadrangle SQ2 27 9 * @var{nb-time-steps}
3323
Second order vector quadrangle VQ2 27 27 * @var{nb-time-steps}
3324
Second order tensor quadrangle TQ2 27 81 * @var{nb-time-steps}
3325
Second order scalar tetrahedron SS2 30 10 * @var{nb-time-steps}
3326
Second order vector tetrahedron VS2 30 30 * @var{nb-time-steps}
3327
Second order tensor tetrahedron TS2 30 90 * @var{nb-time-steps}
3328
Second order scalar hexahedron SH2 81 27 * @var{nb-time-steps}
3329
Second order vector hexahedron VH2 81 81 * @var{nb-time-steps}
3330
Second order tensor hexahedron TH2 81 243* @var{nb-time-steps}
3331
Second order scalar prism SI2 54 18 * @var{nb-time-steps}
3332
Second order vector prism VI2 54 54 * @var{nb-time-steps}
3333
Second order tensor prism TI2 54 162* @var{nb-time-steps}
3334
Second order scalar pyramid SY2 42 14 * @var{nb-time-steps}
3335
Second order vector pyramid VY2 42 42 * @var{nb-time-steps}
3336
Second order tensor pyramid TY2 42 126* @var{nb-time-steps}
3337
2D text T2 3 arbitrary
3338
3D text T3 4 arbitrary
3341
The coordinates are given `by node'@footnote{Beware that this is different
3342
from the ordering of the node coordinates in the ASCII and binary
3343
post-processing file formats.}, i.e.,
3347
@code{(@var{coord1}, @var{coord2}, @var{coord3})} for a point,
3349
@code{(@var{coord1-node1}, @var{coord2-node1}, @var{coord3-node1},}@*
3350
@code{ @var{coord1-node2}, @var{coord2-node2}, @var{coord3-node2})} for a line,
3352
@code{(@var{coord1-node1}, @var{coord2-node1}, @var{coord3-node1},}@*
3353
@code{ @var{coord1-node2}, @var{coord2-node2}, @var{coord3-node2},}@*
3354
@code{ @var{coord1-node3}, @var{coord2-node3}, @var{coord3-node3})} for a triangle,
3359
The ordering of the nodes is given in @ref{Gmsh node ordering}. For second
3360
order elements, the first order nodes are given first, followed by the nodes
3361
associated with the edges, followed by the nodes associated with the
3362
quadrangular faces (if any), followed by the nodes associated with the
3363
volume (if any). The ordering of these additional nodes follows the ordering
3364
of the edges and quadrangular faces given in @ref{Gmsh node ordering}.
3366
The values are given by time step, by node and by component, i.e.:
3368
@var{comp1-node1-time1}, @var{comp2-node1-time1}, @var{comp3-node1-time1},
3369
@var{comp1-node2-time1}, @var{comp2-node2-time1}, @var{comp3-node2-time1},
3370
@var{comp1-node3-time1}, @var{comp2-node3-time1}, @var{comp3-node3-time1},
3371
@var{comp1-node1-time2}, @var{comp2-node1-time2}, @var{comp3-node1-time2},
3372
@var{comp1-node2-time2}, @var{comp2-node2-time2}, @var{comp3-node2-time2},
3373
@var{comp1-node3-time2}, @var{comp2-node3-time2}, @var{comp3-node3-time2},
3377
For the 2D text objects, the two first @w{@var{expression}s} in
3378
@var{list-of-coords} give the X-Y position of the string in screen
3379
coordinates, measured from the top-left corner of the window. If the first
3380
(respectively second) @var{expression} is negative, the position is measured
3381
from the right (respectively bottom) edge of the window. If the value of the
3382
first (respectively second) @var{expression} is larger than 99999, the
3383
string is centered horizontally (respectively vertically). If the third
3384
@var{expression} is equal to zero, the text is aligned bottom-left and
3385
displayed using the default font and size. Otherwise, the third
3386
@var{expression} is converted into an integer whose eight lower bits give
3387
the font size, whose eight next bits select the font (the index corresponds
3388
to the position in the font menu in the GUI), and whose eight next bits
3389
define the text alignment (0=bottom-left, 1=bottom-center, 2=bottom-right,
3390
3=top-left, 4=top-center, 5=top-right, 6=center-left, 7=center-center,
3393
For the 3D text objects, the three first @w{@var{expression}s} in
3394
@var{list-of-coords} give the XYZ position of the string in model (real
3395
world) coordinates. The fourth @var{expression} has the same meaning as the
3396
third @var{expression} in 2D text objects.
3398
For both 2D and 3D text objects, the @var{list-of-values} can contain an
3399
arbitrary number of @w{@var{char-expression}s}.
3401
The optional @code{TIME} list can contain a list of expressions giving the
3402
value of the time (or any other variable) for which an evolution was saved.
3404
@c .........................................................................
3405
@c ASCII post-processing file format
3406
@c .........................................................................
3408
@node ASCII post-processing file format, Binary post-processing file format, Parsed post-processing file format, Gmsh post-processing file formats
3409
@subsection ASCII post-processing file format
3411
@cindex Post-processing, ASCII file format
3412
@cindex File format, post-processing, ASCII
3414
The ASCII post-processing file is divided in several sections: one format
3415
section, enclosed between @code{$PostFormat}-@code{$EndPostFormat} tags, and
3416
one or more post-processing views, enclosed between
3417
@code{$View}-@code{$EndView} tags:
3467
@node MSH file format version 1.0, POS ASCII file format, Legacy formats, Legacy formats
3468
@subsection MSH file format version 1.0
3470
The MSH file format version 1.0 is Gmsh's old native mesh file format,
3471
now superseded by the format described in @ref{MSH ASCII file
3472
format}. It is defined as follows:
3476
@var{number-of-nodes}
3477
@var{node-number} @var{x-coord} @var{y-coord} @var{z-coord}
3481
@var{number-of-elements}
3482
@var{elm-number} @var{elm-type} @var{reg-phys} @var{reg-elem} @var{number-of-nodes} @var{node-number-list}
3490
@item @var{number-of-nodes}
3491
is the number of nodes in the mesh.
3493
@item @var{node-number}
3494
is the number (index) of the @var{n}-th node in the mesh;
3495
@var{node-number} must be a postive (non-zero) integer. Note that the
3496
@w{@var{node-number}s} do not necessarily have to form a dense nor an
3499
@item @var{x-coord} @var{y-coord} @var{z-coord}
3500
are the floating point values giving the X, Y and Z coordinates of the
3503
@item @var{number-of-elements}
3504
is the number of elements in the mesh.
3506
@item @var{elm-number}
3507
is the number (index) of the @var{n}-th element in the mesh;
3508
@var{elm-number} must be a postive (non-zero) integer. Note that the
3509
@w{@var{elm-number}s} do not necessarily have to form a dense nor an
3512
@item @var{elm-type}
3513
defines the geometrical type of the @var{n}-th element:
3530
3-node second order line (2 nodes associated with the vertices and 1
3533
6-node second order triangle (3 nodes associated with the vertices and 3
3536
9-node second order quadrangle (4 nodes associated with the vertices, 4
3537
with the edges and 1 with the face).
3539
10-node second order tetrahedron (4 nodes associated with the vertices
3540
and 6 with the edges).
3542
27-node second order hexahedron (8 nodes associated with the vertices,
3543
12 with the edges, 6 with the faces and 1 with the volume).
3545
18-node second order prism (6 nodes associated with the vertices, 9 with
3546
the edges and 3 with the quadrangular faces).
3548
14-node second order pyramid (5 nodes associated with the vertices, 8
3549
with the edges and 1 with the quadrangular face).
3553
8-node second order quadrangle (4 nodes associated with the vertices and
3556
20-node second order hexahedron (8 nodes associated with the vertices
3557
and 12 with the edges).
3559
15-node second order prism (6 nodes associated with the vertices and 9
3562
13-node second order pyramid (5 nodes associated with the vertices and 8
3565
See below for the ordering of the nodes.
3567
@item @var{reg-phys}
3568
is the number of the physical entity to which the element belongs;
3569
@var{reg-phys} must be a postive integer, or zero. If @var{reg-phys} is
3570
equal to zero, the element is considered not to belong to any physical
3573
@item @var{reg-elem}
3574
is the number of the elementary entity to which the element belongs;
3575
@var{reg-elem} must be a postive (non-zero) integer.
3577
@item @var{number-of-nodes}
3578
is the number of nodes for the @var{n}-th element. This is redundant, but
3579
kept for backward compatibility.
3581
@item @var{node-number-list}
3582
is the list of the @var{number-of-nodes} node numbers of the @var{n}-th
3583
element. The ordering of the nodes is given in @ref{Node ordering}; for
3584
second order elements, the first order nodes are given first, followed
3585
by the nodes associated with the edges, followed by the nodes associated
3586
with the quadrangular faces (if any), followed by the nodes associated
3587
with the volume (if any). The ordering of these additional nodes follows
3588
the ordering of the edges and quadrangular faces given in @ref{Node
3592
@c .........................................................................
3593
@c POS ASCII file format
3594
@c .........................................................................
3596
@node POS ASCII file format, POS binary file format, MSH file format version 1.0, Legacy formats
3597
@subsection POS ASCII file format
3599
The POS ASCII file is Gmsh's old native pot-processing format, now
3600
superseded by the format described in @ref{MSH ASCII file format}. It is