Go to the first, previous, next, last section, table of contents.

# MESHING

Generating a mesh is the process where a finite element mesh is calculated from the geometry definition. This mesh will be used for the FEM analysis in a later step. Conditions (see section Conditions) and materials (see section Materials) assigned to geometric entities will be transferred to the nodes and elements of the new mesh.

What is meshed and how, is controlled by some default options which can be changed with the commands described later.

The generation does not depend on the state ON/OFF of the layers at the moment of the generation (see section Layers), but frozen layers are not meshed if the preference `NoMeshFrozenLayer` is selected (see section Preferences). Every node and element will be assigned to the layer in which the original geometrical entity was defined.

Defaults are:

- An entity is meshed if does not belong to a higher level entity.
- A line mesh is made of two-noded elements and a surface mesh is made of non-structured triangular elements. The default for structured meshes are quadrilateral elements. Volume meshes are composed by non-structured tetrahedral elements. Structured volume meshes are composed by hexahedra.

All these default elements use linear interpolations for the unknown variables.

## Generate

When everything is ready for mesh generation, select this command. If there is a previously generated mesh, GiD asks if this should be deleted, i.e., make it disappear from memory, not from disk until the next save (see section Save).

The mesher or mesher combination, can be chosen in (see section Preferences).

Next, GiD asks for a general element size which will be applied to all lines, surfaces and volumes that do not have a previously defined one (see section Assign unstruct sizes). GiD offers to the user to default possibilities:

- One default size automatically calculated by the program to define a coarse mesh.
- Last size given by the user in previus meshings.

User can choose one of these or enter a new one.

Size is given by the average side of the corresponding triangle or quadrilateral.

Progress in meshing is shown by one progress bar that indicates number of generated surfaces or volumes related to total number of surfaces or volumes.

Meshing can be stopped at any time by pressing button `Stop`. Sometimes it is necessary to press this button for some time to get the action done.

## Mesh view

When a mesh has already been generated, this option changes the visualization to mesh viewing. The reverse, the return to geometry, is automatically performed either by the same command or when selecting option `View geometry` (see section View geometry) or any command related to geometry.

## View boundaries

This option draws the boundaries of the mesh on the screen when chosen.

Boundaries for triangular or quadrilateral meshes are line-elements. Boundaries for tetrahedra or bricks meshes are triangles or quadrilaterals. This option can be useful to render a volume mesh (see section Render).

## Assign unstruct sizes

Size is given by the average side (edge) of the corresponding triangle or quadrilateral.

Assign sizes to points, lines, surfaces or volumes:
It is possible to assign different sizes to different entities of the mesh. This means that in the vicinity of these entities, the generated elements will be approximately of that size. All the entities that have not an assigned size when meshing, take the default size. Points do not take any size if none is given to them.

To assign a size of 0.0 to an entity is the same as setting the default size. The transition between different sizes is controlled by a parameter in preferences (see section Preferences).

Assign sizes by cordal error:
Option `By cordal error` asks the user for a minimum and a maximum size and a cordal error (the maximum distance between the generated element and the real geometry). GiD assigns the corresponding sizes to all the entities to accomplish this condition. It will only change the current sizes if the new one is smaller than the previously defined. In structured surfaces, stretching is permitted. It means that if necessary, elements can have very different size along both principal directions.
Note: It is assigned to entities a size between the minimum and maximum; however, when generating the mesh, GiD adapts the size of the elements only if necessary, exceeding sometimes the minimum and maximum limits.

Assign sizes by cordal error window

In this window the effect of different cordal error values over the number of elements that will be created over a line can be viewed. Any line of the geometry can be picked up and be used in this window.

Correct sizes:
When option `Correct sizes` is selected, a window appears. In this window it is possible to enter a minimum and a maximum mesh size.

Correct meshing sizes window

If option `By geometry` is activated, sizes are assigned to all the entities depending on the shape of the geometry. This means that smaller surfaces will have smaller elements. It will only change the existing sizes if the new size is smaller than that previously defined.

If option `Correct incompatible sizes` is activated, some sizes are reduced in order to control that the transitions between sizes in close entities are not too fast. It will only change the current sizes if the new one is smaller than that previously defined.

Note: Applying last two options with default values is exactly the same than setting the preference `Automatic correct sizes` to on in the preferences window (see section Preferences).

Note: To mesh a difficult volume trying to adjust element sizes to geometry detail, it may be useful to use `By geometry` and `Correct incompatible sizes` options setting the larger size equal to the default size for meshing, and the smaller size reflecting the details ( 10 times smaller, for example).

