# Mesh FEM da forma con GMSH

Mesh FEM da forma con Gmsh |

Posizione nel menu |
---|

Mesh → Mesh FEM da forma con Gmsh |

Ambiente |

FEM |

Avvio veloce |

Nessuno |

Introdotto nella versione |

- |

Vedere anche |

FEM tutorial |

## Descrizione

Per un'analisi degli elementi finiti, la geometria deve essere discretizzata in Mesh FEM. Questo comando utilizza gmsh (che deve essere installato sul sistema) per il calcolo della mesh.

Gmsh is bundled with the FreeCAD installation binaries. Alternatively you can install it separately from FreeCAD and then use the menu **Edit → Preferences → FEM → Gmsh** to set the path to the *gmsh.exe*.

## Utilizzo

- Selezionare la forma da analizzare. Il volume FEM deve essere un solido o un solido composto. Se la parte è composta da più materiali è necessario un solido composto. (Un solido composto può essere creato con il comando Frammenti booleani.) -- Per travi e solette FEM qualcuno dovrebbe aggiungere qui delle spiegazioni dettagliate.
- Premere il pulsante Mesh FEM da forma con GMSH
- Modificare facoltativamente la dimensione dell'elemento minimo e massimo. (Il rilevamento automatico funziona correttamente a meno che non si applichino complicate condizioni.)
- Cliccare sul pulsante Apply e attendere il completamento del calcolo della mesh
- Chiudere l'attività. Ora nel contenitore delle analisi attivo si dovrebbe vedere un nuovo oggetto FEMMeshGMSH.

After the mesh has been crated you can change its properties using the property editor. After you changed a property, you must reopen the Gmsh dialog again and click the Apply button. (You can leave the dialog open while changing properties.)

## Properties

- Dati
**Algorithm2D**: The algorithm to create 2D meshes. The different algorithms are explained here. For Delaunay, see Delaunay triangulation. - Dati
**Algorithm3D**: The algorithm to create 3D meshes. The different algorithms are explained here. - Dati
**Characteristic Length Max**: The maximal size of the mesh elements. If set to*0.0*, the size will be set automatically. This property can also be changed in the Gmsh dialog in the field**Max element size**. - Dati
**Characteristic Length Min**: The minimal size of the mesh elements. If set to*0.0*, the size will be set automatically. This property can also be changed in the Gmsh dialog in the field**Min element size**. - Dati
**Coherence Mesh**:- true (default); duplicate mesh nodes will be removed
- false

- Dati
**Element Dimension**: The dimension of the mesh elements. This property can also be changed in the Gmsh dialog in the field**Mesh element dimension**.- From Shape (default); the dimension will be determined from the dimension of the object that is meshed
- 1D
- 2D
- 3D

- Dati
**Element Order**: The mesh element order. This property can also be changed in the Gmsh dialog in the field**Mesh order**. introduced in version 0.20- 1st
- 2nd (default)

- Dati
**Geometrical Tolerance**: The geometrical tolerance for the mesh to match the object edges. The default*0.0*means that Gmsh's default of 1e-8 is used. - Dati
**Groups Of Nodes**: All nodes and not only the elements will be saved for each physical mesh group. Physical groups are collections of mesh entities (points, curves, surfaces and volumes). They and are identified by their dimension and by a tag. For example a mesh of the same object region is internally tagged the same. So all surfaces of this region will form one physical group. - Dati
**High Order Optimize**: If and how meshes with Dati**Element Order**=*2nd*are optimized. The optimization is done by a deformation of the element borders.

introduced in version 0.20 Gmsh supports different optimization algorithms.**Elastic**is an algorithm in which the mesh elements are treated as a collection of deformable viscoelastic solids. 1st order meshes cannot be optimized because their element borders are linear an cannot be deformed. - Dati
**Mesh Size From Curvature**introduced in version 0.20: The number of mesh elements per times the radius of the curvature. To get a finer mesh at small corners or holes, this value can be increased for better results

Effect of *Mesh Size From Curvature'*; left: set to 12, right: deactivated

- Dati
**Optimize Netgen**: Whether the mesh will be optimized using the 3D mesh generator Netgen to improve the quality of tetrahedral elements.**Note:**since Netgen can only create tetrahedral elements, this option is ignored for meshes whose Dati**Element Dimension**is not*3D*. - Dati
**Recombination Algorithm**introduced in version 0.20: The algorithm used for Dati**Recombine 3D All**and also for Dati**Recombine All**. For more info, see section Element Recombination and for technical details see the Gmsh documentation. - Dati
**Recombine 3D All**introduced in version 0.20: Applies a recombination 3D-algorithm to all volumes. Tetrahedra will be recombined into prisms, hexahedra or pyramids if possible. - Dati
**Recombine All**: Applies a recombination algorithm to all surfaces. Triangles will be recombined into quadrangles when possible. - Dati
**Optimize Std**Optimizes the mesh to improve the quality of tetrahedral elements. - Dati
**Second Order Linear**: Option if second order nodes (if Dati**Element Order**set to*2nd*) and/or mesh refinement points are created by linear interpolation.- true; linear interpolation is used
- false (default); curvilinear interpolation is used

