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

8. Running Gmsh

8.1 Interactive mode  
8.2 Non-interactive mode  
8.3 Command-line options  
8.4 Mouse actions  
8.5 Keyboard shortcuts  


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

8.1 Interactive mode

Gmsh's first operating mode is the `interactive graphical mode'. To launch Gmsh in interactive mode, just click or double-click on the Gmsh icon (Windows and Mac), or type

 
> gmsh

at your shell prompt in a terminal (Unix). This will open two windows: the graphic window (with a status bar at the bottom) and the menu window (with a menu bar and some context-dependent buttons).

To open the first tutorial file (see section 7. Tutorial), select the `File->Open' menu, and choose `t1.geo' in the input field. When using a terminal, you can also specify the file name directly on the command line, i.e.:

 
> gmsh t1.geo

To perform the mesh generation, go to the mesh module (by selecting `Mesh' in the module menu) and choose the required dimension in the context-dependent buttons (`1D' will mesh all the lines; `2D' will mesh all the surfaces--as well as all the lines if `1D' was not called before; `3D' will mesh all the volumes--and all the surfaces if `2D' was not called before). To save the resulting mesh in the current mesh format, choose `Save' in the context-dependent buttons, or select the appropriate format with the `File->Save As' menu. The default mesh file name is based on the name of the first input file on the command line (or `untitled' if there wasn't any input file given), with an appended extension depending on the mesh format(7).

To create a new geometry or to modify an existing geometry, select 'Geometry' in the module menu, and follow the context-dependent buttons. For example, to create a spline, select `Elementary', `Add', `New' and `Spline'. You will then be asked to select a list of points, and to type e to finish the selection (or q to abort it). Once the interactive command is completed, a text string is automatically added at the end of the current project file. You can edit this project file by hand at any time by pressing the `Edit' button in the `Geometry' menu and then reloading the project by pressing `Reload'. For example, it is often faster to define variables and points directly in the project file, and then use the graphical user interface to define the lines, the surfaces and the volumes interactively.

Several files can be loaded simultaneously in Gmsh. The first one defines the project, while the others are appended (`merged') to this project. You can merge such files with the `File->Merge' menu, or by directly specifying the names of the files on the command line. For example, to merge the post-processing views contained in the files `view1.pos' and `view2.pos' together with the geometry of the first tutorial `t1.geo', you can type the following command:

 
> gmsh t1.geo view1.pos view2.pos

In the Post-Processing module (select `Post-Processing' in the module menu), two view buttons will appear, respectively labeled `a scalar map' and `a vector map'. A mouse click on the name will toggle the visibility of the selected view, while a click on the arrow button on the right will provide access to the view's options. If you want the modifications made to one view to affect also all the other views, select the `Apply next changes to all views' or `Force same options for all views' option in the `Tools->Options->Post-processing' menu.

Note that all the options specified interactively can also be directly specified in the ASCII input files. All available options, with their current values, can be saved into a file by selecting `File->Save As->Gmsh options', or simply viewed by pressing the `?' button in the status bar. To save the current options as your default preferences for all future Gmsh sessions, use the `Tools->Options->Save as defaults' button.


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

8.2 Non-interactive mode

Gmsh's second operating mode is the non-interactive (or `batch') mode. In this mode, there is no graphical user interface, and all operations are performed without any user interaction(8). For example, to mesh the first tutorial in non-interactive mode, just type:

 
> gmsh t1.geo -2

