

(To force Gmsh to save all elements, whether they belong to physical groups or not, set the `Mesh.SaveAll' option to 1.) Physical groups are also identified by tags, i.e. By default, if physical groups are defined, Gmsh will export in output files only mesh elements that belong to at least one physical group. Such groups are called "Physical Groups" in Gmsh. to define some mathematical ("domain", "boundary"), functional ("left wing", "fuselage") or material ("steel", "carbon") properties. An optional step is needed if we want to group elementary geometrical entities into more meaningful groups, e.g. ()Īt this level, Gmsh knows everything to display the rectangular surface 1 and to mesh it. Synchronizations can be called at any time, but they involve a non trivial amount of processing so while you could synchronize the internal CAD data after every CAD command, it is usually better to minimize the number of synchronization points.

This is achieved by the () API call for the built-in CAD kernel. We can then define the surface as a list of curve loops (only one here, representing the external contour, since there are no holes–see t4.jl for an example of a surface with a hole): (, 1) 1īefore they can be meshed (and, more generally, before they can be used by API functions outside of the built-in CAD kernel functions), the CAD entities must be synchronized with the Gmsh model, which will create the relevant Gmsh data structures. The API function to create curve loops takes a list of integers as first argument, and the curve loop tag (which must be unique amongst curve loops) as the second (optional) argument: (, 1) 1 A curve loop is defined by an ordered list of connected curves, a sign being associated with each curve (depending on the orientation of the curve to form a loop). In order to define a simple rectangular surface from the four curves defined above, a curve loop has first to be defined. The third elementary entity is the surface. And as a general rule, elementary entity tags in Gmsh have to be unique per geometrical dimension. Note that curve tags are separate from point tags - hence we can reuse tag 1 for our first curve. In the commands below, for example, the line 1 starts at point 1 and ends at point 2. The API to create straight line segments with the built-in kernel follows the same conventions: the first 2 arguments are point tags (the start and end points of the line), and the last (optional one) is the line tag. 3, 0, lc) 4Ĭurves are Gmsh's second type of elementery entities, and, amongst curves, straight lines are the simplest. If the tag is not provided explicitly, a new tag is automatically created, and returned by the function: p4 = (0. All points should have different tags: (.1, 0, 0, lc, 2) We can then define some additional points. If no target mesh size of provided, a default uniform coarse size will be used for the model, based on the overall model size. Another method to specify mesh sizes is to use general mesh size Fields (see t10.jl). The distribution of the mesh element sizes will be obtained by interpolation of these mesh sizes throughout the geometry. the last (optional) argument is the point tag (a stricly positive integer that uniquely identifies the point).the next (optional) argument is the target mesh size close to the point.the first 3 arguments are the point coordinates (x, y, z).To create a point with the built-in CAD kernel, the Julia API function is (): The first type of elementary entity in Gmsh is a Point. The built-in kernel is used in this first tutorial: the corresponding API functions have the prefix.

The Julia API provides direct access to each supported geometry (CAD) kernel. Next we add a new model named "t1" (if () is not called a new unnamed model will be created on the fly, if necessary): ("t1")
Gmsh function full#
The Julia API is entirely defined in the gmsh.jl module (which contains the full documentation of all the functions in the API): import gmshīefore using any functions in the Julia API, Gmsh must be initialized: gmsh.initialize() Edit on GitHub Tutorial 1 Geometry basics, elementary entities, physical groups
