manpagez: man pages & more
info gmsh
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.7 General commands

The following commands can be used anywhere in a Gmsh script:

string = expression;

Creates a new expression identifier string, or affects expression to an existing expression identifier. Thirteen expression identifiers are predefined (hardcoded in Gmsh’s parser):

Pi

Returns 3.1415926535897932.

GMSH_MAJOR_VERSION

Returns Gmsh’s major version number.

GMSH_MINOR_VERSION

Returns Gmsh’s minor version number.

GMSH_PATCH_VERSION

Returns Gmsh’s patch version number.

MPI_Size

Returns the number of processors on which Gmsh is running. It is always 1, except if you compiled Gmsh with ENABLE_MPI (see section Compiling the source code).

MPI_Rank

Returns the rank of the current processor.

Cpu

Returns the current CPU time (in seconds).

Memory

Returns the current memory usage (in Mb).

newp

Returns the next available point number. As explained in Geometry module, a unique number must be associated with every geometrical point: newp permits to know the highest number already attributed (plus one). This is mostly useful when writing user-defined functions (see section User-defined functions) or general geometric primitives, when one does not know a priori which numbers are already attributed, and which ones are still available.

newl

Returns the next available line number.

news

Returns the next available surface number.

newv

Returns the next available volume number.

newll

Returns the next available line loop number.

newsl

Returns the next available surface loop number.

newreg

Returns the next available region number. That is, newreg returns the maximum of newp, newl, news, newv, newll, newsl and all physical entity numbers(7).

string = { };

Creates a new expression list identifier string with an empty list.

string = { expression-list };

Creates a new expression list identifier string with the list expression-list, or affects expression-list to an existing expression list identifier. The following syntax is also allowed: string[] = { expression-list };

string [ { expression-list } ] = { expression-list };

Affects each item in the right hand side expression-list to the elements (indexed by the left hand side expression-list) of an existing expression list identifier. The two expression-lists must contain the same number of items.

string ( { expression-list } ) = { expression-list };

Same as above.

string += expression;

Adds and affects expression to an existing expression identifier.

string -= expression;

Subtracts and affects expression to an existing expression identifier.

string *= expression;

Multiplies and affects expression to an existing expression identifier.

string /= expression;

Divides and affects expression to an existing expression identifier.

string += { expression-list };

Appends expression-list to an existing expression list or creates a new expression list with expression-list.

string -= { expression-list };

Removes the items in expression-list from the existing expression list.

string [ { expression-list } ] += { expression-list };

Adds and affects, item per item, the right hand side expression-list to an existing expression list identifier.

string [ { expression-list } ] -= { expression-list };

Subtracts and affects, item per item, the right hand side expression-list to an existing expression list identifier.

string [ { expression-list } ] *= { expression-list };

Multiplies and affects, item per item, the right hand side expression-list to an existing expression list identifier.

string [ { expression-list } ] /= { expression-list };

Divides and affects, item per item, the right hand side expression-list to an existing expression list identifier.

string = char-expression;

Creates a new character expression identifier string with a given char-expression.

real-option = expression;

Affects expression to a real option.

char-option = char-expression;

Affects char-expression to a character option.

color-option = color-expression;

Affects color-expression to a color option.

real-option += expression;

Adds and affects expression to a real option.

real-option -= expression;

Subtracts and affects expression to a real option.

real-option *= expression;

Multiplies and affects expression to a real option.

real-option /= expression;

Divides and affects expression to a real option.

Abort;

Aborts the current script.

Exit;

Exits Gmsh.

Printf ( char-expression <, expression-list> );

Prints a character expression in the information window and/or on the terminal. Printf is equivalent to the printf C function: char-expression is a format string that can contain formatting characters (%f, %e, etc.). Note that all expressions are evaluated as floating point values in Gmsh (see section Expressions), so that only valid floating point formatting characters make sense in char-expression. See t5.geo, for an example of the use of Printf.

Printf ( char-expression , expression-list ) > char-expression;

Same as Printf above, but output the expression in a file.

Printf ( char-expression , expression-list ) >> char-expression;

Same as Printf above, but appends the expression at the end of the file.

Error ( char-expression <, expression-list> );

Same as Printf, but raises an error.

Merge char-expression;

Merges a file named char-expression. This command is equivalent to the ‘File->Merge’ menu in the GUI. If the path in char-expression is not absolute, char-expression is appended to the path of the current file.

Draw;

Redraws the scene.

SetChanged;

Force the mesh and post-processing vertex arrays to be regenerated. Useful e.g. for creating animations with changing clipping planes, etc.

BoundingBox;

Recomputes the bounding box of the scene (which is normally computed only after new geometrical entities are added or after files are included or merged). The bounding box is computed as follows:

  1. If there is a mesh (i.e., at least one mesh vertex), the bounding box is taken as the box enclosing all the mesh vertices;
  2. If there is no mesh but there is a geometry (i.e., at least one geometrical point), the bounding box is taken as the box enclosing all the geometrical points;
  3. If there is no mesh and no geometry, but there are some post-processing views, the bounding box is taken as the box enclosing all the primitives in the views.
BoundingBox { expression, expression, expression, expression, expression, expression };

Forces the bounding box of the scene to the given expressions (X min, X max, Y min, Y max, Z min, Z max).

Delete Model;

Deletes the current model (all geometrical entities and their associated meshes).

Delete Physicals;

Deletes all physical groups.

Delete Variables;

Deletes all the expressions.

Delete Options;

Deletes the current options and revert to the default values.

Delete string;

Deletes the expression string.

Mesh expression;

Generates expression-D mesh.

RefineMesh;

Refines the current mesh by splitting all elements. If Mesh.SecondOrderLinear is set, the new vertices are inserted by linear interpolatinon. Otherwise they are snapped on the actual geometry.

AdaptMesh { expression-list } { expression-list } { { expression-list < , … > } };

Performs adaptive mesh generation. Documentation not yet available.

RelocateMesh Point | Line | Surface { expression-list } | "*";

Relocates the mesh vertices on the given entities using the parametric coordinates stored in the vertices. Useful for creating perturbation of meshes e.g. for sensitivity analyzes.

SetOrder expression;

Changes the order of the elements in the current mesh.

Print char-expression;

Prints the graphic window in a file named char-expression, using the current Print.Format (see section General options list). If the path in char-expression is not absolute, char-expression is appended to the path of the current file.

Sleep expression;

Suspends the execution of Gmsh during expression seconds.

SystemCall char-expression;

Executes a (blocking) system call.

NonBlockingSystemCall char-expression;

Executes a (non-blocking) system call.

SetName char-expression;

Changes the name of the current model.

SyncModel;

Forces an immediate transfer from the old geometrical database into the new one (this transfer normally occurs right after a file is read).

Include char-expression;

Includes the file named char-expression at the current position in the input file. The include command should be given on a line of its own. If the path in char-expression is not absolute, char-expression is appended to the path of the current file.


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

This document was generated on February 9, 2014 using texi2html 5.0.

© manpagez.com 2000-2017
Individual documents may contain additional copyright information.