This course is focused in the basic meshing features and capabilities of GiD.
To follow this course, the models gid_model_basic_meshing_course.gid and gid_embedded_example.gid must be loaded from the folder where the courses material is.

View of the model used for most of the parts of this courseView of the model used for the embedded mesh part of the course


In this course the three basic mesh types supported by GiD are shown:

Default meshing settings

For this section we need to load the model gid_model_basic_meshing_course.gid

First of all we should reset all the meshing preferences in order to ensure the meshing options got from GiD are the same as the ones needed to reproduce exactly this course. For this purpose:

If user does not assign any meshing property to the model, GiD generates body-fitted meshes and it assigns an automatic mesh size based on the size of the model. Elements by default are triangles (for surfaces) and tetrahedra (for volumes) and the mesh is unstructured. Let's have a look at this first automatic mesh.


Mesh resulting using default options

Quadratic type

User can choose between different quadratic element types by selecting the 'Quadratic type' option in the 'Mesh' menu.

Let's make a quadratic mesh of the model.

Detail of the mesh of a surface of the model, where all the nodes are labeled, so the quadratic nodes can be seen.

Types of body-fitted mesh

Different kinds of body-fitted meshes can be generated using GiD, depending on the topology required: unstructured, structured and semi-structured.
Set as 'Normal' the Quadratic type of the mesh (from Mesh menu) in order to reach the same meshes as the shown in this chapter.

Unstructured mesh

Assign sizes

As said in previous steps, the default mesh generated by GiD is a unstructured mesh, and a general size is set to the whole model. However, it is possible to refine specific regions of the model by assigning different sizes to the geometrical entities. Let's see it in an example where the entities labeled in the following figure will have different size assigned.

Entities to be selected in the following steps to assign mesh size.

Result mesh of the model once some specific sizes have been assigned.

Size transition factor

When different unstructured mesh sizes are present in the model, a transition between them is applied in the unstructured mesh. User can control whether this transition is smoother or sharper by the 'Unstructured size transitions factor'. This option is in the 'Meshing' branch of 'Preferences' window (Utilities->Preferences).



Mesh using 0.2 as unstructured size transition factor.


Mesh using 0.9 as unstructured size transition factor.

Surface meshers

There are three main unstructured surface meshers available in GiD: RFast ,RSurf and MinElem. While MinElem is a special mesher which tries to discretize the geometry using the less number of elements as possible considering a given chordal error criteria, RFast and RSurf try to generate the more regular elements as possible based on given mesh sizes.

This is a very simple geometrical model, but user may see the difference between the two main unstructured surface meshers RFast and RSurf. RFast mesher generates the mesh of the surface in the 2D parametric space of the surface, and RSurf generates it directly in the 3D space. This gives that meshers two basic properties:


In this model the only curved surfaces are the ones of the sphere, and it is hard to see the difference of quality between both meshers. However we can see a slight difference between them.


In the following figure the results meshes of the sphere are shown using RFast an RSurf meshers:


Mesh of the sphere of the model using RFast mesher.

Mesh of the sphere of the model using RSurf mesher.


In complex geometrical models in which the surfaces curvatures are important it is strongly recommended to use RSurf mesher in order to get a high-quality final mesh.

If the MinElem mesher is selected, it can be seen that the surfaces meshes of the model are quite different. Specially in planar shapes, where few elements are used to generate the mesh, but in some cases they are highly distorted. To appreciate better the difference between the meshes generated by MinElem mesher, reset the meshing sizes already assigned (Mesh→Reset mesh data) and generate a mesh with a very large mesh size (for instance, 1000).

Mesh of the model using MinElem as surface mesher.

This kind of meshes are mostly used for visualization purposes, or for simulations where the quality of the elements is not crucial, improving the performance of the computations due to the reduced number of elements.

It has to be considered that the surface mesher can also be assigned to specific surfaces, so as not all the model is meshed with the same one. This can be done in the 'Mesh' menu, by the 'Unstructured→surface mesher' option.

Volume meshers

GiD has three unstructured volume meshers (all of them generating tetrahedra): Advancing front, Tetgen and Octree.
The main characteristics of them are the following ones:


First of all, reset the meshing data (Mesh->Reset mesh data).
We will focus on the sphere volume (volume number 3). For this purpose we will not mesh the rest of the entities. So, set 'Mesh->Mesh criteria->No mesh' and select the other volumes of the model, as well as the isolated surface (surface number 18).
In order to appreciate better the difference between the difference volumes meshers, let's unset the 'Automatic correct sizes' in the Mesh branch of the Preferences window (set it to None). Set also as unstructured surface mesher the RSurf one.

Generate the mesh of the model with a size of 0.2 setting the three types of unstructured volume mesher (one mesh for each mesher). The results of the mesh are shown in the following figure:


Mesh generated with Advancing front and Tetgen mesher


Mesh generated with Octree mesher

