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

6. Post-processing module

Gmsh's post-processing module can handle multiple scalar, vector or tensor data sets along with the geometry and the mesh. The data sets should be given in one of Gmsh's post-processing file formats described in 9. File formats. Once loaded into Gmsh, scalar fields can be displayed as iso-value lines and surfaces or color maps, whereas vector fields can be represented either by three-dimensional arrows or by displacement maps. (Tensor fields are currently displayed as Von-Mises effective stresses. To display other (combinations of) components, use Plugin(Extract): see 6.2 Post-processing plugins.)

In Gmsh's jargon, each data set is called a "view", and can arbitrarily mix all types of elements and fields. Each view is given a name, and can be manipulated either individually (each view has its own button in the GUI and can be referred to by its index in a script) or globally (see the PostProcessing.Link option in 6.3 Post-processing options).

By default, Gmsh treats all post-processing views as three-dimensional plots, i.e., draws the scalar, vector and tensor primitives (points, lines, triangles, tetrahedra, etc.) in 3D space. But Gmsh can also represent each post-processing view containing scalar points as two-dimensional ("X-Y") plots, either space- or time-oriented:

Although visualization is usually mostly an interactive task, Gmsh exposes all the post-processing commands and options to the user in its scripting language to permit a complete automation of the post-processing process (see e.g., 7.8 `t8.geo', and 7.9 `t9.geo').

The two following sections summarize all available post-processing commands and options. Most options apply to both 2D and 3D plots (colormaps, point/line sizes, interval types, time step selection, etc.), but some are peculiar to 3D (lightning, element selection, etc.) or 2D plots (graph style, labels, etc.). Note that 2D plots can be positioned explicitly inside the graphical window, or be automatically positioned in order to avoid overlaps.

Sample post-processing files in human-readable "parsed" format (see section 9.2.1 Parsed post-processing file format) are available in the `tutorial' directory of Gmsh's distribution (`.pos' files).

6.1 Post-processing commands  
6.2 Post-processing plugins  
6.3 Post-processing options  


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

6.1 Post-processing commands

Combine TimeSteps;
Combines the data from all the post-processing views having the same name into new multi-time-step views.

Combine Views;
Combines all post-processing views in a single new view.

Delete View[expression];
Deletes (removes) the expression-th post-processing view. Note that post-processing view numbers start at 0.

Duplicata View[expression];
Duplicates the expression-th post-processing view.

Note that Duplicata creates a logical duplicate of the view without actually duplicating the data in memory. This is very useful when you want multiple simultaneous renderings of the same large dataset (usually with different display options), but you cannot afford to store all copies in memory. If what you really want is multiple physical copies of the data, just merge the file containing the post-processing view multiple times.

Plugin (string) . Run;
Executes the plugin string. The list of default plugins is given in 6.2 Post-processing plugins.

Plugin (string) . string = expression | char-expression;
Sets an option for a given plugin. See 6.2 Post-processing plugins, for a list of default plugins and 7.9 `t9.geo', for some examples.

Save View[expression] char-expression;
Saves the the expression-th post-processing view in a file named char-expression. If the path in char-expression is not absolute, char-expression is appended to the path of the current file.

View "string" { string ( expression-list ) { expression-list }; ... };
Creates a new post-processing view, named "string". This is the easiest way to create a post-processing view, but also the least efficient (the view is read through Gmsh's script parser, which can become a bit slow if the view is very large--e.g., with one million elements). Nevertheless, this "parsed" post-processing format (explained in detail in 9.2.1 Parsed post-processing file format) is very powerful, since all the values are expressions. Two other formats, better suited for very large data sets, are described in 9.2.2 ASCII post-processing file format, and 9.2.3 Binary post-processing file format.


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

6.2 Post-processing plugins

Plugin(CutGrid)
Plugin(CutGrid) cuts a tetrahedron view with a rectangular grid defined by the 3 points (`X0',`Y0',`Z0') (origin), (`X1',`Y1',`Z1') (axis of U) and (`X2',`Y2',`Z2') (axis of V). The number of points along U and V is set with the options `nPointsU' and `nPointsV'. If `iView' < 0, the plugin is run on the current view.

Plugin(CutGrid) creates one new view.

Numeric options:

X0
Default value: -1
Y0
Default value: -1
Z0
Default value: 0
X1
Default value: -1
Y1
Default value: 0
Z1
Default value: 0
X2
Default value: 0
Y2
Default value: -1
Z2
Default value: 0
nPointsU
Default value: 20
nPointsV
Default value: 20
iView
Default value: -1

Plugin(CutMap)
Plugin(CutMap) extracts the isovalue surface of value `A' from the view `iView' and draws the `dTimeStep'-th value of the view `dView' on this isovalue surface. If `iView' < 0, the plugin is run on the current view. If `dTimeStep' < 0, the plugin uses, for each time step in `iView', the corresponding time step in `dView'. If `dView' < 0, the plugin uses `iView' as the value source.

Plugin(CutMap) creates as many views as there are time steps in `iView'.

Numeric options:

A
Default value: 1
dTimeStep
Default value: -1
dView
Default value: -1
iView
Default value: -1
recurLevel
Default value: 4

Plugin(CutParametric)
Plugin(CutParametric) cuts a triangle/tetrahedron scalar view `iView' with the parametric function (`X'(u), `Y'(u), `Z'(u)), using `nPointsU' values of the parameter u in [`minU', `maxU']. If `iView' < 0, the plugin is run on the current view.

Plugin(CutParametric) creates one new view.

String options:

X
Default value: "0 + 1 * Cos(u)"
Y
Default value: "0 + 1 * Sin(u)"
Z
Default value: "0"
Numeric options:
minU
Default value: 0
maxU
Default value: 6.28319
nPointsU
Default value: 360
iView
Default value: -1

Plugin(CutPlane)
Plugin(CutPlane) cuts the view `iView' with the plane `A'*X + `B'*Y + `C'*Z + `D' = 0. If `iView' < 0, the plugin is run on the current view.

Plugin(CutPlane) creates one new view.

Numeric options:

A
Default value: 1
B
Default value: 0
C
Default value: 0
D
Default value: -0.01
iView
Default value: -1
recurLevel
Default value: 4

Plugin(CutSphere)
Plugin(CutSphere) cuts the view `iView' with the sphere (X-`Xc')^2 + (Y-`Yc')^2 + (Z-`Zc')^2 = `R'^2. If `iView' < 0, the plugin is run on the current view.

Plugin(CutSphere) creates one new view.

Numeric options:

Xc
Default value: 0
Yc
Default value: 0
Zc
Default value: 0
R
Default value: 0.25
iView
Default value: -1
recurLevel
Default value: 4

Plugin(DecomposeInSimplex)
Plugin(DecomposeInSimplex) decomposes all non-simplectic elements (quadrangles, prisms, hexahedra, pyramids) in the view `iView' into simplices (triangles, tetrahedra). If `iView' < 0, the plugin is run on the current view.

Plugin(DecomposeInSimplex) is executed in-place.

Numeric options:

iView
Default value: -1

Plugin(DisplacementRaise)
Plugin(DisplacementRaise) transforms the coordinates of the elements in the view `iView' using the vectorial values (the displacements) stored in the `dTimeStep'-th time step of the view `dView'. If `iView' < 0, the plugin is run on the current view. If `dView' < 0, the plugin looks for the displacements in the view located just after `iView' in the view list.

Plugin(DisplacementRaise) is executed in-place.

Numeric options:

Factor
Default value: 1
dTimeStep
Default value: 0
dView
Default value: -1
iView
Default value: -1

Plugin(Evaluate)
Plugin(Evaluate) sets the `Component'-th component of the `TimeStep'-th time step in the view `iView' to the expression `Expression'. In addition to the usual mathematical functions (Exp, Log, Sqrt, Sin, Cos, Fabs, etc.) and operators (+, -, *, /, ^), `Expression' can contain the symbols x, y, z and v, which represent the three spatial coordinates and the value of the field, respectively. If `iView' < 0, the plugin is run on the current view.

Plugin(Evaluate) is executed in-place.

String options:

Expression
Default value: "0.01*(Fabs(Sin(30*y)*Fabs(Cos(30*x)))+0.3)"
Numeric options:
TimeStep
Default value: 0
Component
Default value: 0
iView
Default value: -1

Plugin(Extract)
Plugin(Extract) extracts a combination of components from the view `iView'. If `Expression1' or `Expression2' is empty, the plugin creates a scalar view using `Expression0'; otherwise the plugin creates a vector view. In addition to the usual mathematical functions (Exp, Log, Sqrt, Sin, Cos, Fabs, etc.) and operators (+, -, *, /, ^), the expressions can contain the symbols v0, v1, v2, ..., vn, which represent the n components of the field, and the symbols x, y and z, which represent the three spatial coordinates. If `iView' < 0, the plugin is run on the current view.

Plugin(Extract) creates one new view.

String options:

Expression0
Default value: "v0"
Expression1
Default value: ""
Expression2
Default value: ""
Numeric options:
iView
Default value: -1

Plugin(HarmonicToTime)
Plugin(HarmonicToTime) takes the values in the time steps `realPart' and `imaginaryPart' of the view `iView', and creates a new view containing (`iView'[`realPart'] * cos(p) - `iView'[`imaginaryPart'] * sin(p)), with p = 2*Pi*k/`nSteps', k = 0, ..., `nSteps'-1. If `iView' < 0, the plugin is run on the current view.

Plugin(HarmonicToTime) creates one new view.

Numeric options:

realPart
Default value: 0
imaginaryPart
Default value: 1
nSteps
Default value: 20
iView
Default value: -1

Plugin(Skin)
Plugin(Skin) extracts the skin (the boundary) of the view `iView'. If `iView' < 0, the plugin is run on the current view.

Plugin(Skin) creates one new view.

Numeric options:

iView
Default value: -1

Plugin(Smooth)
Plugin(Smooth) averages the values at the nodes of the scalar view `iView'. If `iView' < 0, the plugin is run on the current view.

Plugin(Smooth) is executed in-place.

Numeric options:

iView
Default value: -1

Plugin(SphericalRaise)
Plugin(SphericalRaise) transforms the coordinates of the elements in the view `iView' using the values associated with the `TimeStep'-th time step. Instead of elevating the nodes along the X, Y and Z axes as in View[`iView'].RaiseX, View[`iView'].RaiseY and View[`iView'].RaiseZ, the raise is applied along the radius of a sphere centered at (`Xc', `Yc', `Zc'). If `iView' < 0, the plugin is run on the current view.

Plugin(SphericalRaise) is executed in-place.

Numeric options:

Xc
Default value: 0
Yc
Default value: 0
Zc
Default value: 0
Raise
Default value: 1
TimeStep
Default value: 0
iView
Default value: -1

Plugin(StreamLines)
Plugin(StreamLines) computes stream lines from a triangle/tetrahedron vector view `iView' and optionally interpolates the scalar view `dView' on the resulting stream lines. It takes as input a grid defined by the 3 points (`X0',`Y0',`Z0') (origin), (`X1',`Y1',`Z1') (axis of U) and (`X2',`Y2',`Z2') (axis of V). The number of points that are going to be transported along U and V is set with the options `nPointsU' and `nPointsV'. Then, we solve the equation DX(t)/dt = V(x,y,z) with X(t=0) chosen as the grid and V(x,y,z) interpolated on the vector view. The timestep and the maximum number of iterations are set with the options `MaxIter' and `DT'. The time stepping scheme is a RK44. If `iView' < 0, the plugin is run on the current view.

Plugin(StreamLines) creates one new view. This view contains multi-step vector points if `dView' < 0, or single-step scalar lines if `dView' >= 0.

Numeric options:

X0
Default value: 2.39
Y0
Default value: 0.445
Z0
Default value: 0
X1
Default value: 2.39
Y1
Default value: 0.94
Z1
Default value: 0
X2
Default value: 2.39
Y2
Default value: 0.445
Z2
Default value: 1
nPointsU
Default value: 20
nPointsV
Default value: 1
MaxIter
Default value: 100
DT
Default value: 0.1
dView
Default value: -1
iView
Default value: -1

Plugin(Transform)
Plugin(Transform) transforms the coordinates of the nodes of the view `iView' by the matrix [`A11' `A12' `A13'] [`A21' `A22' `A23'] [`A31' `A32' `A33']. If `iView' < 0, the plugin is run on the current view.

Plugin(Transform) is executed in-place.

Numeric options:

A11
Default value: 1
A12
Default value: 0
A13
Default value: 0
A21
Default value: 0
A22
Default value: 1
A23
Default value: 0
A31
Default value: 0
A32
Default value: 0
A33
Default value: 1
iView
Default value: -1

Plugin(Triangulate)
Plugin(Triangulate) triangulates the points in the view `iView', assuming that all the points belong to a surface that can be univoquely projected into a plane. If `iView' < 0, the plugin is run on the current view.

Plugin(Triangulate) creates one new view.

Numeric options:

iView
Default value: -1


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

6.3 Post-processing options

General post-processing option names have the form `PostProcessing.string'. Options peculiar to post-processing views take two forms:

  1. options that should apply to all views can be set through `View.string', before any view is loaded;
  2. options that should apply only to the n-th view take the form `View[n].string' (n = 0, 1, 2, ...), after the n-th view is loaded.

See 7.8 `t8.geo', and 7.9 `t9.geo', for some examples.

PostProcessing.AnimationDelay
Delay (in seconds) between frames in automatic animation mode
Default value: 0.25
Saved in: General.OptionsFileName

PostProcessing.AnimationCycle
Cycle through views instead of time steps in automatic animation mode
Default value: 0
Saved in: General.OptionsFileName

PostProcessing.CombineRemoveOriginal
Remove original views after a Combine operation
Default value: 1
Saved in: General.OptionsFileName

PostProcessing.Format
Default file format for post-processing views
Default value: 0
Saved in: -

PostProcessing.HorizontalScales
Display value scales horizontally
Default value: 0
Saved in: General.OptionsFileName

PostProcessing.Link
Link post-processing views (0=none, 1/2=changes in visible/all, 3/4=everything in visible/all)
Default value: 0
Saved in: General.OptionsFileName

PostProcessing.NbViews
Current number of views merged
Default value: 0
Saved in: -

PostProcessing.Plugins
Enable default post-processing plugins?
Default value: 1
Saved in: General.OptionsFileName

PostProcessing.Scales
Show value scales
Default value: 1
Saved in: General.OptionsFileName

PostProcessing.Smoothing
Apply (non-reversible) smoothing to post-processing view when merged
Default value: 0
Saved in: General.OptionsFileName

PostProcessing.VertexArrays
Use OpenGL vertex arrays to draw triangles in post-processing views?
Default value: 1
Saved in: General.OptionsFileName

View.AbscissaName
Abscissa name for 2D graphs
Default value: ""
Saved in: General.OptionsFileName

View.AbscissaFormat
Abscissa number format for 2D graphs (in standard C form)
Default value: "%.3e"
Saved in: General.OptionsFileName

View.FileName
Default post-processing view file name
Default value: ""
Saved in: -

View.Format
Number format (in standard C form)
Default value: "%.3e"
Saved in: General.OptionsFileName

View.Name
Default post-processing view name
Default value: ""
Saved in: -

View.AlphaChannel
Global alpha channel value (used only if != 1)
Default value: 1
Saved in: General.OptionsFileName

View.AngleSmoothNormals
Threshold angle below which normals are not smoothed
Default value: 180
Saved in: General.OptionsFileName

View.ArrowHeadRadius
Relative radius of arrow head
Default value: 0.12
Saved in: General.OptionsFileName

View.ArrowLocation
Arrow location (1=cog, 2=node)
Default value: 1
Saved in: General.OptionsFileName

View.ArrowSize
Display size of arrows (in pixels)
Default value: 60
Saved in: General.OptionsFileName

View.ArrowSizeProportional
Scale the arrows according to the norm of the vector
Default value: 1
Saved in: General.OptionsFileName

View.ArrowStemLength
Relative length of arrow stem
Default value: 0.56
Saved in: General.OptionsFileName

View.ArrowStemRadius
Relative radius of arrow stem
Default value: 0.02
Saved in: General.OptionsFileName

View.AutoPosition
Position the scale or the 2D graph automatically to avoid overlaps
Default value: 1
Saved in: General.OptionsFileName

View.Boundary
Draw the `N minus b'-dimensional boundary of the simplex (N=simplex dimension, b=option value)
Default value: 0
Saved in: General.OptionsFileName

View.CustomMax
User-defined maximum value to be displayed
Default value: 0
Saved in: -

View.CustomMin
User-defined minimum value to be displayed
Default value: 0
Saved in: -

View.DisplacementFactor
Displacement amplification
Default value: 1
Saved in: General.OptionsFileName

View.DrawHexahedra
Display post-processing hexahedra?
Default value: 1
Saved in: General.OptionsFileName

View.DrawLines
Display post-processing lines?
Default value: 1
Saved in: General.OptionsFileName

View.DrawPoints
Display post-processing points?
Default value: 1
Saved in: General.OptionsFileName

View.DrawPrisms
Display post-processing prisms?
Default value: 1
Saved in: General.OptionsFileName

View.DrawPyramids
Display post-processing pyramids?
Default value: 1
Saved in: General.OptionsFileName

View.DrawQuadrangles
Display post-processing quadrangles?
Default value: 1
Saved in: General.OptionsFileName

View.DrawScalars
Display scalar values?
Default value: 1
Saved in: General.OptionsFileName

View.DrawStrings
Display post-processing annotation strings?
Default value: 1
Saved in: General.OptionsFileName

View.DrawTensors
Display tensor values?
Default value: 1
Saved in: General.OptionsFileName

View.DrawTetrahedra
Display post-processing tetrahedra?
Default value: 1
Saved in: General.OptionsFileName

View.DrawTriangles
Display post-processing triangles?
Default value: 1
Saved in: General.OptionsFileName

View.DrawVectors
Display vector values?
Default value: 1
Saved in: General.OptionsFileName

View.Explode
Explode elements (between 0=point and 1=non-transformed)
Default value: 1
Saved in: General.OptionsFileName

View.ExternalView
Index of the view used to color vector fields (-1=self)
Default value: -1
Saved in: General.OptionsFileName

View.Grid
Grid mode for 2D graphs (0=none, 1=simple, 2=frame, 3=grid)
Default value: 2
Saved in: General.OptionsFileName

View.Height
Height (in pixels) of the scale or 2D graph
Default value: 200
Saved in: General.OptionsFileName

View.IntervalsType
Type of interval display (1=iso, 2=continuous, 3=discrete, 4=numeric)
Default value: 2
Saved in: General.OptionsFileName

View.Light
Enable lighting for the view
Default value: 1
Saved in: General.OptionsFileName

View.LightTwoSide
Light both sides of view elements (leads to slower rendering)
Default value: 1
Saved in: General.OptionsFileName

View.LineType
Display lines as solid color segments (0) or 3D cylinders (1)
Default value: 0
Saved in: General.OptionsFileName

View.LineWidth
Display width of lines (in pixels)
Default value: 1
Saved in: General.OptionsFileName

View.Max
Maximum value in the view (do not change this!)
Default value: -1e+200
Saved in: -

View.Min
Minimum value in the view (do not change this!)
Default value: 1e+200
Saved in: -

View.NbAbscissa
Number of abscissa intervals for 2D graphs
Default value: 5
Saved in: General.OptionsFileName

View.NbIso
Number of intervals
Default value: 15
Saved in: General.OptionsFileName

View.NbTimeStep
Number of time steps in the view (do not change this!)
Default value: 1
Saved in: -

View.OffsetX
Translation of the view along X-axis (in model coordinates)
Default value: 0
Saved in: -

View.OffsetY
Translation of the view along Y-axis (in model coordinates)
Default value: 0
Saved in: -

View.OffsetZ
Translation of the view along Z-axis (in model coordinates)
Default value: 0
Saved in: -

View.PointSize
Display size of points (in pixels)
Default value: 3
Saved in: General.OptionsFileName

View.PointType
Display points as solid color dots (0) or 3D spheres (1)
Default value: 0
Saved in: General.OptionsFileName

View.PositionX
Horizontal position (in pixels) of the upper left corner of the scale or 2D graph
Default value: 100
Saved in: General.OptionsFileName

View.PositionY
Vertical position (in pixels) of the upper left corner of the scale or 2D graph
Default value: 50
Saved in: General.OptionsFileName

View.RaiseX
Elevation of the view along X-axis (in model coordinates)
Default value: 0
Saved in: -

View.RaiseY
Elevation of the view along Y-axis (in model coordinates)
Default value: 0
Saved in: -

View.RaiseZ
Elevation of the view along Z-axis (in model coordinates)
Default value: 0
Saved in: -

View.RangeType
Value scale range type (1=default, 2=custom, 3=per time step)
Default value: 1
Saved in: General.OptionsFileName

View.SaturateValues
Saturate the view values to custom min and max (1=true, 0=false)
Default value: 0
Saved in: General.OptionsFileName

View.ScaleType
Value scale type (1=linear, 2=logarithmic, 3=double logarithmic)
Default value: 1
Saved in: General.OptionsFileName

View.ShowElement
Show element boundaries?
Default value: 0
Saved in: General.OptionsFileName

View.ShowScale
Show value scale?
Default value: 1
Saved in: General.OptionsFileName

View.ShowTime
Show time value in the scale? (1=only if NbTimeStep>1, 2=always)
Default value: 1
Saved in: General.OptionsFileName

View.SmoothNormals
Smooth the normals?
Default value: 0
Saved in: General.OptionsFileName

View.TensorType
Tensor Visualization Type
Default value: 0
Saved in: General.OptionsFileName

View.TimeStep
Current time step displayed
Default value: 0
Saved in: -

View.Type
Type of graph (1=3D, 2=2D-space, 3=2D-time)
Default value: 1
Saved in: -

View.VectorType
Vector display type (1=segment, 2=arrow, 3=pyramid, 4=3D arrow, 5=displacement)
Default value: 4
Saved in: General.OptionsFileName

View.Visible
Is the view visible?
Default value: 1
Saved in: -

View.Width
Width (in pixels) of the scale or 2D graph
Default value: 300
Saved in: General.OptionsFileName

View.ColorTable
Color table used to draw the view
Saved in: General.OptionsFileName


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

Back to geuz.org/gmsh