FEM MeshGmshFromShape

Description
For a finite elements analysis the geometry needs to be discretized into a FEM Mesh. This command uses the program Gmsh (which needs to be installed on the system) for calculating the mesh.

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

Usage

 * 1) Select the shape you want to analyze. For volume FEM this needs to be a solid or compsolid. A compsolid is necessary if your part is made from multiple materials. (A compsolid can be created with the BooleanFragments command.)
 * 2) * Press the button.
 * 3) * Select the option from the menu.
 * 4) Optionally edit the minimal and maximal element size. (Autodetection works fine unless you apply complicated boundary conditions.)
 * 5) Click the  button and wait for the computation of the mesh to complete
 * 6) Close the task. You now should see a new FEMMeshGMSH object in your active analysis container.

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 button. (You can leave the dialog open while changing properties.)

Properties

 * : The maximal size of the mesh elements. If it is 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.
 * : The minimal size of the mesh elements. If it is 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.
 * : 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
 * : The mesh element order
 * 1st
 * 2nd (default)
 * : The number of mesh elements per $$2\pi$$ times the radius of the curvature. To get a finer mesh at small corners or holes, this value can be increased for better results


 * : This is a mesh refinement option that requires set to 2nd.
 * true; the new nodes are inserted by linear interpolation.
 * false (default); the new nodes are snapped to be on the actual geometry, e.g. at the object's surface.

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


 * Set to true but keep  at 2nd.
 * Set to 1st.
 * Use a smaller element size by reducing the.

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:



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.