One can appreciate that the different meshers generate different number of elements, and they are not equally fast.
The external view of the ones generated by Advancing front and Tetgen is the same, as they are constrained meshers and they use the same surface mesh as an input. This is not the case of the Octree mesh, where the regular grid of the octree structure can be appreciated in the nodes distribution (specially if we take a look at the mesh in 'render normal' mode, and we rotate it).
It can also be seen that the lines of the volume surfaces are not represented in the mesh coming from the octree mesher.

Structured mesh

Structured meshes can also be generated in GiD. Structured meshes are the ones got from a predefined pattern, and they are restrictive in the topology of the geometrical entities they are applied in.

Actually, GiD can also generate center-structured surface meshes (which have other topological requirements), but they are not included in this chapter.

Let's see an example of how to assign this meshing property, but first of all it is better to un-assign the previously assigned meshing properties to focus just in this structured part.


Lets assign structured meshing type to the volume number 5 and surface number 10 (shown in the following figure).

Entities to be set as structured.

In order to set a structured mesh onto a geometrical entity, the number of divisions (or the size) in its contour lines must be set.

View of the structured mesh of some entities of the model

The structured pattern of elements is clearly recognized in the entities we have selected.
Different number of divisions can be set to the different structured directions of the entities. You can try to set different numbers and see how the final mesh changes.
In case of triangles and tetrahedra, the structured mesh comes from an internal splitting of an intermediate mesh made of quadrilateral or hexahedra. The way these elements are splitted can be symmetrical or not, depending on the 'Symmetrical structured' variable of the 'Meshing→Structuration type' branch of Preferences window.
Setting the tetrahedra to be symmetric, for example, would give a mesh like the shown in hereafter:

View of the structured mesh of some entities of the model, setting as 'Symmetric structured' the tetrahedra.

Semi-structured mesh

Semi-structured meshes can be applied to volumes. This kind of meshes follows a prismatic topology, so these volumes must be prismatic: two tops can be identified, as well as a number of lateral surfaces (which must be able to be meshed as structured).
In the model of this course, the volumes number 1, 4 and 5 are prismatic, so they can be meshed with semi-structured volume.


Let's make semi-structured the volumes 1 and 4.

and set as 4 the number of divisions to be assigned.

Detail of the semi-structured mesh of the volumes 1 and 4.

Change structured direction

Volume number 1 is topologically prismatic only in one direction, but volume number 4 is prismatic in its 3 directions (as is has 6 boundary surfaces). The structured direction of volume 4 has been set automatically by GiD, but user may want to set another one.

Line 25, to be set as structured direction.

Generate the mesh again. The resulting mesh should be as this one:

Semi-structured mesh when structured direction of volume 4 is the one defined by line 25.

GiD offers two options to force the structured direction of a semi-structured volume: set the structured direction via a line following that direction (the option just done before), or set one of the tops of the prism ('Mesh->Semi-structured->Set->Master surface').

Element types

The different element types GiD can generate are the following ones:

There are some limitations in terms of element types permitted depending on the mesh type:

Considering this, selecting an element type is as easy as going to the 'Mesh' menu, setting the 'Element type' and select the desired entities.
In order to see different types of elements on this model follow this steps:

To check graphically the element types (or other meshing properties) assigned to the model, the 'Draw' option in the 'Mesh' menu is useful.

Different element types assigned to the model volumes shown using the Mesh->Draw option.

View of the mesh generated with the different element types assigned.

Note that the element type of volume 5 is prism, but the user has not set it. Just before mesh generation, GiD makes compatible the element types of the geometrical entities in order to fit the user requirements.

Cartesian mesh

To generate a Cartesian mesh of the model, set this mesh type in the Meshing→General branch of the preferences window. Once this option is selected, the 'Cartesian' branch appears in the Meshing part of the Preferences window.

We will leave all the default values and generate the mesh with a size of 0.5.

View of the cartesian mesh of the model generated with size 0.5.

It can be seen (in the Meshing→Cartesian branch of preferences window) that the default Cartesian mesher of GiD (Scan convert) is only generating volume elements. To generate line or surface elements, the mesher 'Zmesher' can be used.

Embedded mesh

For this section, we will work with the model gid_embedded_example.gid (it can be loaded from the folder where the courses material is). This model have a cubic volume, and the skin surface of a sphere.

As explained before, an embedded model consists in some volumes (the calculation volumes), and embedded regions defined by collection of surfaces. In this case, the calculation volume is the cube, and the embedded region is defined with the sphere surfaces.

First of all, select the 'Embedded' mesh type in the Meshing→general branch of the preferences window.

Then, generate the mesh of the model (Mesh→generate), using a general mesh size of 1. The following mesh should be generated:

View of the mesh generated.

As an embedded mesh, it can be seen that the volume mesh is fitted to the calculation volume (cube), and it is not conformal nor body-fitted to the embedded region (sphere skin).

A field of signed distances to the embedded contours has been calculated on the nodes of the calculation volume mesh. They are stored with the model, and can be appreciated going to the post-processing part of GiD (where they are loaded as a result), and visualizing the contour fill of it, or some iso-surface (for instance).

View of the contourfill of distances on the calculation volume meshView of the iso-surface of distance equal to 0 of the calculation volume mesh, where the sphere shape can be appreciated.