## Notes

### Nonpositive Jacobians

When you get a meshing erro about nonpositive Jacobians, you can try out the following strategies:

- Set Dati
**Second Order Linear**to*true*but keep Dati**Element Order**at*2nd*. - Set Dati
**Element Order**to*1st*. - Use a smaller element size by reducing the Dati
**Characteristic Length Max**. - If solver ccxtools is used and the run button is used (not the task panel) the nodes of non positive jacobian elements will be green.

### Mesh Growth

At edges and small geometric entities the mesh has to be smaller than in areas without edges. So the mesh element size grows away from edges. The growing strategy of Gmsh is to grow between edges with different sizes. So the growing fails when an area has the same sized edges like for example this tube:

Failing mesh growing because the cylindrical area is surrounded be the same edges

To enable a sensible mesh growing, you must in this case add an edge to the area. In the example this would be a circle in the middle of the cylinder. The circle is added as part of a BooleanFragments compound (to form a CompSolid), see the project file of the example.

Sensible mesh growing due to the additional edge in the middle of the cylindrical aread

### Element Recombination

Elements can be recombined in two ways, on the surface of objects so that triangles will be recombined into quadrangles if possible and in the volume of objects so that tetrahedra will be recombined into prisms, hexahedra or pyramids if possible. Thinking about the geometry, it becomes clear that the recombination result depends strongly on the geometry of the body and that recombining a 3D body only at the surface will mostly lead to strange results.

To illustrate this, look at the image below. A cuboid body is meshed using the standard settings (tetrahedra, 2nd order mesh). This is the subimage at the upper left. The image at the upper right shows the result, when additionally the elements are recombined only at the surface of the body. The result is bad because the changed surface elements don't fit to the unchanged volume elements. So Dati**Recombine All** alone usually only makes sense for 2D meshes.

When we use now also Dati**Recombine 3D All**, the result is better, see the lower left subimage. However, the result doesn't show a great difference compared to the mesh without recombinations. Since our body is a cuboid, it is therefore sensible to use a recombination algorithm that tries to create cuboids as well. And this result is shown in the subimage at the lower right.

The *Simple* recombination algorithm will leave some triangles in the mesh in case the recombining leads to badly shaped quads. In such cases use a *full-quad* recombination algorithm, which will automatically perform a coarser mesh followed by the recombination, smoothing and subdividing. See forum topic

Effect of mesh element recombination. Upper left: standard mesh, Upper right: recombination only at the surface using the **Simple** algorithm, Lower left: recombination at the surface and in the volume using the *Simple* algorithm, Lower right: recombination at the surface and in the volume using the **Simple full-quad** algorithm

**Materials:**Solid, Fluid, Nonlinear mechanical; Material editor

**Element geometry:**Beam (1D), Beam rotation (1D), Shell (2D), Fluid flow (1D)

**Constraints**

**Electrostatic:**Potential

**Fluid:**Initial velocity, Fluid boundary, Flow velocity

**Mechanical:**Fixed, Displacement, Plane rotation, Contact, Transform, Force, Pressure, Self weight, Bearing, Gear, Pulley

**Thermal:**Initial temperature, Heat flux, Temperature, Heat source

**Solve:**Calculix tools, CalculiX, Elmer, Z88;**Equations:**Heat, Elasticity, Electrostatic, Fluxsolver, Flow;**Solver:**Solver control, Solver run

**Results:**Purge, Show;**Postprocessing:**Apply changes, Pipeline from result, Create warp vector filter, Create scalar clip filter, Create cut filter, Create clip filter, Create data along line filter, Create linearized stresses,

Create data at point filter, Create functions

**Utilities:**Clipping plane, Remove clipping planes; Mesh clear, Mesh print info

**Additional:**Preferences; FEM Install, FEM Mesh, FEM Solver, FEM CalculiX, FEM Project, FEM Concrete; FEM Element Types

**Getting started****Installation:**Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap**Basics:**About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate

**Help:**Tutorials, Video tutorials**Workbenches:**Std Base, Arch, Draft, FEM, Image, Inspection, Mesh, OpenSCAD, Part, PartDesign, Path, Points, Raytracing, Reverse Engineering, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web**Deprecated or unmaintained workbenches:**Complete, Drawing, Robot

**Hubs:**User hub, Power users hub, Developer hub