To mesh the same example, but with the background mesh available in the file `bgmesh.pos', type:

 
> gmsh t1.geo -2 -bgm bgmesh.pos

For the list of all command-line options, see 8.3 Command-line options.


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

8.3 Command-line options

Geometry options:

-0
Parse all input files, output unrolled geometry, and exit.
-tol float
Set geometrical tolerance

Mesh options:

-1, -2, -3
Perform 1D, 2D or 3D mesh generation, then exit
-saveall
Save all elements (discard physical group definitions)
-o file
Specify mesh output file name
-format string
Set output mesh format (msh, msh1, msh2, unv, vrml, stl, mesh, bdf, p3d, cgns, med)
-bin
Use binary format when available
-algo string
Select mesh algorithm (iso, netgen, tetgen)
-smooth int
Set number of mesh smoothing steps
-optimize[_netgen]
Optimize quality of tetrahedral elements
-order int
Set the order of the generated elements (1, 2)
-clscale float
Set characteristic length scaling factor
-clmin float
Set minimum characteristic length
-clmax float
Set maximum characteristic length
-clcurv
Compute characteristic lengths from curvatures
-rand float
Set random perturbation factor
-bgm file
Load background mesh from file
-constrain
Constrain background mesh with characteristic lengths

Post-processing options:

-noview
Hide all views on startup
-link int
Select link mode between views (0, 1, 2, 3, 4)
-combine
Combine views having identical names into multi-time-step views

Display options:

-nodb
Disable double buffering
-fontsize int
Specify the font size for the GUI
-theme string
Specify FLTK GUI theme
-display string
Specify display

Other options:

-
Parse input files, then exit
-a, -g, -m, -s, -p
Start in automatic, geometry, mesh, solver or post-processing mode
-pid
Print pid on stdout
-listen
Always listen to incoming connection requests.
-v int
Set verbosity level
-nopopup
Don't popup dialog windows in scripts
-string "string"
Parse option string at startup
-option file
Parse option file at startup
-convert files
Convert files into latest binary formats, then exit
-version
Show version number
-info
Show detailed version information
-help
Show this message


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

8.4 Mouse actions

In the following, for a 2 button mouse, Middle button = Shift+Left button. For a 1 button mouse, Middle button = Shift+Left button and Right button = Alt+Left button.

Move the mouse:

Left button:

Ctrl+Left button: Start a lasso zoom or a lasso selection/unselection

Middle button:

Ctrl+Middle button: Orthogonalize display

Right button:

Ctrl+Right button: Reset to default viewpoint


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

8.5 Keyboard shortcuts

(On Mac Ctrl is replaced by Cmd (the `Apple key') in the shortcuts below.)

Left arrow
Go to previous time step
Right arrow
Go to next time step
Up arrow
Make previous view visible
Down arrow
Make next view visible

<
Go back to previous context
>
Go forward to next context
0
Reload project file
1 or F1
Mesh lines
2 or F2
Mesh surfaces
3 or F3
Mesh volumes
Escape
Cancel lasso zoom/selection, toggle mouse selection ON/OFF

g
Go to geometry module
m
Go to mesh module
p
Go to post-processing module
s
Go to solver module

Shift+a
Bring all windows to front
Shift+g
Show geometry options
Shift+m
Show mesh options
Shift+o
Show general options
Shift+p
Show post-processing options
Shift+s
Show solver options
Shift+u
Show post-processing view plugins
Shift+w
Show post-processing view options

Ctrl+i
Show statistics window
Ctrl+l
Show message console
Ctrl+n
Create new project file
Ctrl+o
Open project file
Ctrl+q
Quit
Ctrl+r
Rename project file
Ctrl+s
Save file

Shift+Ctrl+c
Show clipping plane window
Shift+Ctrl+m
Show manipulator window
Shift+Ctrl+n
Show option window
Shift+Ctrl+o
Merge file(s)
Shift+Ctrl+s
Save mesh in default format
Shift+Ctrl+u
Show plugin window
Shift+Ctrl+v
Show visibility window

Alt+a
Loop through axes modes
Alt+b
Hide/show bounding boxes
Alt+c
Loop through predefined color schemes
Alt+e
Hide/Show element outlines for visible post-processing views
Alt+f
Change redraw mode (fast/full)
Alt+h
Hide/show all post-processing views
Alt+i
Hide/show all post-processing view scales
Alt+l
Hide/show geometry lines
Alt+m
Toggle visibility of all mesh entities
Alt+n
Hide/show all post-processing view annotations
Alt+o
Change projection mode (orthographic/perspective)
Alt+p
Hide/show geometry points
Alt+r
Loop through range modes for visible post-processing views
Alt+s
Hide/show geometry surfaces
Alt+t
Loop through interval modes for visible post-processing views
Alt+v
Hide/show geometry volumes
Alt+w
Enable/disable all lighting
Alt+x
Set X view
Alt+y
Set Y view
Alt+z
Set Z view

Alt+Shift+a
Hide/show small axes
Alt+Shift+b
Hide/show mesh volume faces
Alt+Shift+d
Hide/show mesh surface faces
Alt+Shift+l
Hide/show mesh lines
Alt+Shift+o
Adjust projection parameters
Alt+Shift+p
Hide/show mesh points
Alt+Shift+s
Hide/show mesh surface edges
Alt+Shift+v
Hide/show mesh volume edges
Alt+Shift+w
Reverse all mesh normals
Alt+Shift+x
Set -X view
Alt+Shift+y
Set -Y view
Alt+Shift+z
Set -Z view


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

Back to geuz.org/gmsh