[ < ] [ > ]   [ << ] [ 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 and tensor fields can be represented either by three-dimensional arrows or by displacement maps. 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 the scripting language) or globally (see the PostProcessing.LinkView 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.4 Gmsh 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.

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

Plugin (string) . string = expression;
Sets a floating point option for a given plugin. See 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.

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 quite slow if the view is large--e.g. with more than 100,000 elements). Though, this "parsed" post-processing format (explained in detail in 9.4 Gmsh parsed post-processing file format) is very powerful for testing proposes, since all the values are expressions. Two other formats, better adapted for large data sets, are described in 9.2 Gmsh ASCII post-processing file format and 9.3 Gmsh binary post-processing file format.


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

6.2 Post-processing plugins

Plugin(CutGrid)
Plugin(CutGrid) cuts a 3D 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 (at most) 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

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

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

Plugin(DecomposeInSimplex)
Plugin(DecomposeInSimplex) decomposes all non-simplectic elements (quadrangles, prisms pyramids, hexahedra) 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(Extract)
Plugin(Extract) extracts the iComponent-th component of the view `iView'. If `iView' < 0, the plugin is run on the current view.

Plugin(Extract) creates one new view.

Numeric options:

iView
Default value: -1
iComponent
Default value: 0

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 vector view `iView'. 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. It is nice to choose the displacement mode to see vectors and to animate the view ;-)

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
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 scalar 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.DisplayLists
Use OpenGL display lists for drawing post-processing views
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.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

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: 15
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.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 (0: reduced to point; 1: not transformed)
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: 0
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: 80
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.TransparentScale
Display a `transparent' value scale?
Default value: 1
Saved in: General.OptionsFileName

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

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