From f7506fe5f8fe06ce72d1909772f291cb3f853360 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Tue, 15 Apr 2003 05:05:11 +0000 Subject: [PATCH] Move FORMATS into the texinfo documentation --- Makefile | 7 +- doc/FORMATS | 375 ------------------------------ doc/gmsh.html | 9 +- doc/texinfo/gmsh.texi | 527 ++++++++++++++++++++++++++++++++++++++++-- doc/texinfo/t1.geo | 2 +- doc/texinfo/t8.geo | 19 +- tutorial/t1.geo | 2 +- tutorial/t8.geo | 19 +- tutorial/view1.pos | 5 - utils/gmsh.spec | 2 +- 10 files changed, 520 insertions(+), 447 deletions(-) delete mode 100644 doc/FORMATS diff --git a/Makefile b/Makefile index 6f7bd18ace..68386394a3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.280 2003-04-14 22:46:58 geuzaine Exp $ +# $Id: Makefile,v 1.281 2003-04-15 05:05:10 geuzaine Exp $ # # Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle # @@ -167,8 +167,7 @@ package-unix: mkdir gmsh-${GMSH_RELEASE} strip bin/gmsh cp bin/gmsh gmsh-${GMSH_RELEASE} - cp doc/COPYING doc/gmsh.1 doc/FORMATS doc/VERSIONS doc/FAQ\ - doc/CONTRIBUTORS gmsh-${GMSH_RELEASE} + cp doc/gmsh.1 doc/COPYING doc/VERSIONS doc/FAQ doc/CONTRIBUTORS gmsh-${GMSH_RELEASE} cp -R tutorial gmsh-${GMSH_RELEASE} cp -R demos gmsh-${GMSH_RELEASE} rm -rf gmsh-${GMSH_RELEASE}/*/CVS @@ -185,7 +184,6 @@ package-windows: cp /usr/bin/cygwin1.dll gmsh-${GMSH_RELEASE} cp bin/gmsh.exe gmsh-${GMSH_RELEASE} cp doc/README.win32 gmsh-${GMSH_RELEASE}/README.txt - cp doc/FORMATS gmsh-${GMSH_RELEASE}/FORMATS.txt cp doc/VERSIONS gmsh-${GMSH_RELEASE}/VERSIONS.txt cp doc/FAQ gmsh-${GMSH_RELEASE}/FAQ.txt cp doc/CONTRIBUTORS gmsh-${GMSH_RELEASE}/CONTRIBUTORS.txt @@ -229,7 +227,6 @@ package-mac: cp bin/gmsh gmsh-${GMSH_RELEASE}/Gmsh.app/Contents/MacOS/Gmsh cp Fltk/MacIcons.icns gmsh-${GMSH_RELEASE}/Gmsh.app/Contents/Resources/gmsh.icns cp -R doc/gmsh.1 tutorial demos gmsh-${GMSH_RELEASE} - cp doc/FORMATS gmsh-${GMSH_RELEASE}/FORMATS.txt cp doc/VERSIONS gmsh-${GMSH_RELEASE}/VERSIONS.txt cp doc/FAQ gmsh-${GMSH_RELEASE}/FAQ.txt cp doc/CONTRIBUTORS gmsh-${GMSH_RELEASE}/CONTRIBUTORS.txt diff --git a/doc/FORMATS b/doc/FORMATS deleted file mode 100644 index b8a3218665..0000000000 --- a/doc/FORMATS +++ /dev/null @@ -1,375 +0,0 @@ -$Id: FORMATS,v 1.17 2003-03-28 22:49:28 geuzaine Exp $ - -This document describes the version 1.2 of Gmsh's mesh and -post-processing file formats. - -(This document deals only with the import/export interfaces for -Gmsh. The language driving the behaviour of Gmsh for defining -geometries, options, scripts, etc. is explained step by step in the -tutorials.) - -******************************************************************** - -Section 1: Gmsh Mesh File Format - -The 'msh' file format is the native output file format for Gmsh. The -file is divided in two sections (enclosed in $KEY and $ENDKEY pairs): -$NOD/$ENDNOD defines the nodes and $ELM/$ENDELM defines the elements. - - $NOD - number-of-nodes - node-number coord1 coord2 coord3 - ... - $ENDNOD - - $ELM - number-of-elements - elm-number elm-type elm-region unused nb-nodes node-numbers - ... - $ENDELM - -All the syntactic variables stand for integers except coord1, coord2 -and coord3 which stand for floating point values, and node-numbers -which stand for a list of nb-nodes integers. - -Please note that the the node-number and elm-number numbers are not -necessarily given in a consecutive or even an ordered way. - -The elm-type value defines the geometrical type for the element: - - 1 Line (2 nodes, 1 edge). - 2 Triangle (3 nodes, 3 edges). - 3 Quadrangle (4 nodes, 4 edges). - 4 Tetrahedron (4 nodes, 6 edges, 4 facets). - 5 Hexahedron (8 nodes, 12 edges, 6 facets). - 6 Prism (6 nodes, 9 edges, 5 facets). - 7 Pyramid (5 nodes, 8 edges, 5 facets). - 15 Point (1 node). - -The elm-region value is the number of the physical entity to which the -element belongs. - -******************************************************************** - -Section 2: Gmsh ASCII Post-Processing File Format - -An ASCII post-processing file is divided in several sections: one -format section, enclosed between $PostFormat/$EndPostFormat, and -(possibly multiple) post-processing views, enclosed between -$View/$EndView pairs: - - $PostFormat - 1.2 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-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 ... - text2d ... text2d-chars ... - text3d ... text3d-chars ... - $EndView - -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-step is an integer giving the number of time steps in the view - -nb-scalar-points, nb-vector-points, etc. are integers giving the -number of scalar points, vector points, etc. in the view. - -nb-text2d and nb-text3d are integers giving the number of 2D text -strings and 3d text strings in the view. nb-text2d-chars and -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, etc. are lists of double -precision numbers giving the node coordinates and the values -associated with the nodes of the nb-scalar-points, nb-vector-points, -etc. for each time-step-value. 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 - ... - -text2d is a list of 4 double precision numbers: - coord1 coord2 style index -where index gives the starting index of the correspinding 2d text -string in text2d-chars. - -text2d-chars is a list of nb-text2d-chars chars. Substrings are -separated with the '^' characted (which is a forbidden character in -regular strings). - -text3d is a list of 5 double precision numbers: - coord1 coord2 coord3 style index -where index gives the starting index of the correspinding 3d text -string in text3d-chars. - -text3d-chars is a list of nb-text3d-chars chars. Substrings are -separated with the '^' characted. - -******************************************************************** - -Section 3: Gmsh Binary Post-Processing File Format - -The binary post-processing file format is the same as the 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 the beginning of a post-processing -file in binary format: - -int one = 1; - -fprintf(file, "$PostFormat\n"); -fprintf(file, "%g %d %d\n", 1.2, 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\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-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. - -******************************************************************** - -Section 4: Gmsh Parsed Post-Processing Format - -For relatively small data sets Gmsh provides an additional -post-processing format, which is parsed by the same grammar analyzer -as the geometry. You can thus, for example, embed small -post-processing views directly into your geometrical descriptions (see -the tutorial). This format is also very useful for testing purposes: -its syntax is very permissive, and you can easily generate it by hand -or on the fly. The format of the parsed post-processing file is the -following: - - View "name" { - type-of-element (list-of-coordinates) {list-of-values} ; - ... - }; - - 26 base objects can be displayed: - - type-of-element list-of-coordinates list-of-values - -------------------------------------------------------------------------------- - scalar point SP 3 1 * nb-time-steps - vector point VP 3 3 * nb-time-steps - tensor point TP 3 9 * nb-time-steps - scalar line SL 6 2 * nb-time-steps - vector line VL 6 6 * nb-time-steps - tensor line TL 6 18 * nb-time-steps - scalar triangle ST 9 3 * nb-time-steps - vector triangle VT 9 9 * nb-time-steps - tensor triangle TT 9 27 * nb-time-steps - scalar quadrangle SQ 12 4 * nb-time-steps - vector quadrangle VQ 12 12 * nb-time-steps - tensor quadrangle TQ 12 36 * nb-time-steps - scalar tetrahedron SS 12 4 * nb-time-steps - vector tetrahedron VS 12 12 * nb-time-steps - tensor tetrahedron TS 12 36 * nb-time-steps - scalar hexahedron SH 24 8 * nb-time-steps - vector hexahedron VH 24 24 * nb-time-steps - tensor hexahedron TH 24 72 * nb-time-steps - scalar prism SI 18 6 * nb-time-steps - vector prism VI 18 18 * nb-time-steps - tensor prism TI 18 54 * nb-time-steps - scalar pyramid SY 15 5 * nb-time-steps - vector pyramid VY 15 15 * nb-time-steps - tensor pyramid TY 15 45 * nb-time-steps - text 2d T2 4 arbitrary - text 3d T3 5 arbitrary - -Contrary to the ASCII and Binary post-processing file formats (see -below), the coordinates are given by node, i.e. - -(coord1, coord2,coord3) for a point, - -(coord1-node1, coord2-node1, coord3-node1, - coord1-node2, coord2-node2, coord3-node2) for a line, - -(coord1-node1, coord2-node1, coord3-node1, - coord1-node2, coord2-node2, coord3-node2, - coord1-node3, coord2-node3, coord3-node3) for a triangle, - -etc. The values are given in the same order as for the ASCII and -Binary post-processing file formats. - -******************************************************************** - -Section 5: Gmsh node ordering - -* POINT - v - | - | - -----1-----u - | - | - -* LINE edge 1: nodes 1 -> 2 - v - | - | - --1-----2--u - | - | - -* TRIANGLE edge 1: nodes 1 -> 2 - v 2: 1 -> 3 - | 3: 2 -> 3 - | - 3 face 1: edges 1 -2 3 nodes 1 2 3 - |\ - | \ - |__\___u - 1 2 - -* QUADRANGLE edge 1: nodes 1 -> 2 - v 2: 1 -> 4 - | 3: 2 -> 3 - 4--|--3 4: 3 -> 4 - | | | - -----------u face 1: edges 1 -2 3 4 nodes 1 2 3 4 - | | | - 1--|--2 - | - -* TETRAHEDRON edge 1: nodes 1 -> 2 - v 2: 1 -> 3 - | 3: 1 -> 4 - | 4: 2 -> 3 - | 5: 2 -> 4 - 3 6: 3 -> 4 - |\ - | \ face 1: edges 1 -3 5 nodes 1 2 4 - |__\2_____u 2: -1 2 -4 1 3 2 - 1\ / 3: -2 3 -6 1 4 3 - \4 4: 4 -5 6 2 3 4 - \ - w - -* HEXAHEDRON edge 1: nodes 1 -> 2 - v 2: 1 -> 4 - | 3: 1 -> 5 - | 4: 2 -> 3 - 4----|--3 5: 2 -> 6 - |\ | |\ 6: 3 -> 4 - | 8-------7 7: 3 -> 7 - | | ----|---u 8: 4 -> 8 - 1-|---\-2 | 9: 5 -> 6 - \| \ \| 10: 5 -> 8 - 5-----\-6 11: 6 -> 7 - \ 12: 7 -> 8 - w - face 1: edges 1 -3 5 -9 nodes 1 2 6 5 - 2: -1 2 -4 -6 1 4 3 2 - 3: -2 3 -8 10 1 5 8 4 - 4: 4 -5 7 -11 2 3 7 6 - 5: 6 -7 8 -12 3 4 8 7 - 6: 9 -10 11 12 5 6 7 8 - -* PRISM edge 1: nodes 1 -> 2 - v 2: 1 -> 3 - 3 | 3: 1 -> 4 - |\| 4: 2 -> 3 - | | 5: 2 -> 5 - 1_|2 6: 3 -> 6 - \| 6 7: 4 -> 5 - |_|_\___u 8: 4 -> 6 - \| \ 9: 5 -> 6 - 4 __5 - \ face 1: edges 1 -3 5 -7 nodes 1 2 5 4 - \ 2: -1 2 -4 1 3 2 - w 3: -2 3 -6 8 1 4 6 3 - 4: 4 -5 6 -9 2 3 6 5 - 5: 7 -8 9 4 5 6 - -* PYRAMID edge 1: nodes 1 -> 2 - v 2: 1 -> 4 - | 3: 1 -> 5 - | 4: 2 -> 3 - 4---|---3 5: 2 -> 5 - | \ | /| 6: 3 -> 4 - | \ -/-|---u 7: 3 -> 5 - | / 5\ | 8: 4 -> 5 - 1/----\-2 - \ facet 1: edges 1 5 -3 nodes 1 2 5 - \ 2: 2 -6 -4 -1 1 4 3 2 - w 3: 3 -8 -2 1 5 4 - 4: 4 7 -5 2 3 5 - 5: 6 8 -7 3 4 5 diff --git a/doc/gmsh.html b/doc/gmsh.html index aa22acd429..311dd52bb8 100644 --- a/doc/gmsh.html +++ b/doc/gmsh.html @@ -153,13 +153,14 @@ of complex animations). <h2><a name="Documentation"></a>Documentation</h2> <ul> - <li><a href="/gmsh/doc/tutorial.html">Online tutorial</a> - (Please <em>read</em> this tutorial before sending any question to the mailing list!) + <li><a href="/gmsh/doc/texinfo/gmsh.html">Reference manual</a> + (also available in + <a href="/gmsh/doc/texinfo/gmsh.ps">postscript</a>, + <a href="/gmsh/doc/texinfo/gmsh.pdf">pdf</a> and + <a href="/gmsh/doc/texinfo/gmsh-info.tgz">info</a> formats) <li><a href="/gmsh/doc/FAQ">Frequently asked questions (FAQ)</a> <li><a href="/gmsh/doc/VERSIONS">Version history</a> - <li><a href="/gmsh/doc/FORMATS">Mesh and post-processing file formats</a> <li><a href="/gmsh/doc/CONTRIBUTORS">List of contributors</a> - <li><a href="/gmsh/doc/README.txt">For Windows versions only</a> <li><a name="mysolver"></a>Interactive solver examples: <a href="/gmsh/doc/mysolver.tgz">C solver</a>, <a href="/gmsh/doc/myperlsolver.tgz">Perl solver</a> diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi index 737bd5c9bd..b4fd5e333f 100644 --- a/doc/texinfo/gmsh.texi +++ b/doc/texinfo/gmsh.texi @@ -1,5 +1,5 @@ \input texinfo.tex @c -*-texinfo-*- -@c $Id: gmsh.texi,v 1.14 2003-04-15 01:03:26 geuzaine Exp $ +@c $Id: gmsh.texi,v 1.15 2003-04-15 05:05:10 geuzaine Exp $ @c @c Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle @c @@ -221,6 +221,14 @@ Running Gmsh * Mouse actions:: * Keyboard shortcuts:: +File formats + +* Gmsh mesh file format:: +* Gmsh ASCII post-processing file format:: +* Gmsh binary post-processing file format:: +* Gmsh parsed post-processing file format:: +* Gmsh node ordering:: + Bugs, versions and contributors * Bugs:: @@ -548,8 +556,6 @@ Optional rules are enclosed in @code{<} @code{>} pairs. Multiple choices are separated by @code{|}. @item Three dots (@dots{}) indicate a possible repetition of the preceding rule. -@item -The @var{etc} symbol replaces nonlisted rules. @end enumerate @c ========================================================================= @@ -1636,20 +1642,36 @@ pop up menu on post-processing view button @node File formats, Programming comments, Running Gmsh, Top @chapter File formats -XXX include FORMATS +@cindex File formats This chapter describes the file formats that cannot be modified by the -user. +user. These format have a version number (currently 1.2), independent of the +Gmsh version number (currently @value{GMSH-VERSION}). + +All non-parsed file formats have sections enclosed between @code{$KEY} and +@code{$ENDKEY} symbol pairs. + +@menu +* Gmsh mesh file format:: +* Gmsh ASCII post-processing file format:: +* Gmsh binary post-processing file format:: +* Gmsh parsed post-processing file format:: +* Gmsh node ordering:: +@end menu + +@c ------------------------------------------------------------------------- +@c Gmsh mesh file format +@c ------------------------------------------------------------------------- + +@node Gmsh mesh file format, Gmsh ASCII post-processing file format, File formats, File formats +@section Gmsh mesh file format -@cindex Input file format -@cindex Gmsh, file format @cindex Mesh, file format -@cindex File, mesh -@cindex File, @file{.msh} @cindex @file{.msh} file -The native Gmsh mesh format read is divided into two sections, defining the -nodes and the elements in the mesh. +The @file{.msh} file format is Gmsh's native mesh file format. The file is +divided into two sections, defining the nodes (@code{NOD}-@code{ENDNOD}) and +the elements (@code{ELM}-@code{ENDELM}) in the mesh: @example $NOD @@ -1659,19 +1681,38 @@ $NOD $ENDNOD $ELM @var{number-of-elements} -@var{elm-number} @var{elm-type} @var{elm-region} @var{unused} @var{number-of-nodes} @var{node-numbers} +@var{elm-number} @var{elm-type} @var{reg-phys} @var{reg-elemem} @var{number-of-nodes} @var{node-number-list} @dots{} $ENDELM @end example @noindent -All the syntactic variables stand for integers except @var{x-coord}, -@var{y-coord} and @var{z-coord} which stand for floating point values. -The @var{elm-type} value defines the geometrical type for the element: - -@noindent -@var{elm-type}: - +where +@table @code +@item @var{number-of-nodes} +is the number of nodes in the mesh + +@item @var{node-number} +is the number (index) of the n-th node in the mesh. Note that the +@var{node-number}s should not necessarily given in a consecutive (or even an +ordered) way. + +@item @var{x-coord} +@item @var{y-coord} +@item @var{z-coord} +are the floating point values giving the X, Y and Z coordinate of the n-th +node. + +@item @var{number-of-elements} +is the number of elements in the mesh + +@item @var{elm-number} +is the number (index) of the n-th element in the mesh. Note that the +@var{elm-number}s should not necessarily given in a consecutive (or even an +ordered) way. + +@item @var{elm-type} +defines the geometrical type for the n-th element: @table @code @item 1 Line (2 nodes, 1 edge). @@ -1691,6 +1732,454 @@ Pyramid (5 nodes, 8 edges, 5 facets). Point (1 node). @end table +@item @var{reg-phys} +is the number of the physical entity to which the element belongs. + +@item @var{reg-elem} +is the number of the elementary entity to which the element belongs. + +@item @var{number-of-nodes} +is the number of nodes for the n-th element. This is redundant, but kept for +backward compatibility reasons. The redundancy may disappear in the future +if higher order elements are implemented using the same @var{elm-type}s as +the current ones. + +@item @var{node-number-list} +is a list of @var{number-of-nodes} node numbers (separated by white space, +without commas). + +@end table + +@c ------------------------------------------------------------------------- +@c Gmsh ASCII post-processing file format +@c ------------------------------------------------------------------------- + +@node Gmsh ASCII post-processing file format, Gmsh binary post-processing file format, Gmsh mesh file format, File formats +@section Gmsh ASCII post-processing file format + +@cindex Post-processing, ASCII file format +@cindex @file{.pos} file + +The ASCII post-processing file is divided in several sections: one format +section, enclosed between @code{$PostFormat}-@code{$EndPostFormat}, and one +or more post-processing views, enclosed between @code{$View}-@code{$EndView} +tags: + +@example +$PostFormat +1.2 @var{file-type} @var{data-size} +$EndPostFormat +$View +@var{view-name} @var{nb-time-steps} +@var{nb-scalar-points} @var{nb-vector-points} @var{nb-tensor-points} +@var{nb-scalar-lines} @var{nb-vector-lines} @var{nb-tensor-lines} +@var{nb-scalar-triangles} @var{nb-vector-triangles} @var{nb-tensor-triangles} +@var{nb-scalar-quadrangles} @var{nb-vector-quadrangles} @var{nb-tensor-quadrangles} +@var{nb-scalar-tetrahedra} @var{nb-vector-tetrahedra} @var{nb-tensor-tetrahedra} +@var{nb-scalar-hexahedra} @var{nb-vector-hexahedra} @var{nb-tensor-hexahedra} +@var{nb-scalar-prisms} @var{nb-vector-prisms} @var{nb-tensor-prisms} +@var{nb-scalar-pyramids} @var{nb-vector-pyramids} @var{nb-tensor-pyramids} +@var{nb-text2d} @var{nb-text2d-chars} @var{nb-text3d} @var{nb-text3d-chars} +@var{time-step-values} +< @var{scalar-point-value} > @dots{} +< @var{vector-point-value} > @dots{} +< @var{tensor-point-value} > @dots{} +< @var{scalar-line-value} > @dots{} +< @var{vector-line-value} > @dots{} +< @var{tensor-line-value} > @dots{} +< @var{scalar-triangle-value} > @dots{} +< @var{vector-triangle-value} > @dots{} +< @var{tensor-triangle-value} > @dots{} +< @var{scalar-quadrangle-value} > @dots{} +< @var{vector-quadrangle-value} > @dots{} +< @var{tensor-quadrangle-value} > @dots{} +< @var{scalar-tetrahedron-value} > @dots{} +< @var{vector-tetrahedron-value} > @dots{} +< @var{tensor-tetrahedron-value} > @dots{} +< @var{scalar-hexahedron-value} > @dots{} +< @var{vector-hexahedron-value} > @dots{} +< @var{tensor-hexahedron-value} > @dots{} +< @var{scalar-prism-value} > @dots{} +< @var{vector-prism-value} > @dots{} +< @var{tensor-prism-value} > @dots{} +< @var{scalar-pyramid-value} > @dots{} +< @var{vector-pyramid-value} > @dots{} +< @var{tensor-pyramid-value} > @dots{} +< @var{text2d} > @dots{} < @var{text2d-chars} > @dots{} +< @var{text3d} > @dots{} < @var{text3d-chars} > @dots{} +$EndView +@end example + +@noindent +where +@table @code +@item @var{file-type} +is an integer equal to 0 in the ASCII file format. + +@item @var{data-size} +is an integer equal to the size of the floating point numbers used in the +file (usually, data-size == sizeof(double)). + +@item @var{view-name} +is a string containing the name of the view (max. 256 characters) + +@item @var{nb-time-step} +is an integer giving the number of time steps in the view + +@item @var{nb-scalar-points} +@item @var{nb-vector-points} +@item @dots{} +are integers giving the number of scalar points, vector points, @dots{} in +the view. + +@item @var{nb-text2d} +@item @var{nb-text3d} +are integers giving the number of 2D and 3D text strings in the +view. + +@item @var{nb-text2d-chars} +@item @var{nb-text3d-chars} +are integers giving the total number of characters in the 2D and 3D strings. + +@item @var{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. + +@item @var{scalar-point-value} +@item @var{vector-point-value} +@item @dots{} +are lists of double precision numbers giving the node coordinates and the +values associated with the nodes of the @item @var{nb-scalar-points} scalar +points, @item @var{nb-vector-points} vector points, @dots{}, for each +of the @var{time-step-values}. + +For example, vector-triangle-value is defined as: +@example +@var{coord1-node1} @var{coord1-node2} @var{coord1-node3} +@var{coord2-node1} @var{coord2-node2} @var{coord2-node3} +@var{coord3-node1} @var{coord3-node2} @var{coord3-node3} +@var{comp1-node1-time1} @var{comp2-node1-time1} @var{comp3-node1-time1} +@var{comp1-node2-time1} @var{comp2-node2-time1} @var{comp3-node2-time1} +@var{comp1-node3-time1} @var{comp2-node3-time1} @var{comp3-node3-time1} +@var{comp1-node1-time2} @var{comp2-node1-time2} @var{comp3-node1-time2} +@var{comp1-node2-time2} @var{comp2-node2-time2} @var{comp3-node2-time2} +@var{comp1-node3-time2} @var{comp2-node3-time2} @var{comp3-node3-time2} +@dots{} +@end example + +@item @var{text2d} +is a list of 4 double precision numbers: +@example +@var{coord1} @var{coord2} @var{style} @var{index} +@end example +where @var{coord1} and @var{coord2} give the coordinates of the leftmost +element of the 2D string in screen coordinates, @var{index} gives the +starting index of the string in @var{text2d-chars} and @var{style} is +currently unused. + +@item @var{text2d-chars} +is a list of @item @var{nb-text2d-chars} characters. Substrings are +separated with the @code{^} characted (which is a forbidden character in +regular strings). + +@item @var{text3d} +is a list of 5 double precision numbers +@example +@var{coord1} @var{coord2} @var{coord3} @var{style} @var{index} +@end example +where @var{coord1}, @var{coord2} and @var{coord3} give the coordinates of +the leftmost element of the 3D string in model (real world) coordinates, +@var{index} gives the starting index of the string in @var{text3d-chars} and +@var{style} is currently unused. + +@item @var{text3d-chars} +is a list of @var{nb-text3d-chars} chars. Substrings are separated with the +@code{^} characted. + +@end table + +@c ------------------------------------------------------------------------- +@c Gmsh binary post-processing file format +@c ------------------------------------------------------------------------- + +@node Gmsh binary post-processing file format, Gmsh parsed post-processing file format, Gmsh ASCII post-processing file format, File formats +@section Gmsh binary post-processing file format + +@cindex Post-processing, binary file format +@cindex @file{.pos} file + +The binary post-processing file format is the same as the ASCII file format +described in @ref{Gmsh ASCII post-processing file format}, except that: + +@enumerate +@item +@var{file-type} equals 1. +@item +all lists of floating point numbers and characters are written in binary +format +@item +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). +@end enumerate + +Here is a pseudo C code to write the beginning of a post-processing +file in binary format: + +@example +int one = 1; + +fprintf(file, "$PostFormat\n"); +fprintf(file, "%g %d %d\n", 1.2, 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\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-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"); +@end example +In this pseudo-code, @var{all-scalar-point-values} is the array of double +precision numbers containing all the @var{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. + +@c ------------------------------------------------------------------------- +@c Gmsh parsed post-processing file format +@c ------------------------------------------------------------------------- + +@node Gmsh parsed post-processing file format, Gmsh node ordering, Gmsh binary post-processing file format, File formats +@section Gmsh parsed post-processing file format + +@cindex Post-processing, parsed file format +@cindex @file{.pos} file + +For relatively small data sets Gmsh provides an additional post-processing +format, which is parsed by the same grammar analyzer as the Gmsh script +language. You can thus, for example, embed small post-processing views +directly into your geometrical descriptions (see e.g. @ref{t4.geo}). This +format is also useful for testing purposes: its syntax is very permissive, +and you can easily generate it by hand or on the fly. The format of the +parsed post-processing file is the following: + +@example +View "@var{string}" @{ + @var{type} ( @var{list-of-coords} ) @{ @var{list-of-values} @}; + @dots{} +@}; +@end example + +The same 26 base objects can be displayed as in the ASCII or binary +post-processing file formats: + +@example + type #list-of-coords #list-of-values +------------------------------------------------------------ +scalar point SP 3 1 * @var{nb-time-step} +vector point VP 3 3 * @var{nb-time-step} +tensor point TP 3 9 * @var{nb-time-step} +scalar line SL 6 2 * @var{nb-time-step} +vector line VL 6 6 * @var{nb-time-step} +tensor line TL 6 18 * @var{nb-time-step} +scalar triangle ST 9 3 * @var{nb-time-step} +vector triangle VT 9 9 * @var{nb-time-step} +tensor triangle TT 9 27 * @var{nb-time-step} +scalar quadrangle SQ 12 4 * @var{nb-time-step} +vector quadrangle VQ 12 12 * @var{nb-time-step} +tensor quadrangle TQ 12 36 * @var{nb-time-step} +scalar tetrahedron SS 12 4 * @var{nb-time-step} +vector tetrahedron VS 12 12 * @var{nb-time-step} +tensor tetrahedron TS 12 36 * @var{nb-time-step} +scalar hexahedron SH 24 8 * @var{nb-time-step} +vector hexahedron VH 24 24 * @var{nb-time-step} +tensor hexahedron TH 24 72 * @var{nb-time-step} +scalar prism SI 18 6 * @var{nb-time-step} +vector prism VI 18 18 * @var{nb-time-step} +tensor prism TI 18 54 * @var{nb-time-step} +scalar pyramid SY 15 5 * @var{nb-time-step} +vector pyramid VY 15 15 * @var{nb-time-step} +tensor pyramid TY 15 45 * @var{nb-time-step} +text 2d T2 4 arbitrary +text 3d T3 5 arbitrary +@end example + +But, for historical rerasons, contrary to the ASCII and binary +post-processing file formats, the coordinates are given by node, i.e.: + +@itemize @bullet +@item +@code{(coord1, coord2,coord3)} for a point, +@item +@code{(coord1-node1, coord2-node1, coord3-node1,}@* +@code{ coord1-node2, coord2-node2, coord3-node2)} for a line, +@item +@code{(coord1-node1, coord2-node1, coord3-node1,}@* +@code{ coord1-node2, coord2-node2, coord3-node2,}@* +@code{ coord1-node3, coord2-node3, coord3-node3)} for a triangle, +@item +etc. +@end itemize +The values are given in the same order as for the ASCII and binary +post-processing file formats. + +@c ------------------------------------------------------------------------- +@c Gmsh node ordering +@c ------------------------------------------------------------------------- + +@node Gmsh node ordering, , Gmsh parsed post-processing file format, File formats +@section Gmsh node ordering + +For all mesh and post-processing file formats, the reference elements are +defined as follows. + +Point: +@example + v + | + | + -----1-----u + | + | +@end example + +Line: +@example + edge 1: nodes 1 -> 2 + v + | + | + --1-----2--u + | + | +@end example + +Triangle: +@example + edge 1: nodes 1 -> 2 + v 2: 1 -> 3 + | 3: 2 -> 3 + | + 3 face 1: edges 1 -2 3 nodes 1 2 3 + |\ + | \ + |__\___u + 1 2 + +@end example + +Quadrangle: +@example + edge 1: nodes 1 -> 2 + v 2: 1 -> 4 + | 3: 2 -> 3 + 4--|--3 4: 3 -> 4 + | | | + -----------u face 1: edges 1 -2 3 4 nodes 1 2 3 4 + | | | + 1--|--2 + | + +@end example + +Tetrahedron: +@example + edge 1: nodes 1 -> 2 + v 2: 1 -> 3 + | 3: 1 -> 4 + | 4: 2 -> 3 + | 5: 2 -> 4 + 3 6: 3 -> 4 + |\ + | \ face 1: edges 1 -3 5 nodes 1 2 4 + |__\2_____u 2: -1 2 -4 1 3 2 + 1\ / 3: -2 3 -6 1 4 3 + \4 4: 4 -5 6 2 3 4 + \ + w +@end example + +Hexahedron +@example + edge 1: nodes 1 -> 2 + v 2: 1 -> 4 + | 3: 1 -> 5 + | 4: 2 -> 3 + 4----|--3 5: 2 -> 6 + |\ | |\ 6: 3 -> 4 + | 8-------7 7: 3 -> 7 + | | ----|---u 8: 4 -> 8 + 1-|---\-2 | 9: 5 -> 6 + \| \ \| 10: 5 -> 8 + 5-----\-6 11: 6 -> 7 + \ 12: 7 -> 8 + w + face 1: edges 1 -3 5 -9 nodes 1 2 6 5 + 2: -1 2 -4 -6 1 4 3 2 + 3: -2 3 -8 10 1 5 8 4 + 4: 4 -5 7 -11 2 3 7 6 + 5: 6 -7 8 -12 3 4 8 7 + 6: 9 -10 11 12 5 6 7 8 + +@end example + +Prism: +@example + edge 1: nodes 1 -> 2 + v 2: 1 -> 3 + 3 | 3: 1 -> 4 + |\| 4: 2 -> 3 + | | 5: 2 -> 5 + 1_|2 6: 3 -> 6 + \| 6 7: 4 -> 5 + |_|_\___u 8: 4 -> 6 + \| \ 9: 5 -> 6 + 4 __5 + \ face 1: edges 1 -3 5 -7 nodes 1 2 5 4 + \ 2: -1 2 -4 1 3 2 + w 3: -2 3 -6 8 1 4 6 3 + 4: 4 -5 6 -9 2 3 6 5 + 5: 7 -8 9 4 5 6 +@end example + +Pyramid: +@example + edge 1: nodes 1 -> 2 + v 2: 1 -> 4 + | 3: 1 -> 5 + | 4: 2 -> 3 + 4---|---3 5: 2 -> 5 + | \ | /| 6: 3 -> 4 + | \ -/-|---u 7: 3 -> 5 + | / 5\ | 8: 4 -> 5 + 1/----\-2 + \ facet 1: edges 1 5 -3 nodes 1 2 5 + \ 2: 2 -6 -4 -1 1 4 3 2 + w 3: 3 -8 -2 1 5 4 + 4: 4 7 -5 2 3 5 + 5: 6 8 -7 3 4 5 + @end example + @c ========================================================================= @c Programming Comments @c ========================================================================= diff --git a/doc/texinfo/t1.geo b/doc/texinfo/t1.geo index a97370e9f7..249ab54930 100644 --- a/doc/texinfo/t1.geo +++ b/doc/texinfo/t1.geo @@ -104,6 +104,6 @@ Physical Surface(MySurface) = @{6@} ; // If no physical groups are defined, all the elements in the mesh are // directly saved with their default orientation and with a region // number equal to their elementary region number. For a description -// of the mesh and post-processing formats, see the FORMATS file. +// of the mesh and post-processing formats, see the reference manual. } @end format diff --git a/doc/texinfo/t8.geo b/doc/texinfo/t8.geo index be705447a6..78b1fe2788 100644 --- a/doc/texinfo/t8.geo +++ b/doc/texinfo/t8.geo @@ -8,8 +8,7 @@ * *********************************************************************/ -// The first example is included, as well as some post-processing maps -// (for the format of the post-processing maps, see the FORMATS file): +// The first example is included, as well as some post-processing maps: Include "t1.geo" ; Include "view1.pos" ; @@ -132,21 +131,5 @@ For num In @{1:255@} EndIf EndFor - - -// Here is the list of available scripting commands: -// -// Merge string; (to merge a file) -// MergeWithBoundingBox string; (to merge a file and force the recalculation -// of the scene's bounding box) -// Draw; (to redraw the scene) -// Save string; (to save the mesh) -// Print string; (to print the graphic window in the format -// defined in Print.Format) -// Sleep expr; (to sleep during expr seconds) -// Delete View[int]; (to free the view int) -// Delete Meshes; (to free all meshes) -// Duplicata View[int]; (to duplicate the view int) -// System string; (to execute a system call) } @end format diff --git a/tutorial/t1.geo b/tutorial/t1.geo index eb085acfd9..66efd41bd0 100644 --- a/tutorial/t1.geo +++ b/tutorial/t1.geo @@ -102,4 +102,4 @@ Physical Surface(MySurface) = {6} ; // If no physical groups are defined, all the elements in the mesh are // directly saved with their default orientation and with a region // number equal to their elementary region number. For a description -// of the mesh and post-processing formats, see the FORMATS file. +// of the mesh and post-processing formats, see the reference manual. diff --git a/tutorial/t8.geo b/tutorial/t8.geo index 449445e5e7..f0d02a6368 100644 --- a/tutorial/t8.geo +++ b/tutorial/t8.geo @@ -6,8 +6,7 @@ * *********************************************************************/ -// The first example is included, as well as some post-processing maps -// (for the format of the post-processing maps, see the FORMATS file): +// The first example is included, as well as some post-processing maps: Include "t1.geo" ; Include "view1.pos" ; @@ -130,19 +129,3 @@ For num In {1:255} EndIf EndFor - - -// Here is the list of available scripting commands: -// -// Merge string; (to merge a file) -// MergeWithBoundingBox string; (to merge a file and force the recalculation -// of the scene's bounding box) -// Draw; (to redraw the scene) -// Save string; (to save the mesh) -// Print string; (to print the graphic window in the format -// defined in Print.Format) -// Sleep expr; (to sleep during expr seconds) -// Delete View[int]; (to free the view int) -// Delete Meshes; (to free all meshes) -// Duplicata View[int]; (to duplicate the view int) -// System string; (to execute a system call) diff --git a/tutorial/view1.pos b/tutorial/view1.pos index 855df7ac1f..d6562bebb9 100644 --- a/tutorial/view1.pos +++ b/tutorial/view1.pos @@ -8,11 +8,6 @@ // In this view, there are only scalar triangles. There are 5 time // steps -> 3*5 = 15 values for each triangle. -// -// Warning: this (parsed) post-processing view format is only designed -// for small post-processing views. For bigger views (>100000 -// elements), you should consider using the native ASCII or binary -// file formats described in the FORMATS file. View "a scalar map" { ST(0.079090117,0.19794942,0,0.06966854,0.20076802,0,0.071449289,0.19423207,0){1206859.6,1570520.4,1594804.6,-2368529.7,-3162888.4,-3019964.8,1073015.3,1636334.6,1103926.4,1335740.9,1503948.1,2033518.7,-2359414.1,-3161601.9,-2921575.1}; diff --git a/utils/gmsh.spec b/utils/gmsh.spec index 3665f1ad00..9fbfd09bac 100644 --- a/utils/gmsh.spec +++ b/utils/gmsh.spec @@ -55,7 +55,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) -%doc doc/gmsh.pdf doc/COPYING doc/FORMATS doc/VERSIONS doc/FAQ doc/CONTRIBUTORS demos tutorial +%doc doc/gmsh.pdf doc/COPYING doc/VERSIONS doc/FAQ doc/CONTRIBUTORS demos tutorial /usr/bin/gmsh /usr/bin/dxf2geo /usr/share/man/man1/gmsh* -- GitLab