Background Mesh:
With this option it's possible to assign sizes using a background mesh of triangles or tetrahedrons. When the option is selected GiD asks for a file; that file must contain the background mesh. The background mesh must cover all the domain, so usually the background mesh will be a previous mesh of the same model.
The format of the file containing the background mesh is the following:

- First line: `BackgroundMesh V 1.0`
- Description of the mesh. The format of that mesh is described in the Mesh read section (see section GiD mesh).
- Desired sizes in the following format:

      DesiredSize (Nodes or Elements)
        number of        size
        node/element
      ...

  Background mesh file example:

      BackgroundMesh V 1.0
      MESH dimension       2 ElemType Triangle  Nnode 3
      Coordinates
            1          5.61705         4.81504         0.00000
       ...
           51         -5.64191        -1.53335         0.00000
      end coordinates

      Elements
            1         24         16         26
            2         16         10         14
      ...
           76         34         31         28
      end elements

      DesiredSize Elements
            1         0.20000
            2         0.20000
      ...
           75         1.50000
           76         1.50000
      End DesiredSize

CAUTION: Be careful when assigning big sizes to entities close to others where a small size has been given. It may be impossible to obtain a mesh.

CAUTION: When using contact elements (see section Contact creation), the same size must be used for contact and for duplicate entities.

## Draw Sizes

When sizes are assigned to points, lines, surfaces or volumes using the Assign Unstruct sizes option, it is possible to draw in different colors the different assigned sizes.

EXAMPLE

In the following example some different sizes are assigned to surfaces. Sizes of 3, 5 and 6 are assigned depending on the surface.

After choosing the Draw Sizes option, (over surfaces) we get the following result:

## Structured mesh

A structured mesh is defined as a mesh where all the nodes have the same number of elements around it.

The size of the elements is defined in a different way than for a non-structured mesh. In this case, the mesh is not defined by the size but by the number of elements that are required on every line. This number must be the same for all lines that are opposite to each other on each surface. When meshing volumes, this definition must be the same for opposite surfaces.

To create a structured mesh, choose `structured` and volumes, surfaces or lines. Surfaces can be 4-sided or NURBS ones. Planar surfaces meshes cannot be structured. After choosing `escape`, the number of elements per line is given. Later, lines can be selected and related lines (in option surface or volume), are added or deleted from the group. This process can be repeated as many times as necessary until all lines have a new value. By default, the generated elements will be quadrilateral or hexahedra and the lines with no numbering given will have two elements over them. All no selected lines will also have two elements by default.

Structured volumes must have 6 contour surfaces. Structured surfaces must be 4-sided surfaces or NURBS surfaces.

It is possible to mix some entities with structured meshes and others with unstructured ones.

To convert a structured entity to a non-structured one, select reset (see section Reset mesh data) or assign a size to it (see section Assign unstruct sizes).

To change the default element type See section Element type.

Note 1: One NURBS surface can be structured with any number of contour lines but must have a good shape form. This means that it must have 4 big angles and the other angles must be small. With this criteria, the shape will be topologically similar to one quadrilateral.

Note 2: When assigning structured divisions to one line or with difficult topology, GiD may need to reassign some sizes to make the structured mesh conformal. It will be done automatically. If it is impossible to create compatibility between surfaces, a message is given.

Note 3: It is possible to assign a number of structured divisions to the boundary line of a surface or volume, and then create an unstructured mesh for the surface/volume.

## Structured concentrate

By default, all partitions in one structured line have the same approximate length. This command lets the user select one line. Then, in the graphical window the sense of the line is shown with one arrow. The user will enter a positive or negative weight. If the weight is positive the size of the elements will be concentrated at the extreme of the line, if negative, the elements will be repelled.

As the magnitude of the weight increases, the diference between element sizes will be bigger.

## Mesh criteria

GiD provides three different criteria to generate the mesh. The `Default` option skips meshing the boundaries, that is, lines for surface meshes and surfaces for volume meshes. The `Mesh` option allows the user to choose the entities to be meshed, whilst the `No Mesh` option does the opposite.

## Element type

With this command, the type of element desired is selected. It is only necessary to do this when the element type is different from the default (see section MESHING).

Types are:

- Linear: for lines.
- Triangle and Quadrilateral: for surfaces.
- Tetrahedra and Hexahedra: for volumes.
- Only points: Just for volumes. Point elements are generated.
- Linear and Quadrilateral: for contact surfaces.
- Linear, Prism and Hexaedra: for contact volumes.

By default, the elements are of minimum order: 3-noded triangle, 4-noded quadrilateral and so on. To increase the degree, use command `Quadratic` (see section Quadratic). Option `Quadratic` applies to all the elements of the problem.

- `Point`: 1 node,

  | Point connectivity: |

- `Linear`: 2 or 3 nodes,

  | Line connectivities: |  |

- `Triangle`: 3 or 6 nodes,

  | Triangle connectivities: |  |

- `Quadrilateral`: 4, 8 or 9 nodes,

  | Quadrilateral connectivities: |  |  |

- `Tetrahedra`: 4 or 10 nodes,

  | Tetrahedral connectivities: |  |

- `Hexahedra`: 8, 20 or 27 nodes.

  | Hexahedral connectivities: |  |  |

The `Linear` option assures, not only the meshing of lines, but also the creation of 2-node contact lines between surfaces or volumes, if desired.

At contact surfaces, GiD elements are:

- Linear: 2 nodes.
- Triangle: 3 nodes.
- Quadrilateral: 4 nodes.

At contact volumes (and separated contacts), elements are:

- Linear: 2 nodes.
- Prisma: 6 nodes.
- Hexahedra: 8 nodes.

To decide what parts of the geometry should be meshed use command: See section Mesh criteria.

## Quadratic

Option `Quadratic` applies to all the elements of the problem. If chosen, elements will be:

- Linear: 3 nodes.
- Triangle: 6 nodes.
- Quadrilateral: 8 nodes.
- Tetrahedra: 10 nodes.
- Hexahedra: 20 nodes.

Option `Quadratic9` is similar to option `Quadratic`, but will generate 9-noded Quadrilaterals and 27-noded Hexahedra.

## Reset mesh data

This command resets, all the sizes assigned to entities. This means that all of them will be unassigned.

To unassign only some entities, assign size 0.0 (see section Assign unstruct sizes) to the entities where the default size is required.

The information about element types, mesh criteria and quadratic parameters is also reset.

## Cancel mesh

If a mesh has been previously generated, this option erases the mesh and makes it disappear.

## Mesh quality

This option opens a window that shows graphics about the quality of the mesh elements.

Mesh Quality window

There are four criteria in order to measure the quality of the elements:

1. Minimum angle: The quality criteria is the minimum angle in surface elements and the minimum dihedral angle for volume elements. This means that elements with a small angle are considered of a worse quality than the ones with bigger angles.
2. Maximum angle: It gives the maximum angle for every element. Elements with bigger angles are considered worse.
   Typically, the Minimum angle criteria is good to qualify triangles or tetrahedra and the Maximum angle criteria is good for quadrilaterals and hexahedra
3. Element vol: The quality criteria is the size of elements (distance for lines, area for surfaces and volume for volumes). Elements with little "volume" are considered worse.
4. Minimum edge: The quality criteria is the size of the edges of elements. Elements with smaller edges are considered worse.

There are two visualization modes:

1. Normal: the graph shows the number of elements that have an angle with a certain degree.
2. Accumulated: the graph shows the number of elements which have an angle with a given degree or smaller.

In the `MeshQuality` window, if you double click on a value, the elements below this value are selected in red. These selected elements can be sent to a layer using the `Send To Layer` button of the `Mesh Quality` window.

EXAMPLE

Example of an study of mesh quality

In this example we are studying the mesh using the minimum angle criteria. We can see that 140 elements of our mesh have an angle of smaller than 45,7 degrees. If we double click with the mouse on the graphic, the 140 elements which have an angle smaller than 140 degrees, will be selected.

## Edit mesh

These option let the user modify one mesh. All modification will be lost when the mesh is generated again.

### Move node

By using this command, an existing node is selected and moved. The new position is entered in the usual way (see section Point definition).

### Delete elements

To delete elements a selection is made (see section Entities selection). After pressing `escape` (see section Escape), the elements are erased.

The deletion of entities can be done in two ways: at one level (`point`, `line`, `surface` or `volume`) or erasing all entities at once. A selection is made (see section Entities selection) in both cases. After pressing `escape` (see section Escape), the elements are erased.

Nodes that do not belong to any element after the operation are also erased.

To avoid erasing the selected elements, press `break`.
Note: It is possible to filter the selection, for example, selecting only triangles but not quadrilaterals (see section Selection window).

### Delete lonely nodes

After confirmation, all the nodes of the mesh that do not belong to any element are erased.

Note: This command is only necessary for meshes imported from outside because internally generated or edited meshes, have this problem implicitly corrected.

Go to the first, previous, next, last section, table of contents.