Construction of a mesh on a geometry includes at least two (:ref:`mesh creation <create_mesh_anchor>` and :ref:`computing <compute_anchor>`) of the following steps:
*:ref:`create_mesh_anchor`, where you can specify meshing parameters to apply to all sub-shapes of the main shape.
*:ref:`Creation of sub-meshes <constructing_submeshes_page>`, (optional) where you can specify meshing parameters to apply to the selected sub-shapes.
*:ref:`evaluate_anchor` (optional) can be used to know an approximate number of elements before their actual generation.
*:ref:`preview_anchor` (optional) can be used to generate mesh of only lower dimension(s) in order to visually estimate it before full mesh generation, which can be much longer.
*:ref:`submesh_order_anchor` (optional) can be useful if there are concurrent sub-meshes defined.
*:ref:`compute_anchor` uses defined meshing parameters to generate mesh elements.
*:ref:`edit_anchor` (optional) can be used to :ref:`modify <modifying_meshes_page>` the mesh of a lower dimension before :ref:`computing <compute_anchor>` elements of an upper dimension.
#. To filter off irrelevant meshing algorithms, you can select **Mesh Type** in the corresponding list from **Any, Hexahedral, Tetrahedral, Triangular** and **Quadrilateral** (there can be less items for the geometry of lower dimensions). Selection of a mesh type hides all meshing algorithms that cannot generate elements of this type.
"Create mesh" dialog box contains several tab pages titled **3D**, **2D**, **1D** and **0D**. The title of each page reflects the dimension of the sub-shapes the algorithms listed on this page affect and the maximal dimension of elements the algorithms generate. For example, **3D** page lists the algorithms that affect 3D sub-shapes (solids) and generate 3D mesh elements (tetrahedra, hexahedra etc.)
As soon as you have selected an algorithm, you can create a hypothesis (or select an already created one). A set of accessible hypotheses includes only the hypotheses that can be used by the selected algorithm.
* Some page(s) can be disabled if the geometrical object does not include shapes (sub-shapes) of the corresponding dimension(s). For example, if the input object is a geometrical face, **3D** page is disabled.
* Some algorithms affect the geometry of several dimensions, i.e. 1D+2D or 1D+2D+3D. If such an algorithm is selected, the dialog pages related to the corresponding lower dimensions are disabled.
***0D** page refers to 0D geometry (vertices) rather than to 0D elements. Mesh module does not provide algorithms that produce 0D elements. Currently **0D** page provides only one algorithm "Segments around vertex" that allows specifying the required size of mesh edges about the selected vertex (or vertices).
First, you can change a default name of your mesh in the **Name** box. Then check that the selected geometrical object indicated in **Geometry** field, is what you wish to mesh; if not, select the correct object in the Object Browser. Click "Select" button |sel| near **Geometry** field if the name of the object has not yet appeared in **Geometry** field.
Now you can define 3D Algorithm and 3D Hypotheses, which will be applied to discretize the solids of your geometrical object using 3D elements. Click the *"Add Hypothesis"* button |add| to create and add a hypothesis.
Most 2D and 3D algorithms can work without hypotheses using default meshing parameters. Some algorithms do not require any hypotheses. After selection of an algorithm "Hypothesis" field of the dialog can contain:
Proceed in the same way with 2D and 1D Algorithms and Hypotheses that will be used to mesh faces and edges of your geometry. (Note that any object has edges, even if their existence is not apparent, for example, a sphere has 4 edges). Note that the choice of hypotheses and lower dimension algorithms depends on the higher dimension algorithm.
Some algorithms generate mesh of several dimensions, while others produce mesh of only one dimension. In the latter case there must be one Algorithm and zero or several Hypotheses for each dimension of your object, otherwise you will not get any mesh at all. Of course, if you wish to mesh a face, which is a 2D object, you do not need to define a 3D Algorithm and Hypotheses.
* a reference to the geometrical object on the basis of which the mesh has been constructed (*mechanic*);
***Applied hypotheses** folder containing the references to the hypotheses chosen at the construction of the mesh;
***Applied algorithms** folder containing the references to the algorithms chosen at the construction of the mesh.
***SubMeshes on Face** folder containing the sub-meshes defined on geometrical faces. There also can be folders for sub-meshes on vertices, edges, wires, shells, solids and compounds.
***Groups of Faces** folder containing the groups of mesh faces. There also can be folders for groups of nodes, edges, volumes 0D elements and balls.
There is an alternative way to assign Algorithms and Hypotheses by clicking **Assign a set of hypotheses** button and selecting among pre-defined sets of algorithms and hypotheses. In addition to the built-in sets of hypotheses, it is possible to create custom sets by editing CustomMeshers.xml file located in the home directory. CustomMeshers.xml file must describe sets of hypotheses in the same way as ${SMESH_ROOT_DIR}/share/salome/resources/smesh/StdMeshers.xml file does (sets of hypotheses are enclosed between \<hypotheses-set-group\> tags). For example:
If the file contents are incorrect, there can be an error at activation of Mesh module: *"fatal parsing error: error triggered by consumer in line ..."*
After the mesh object is created and all hypotheses are assigned and before :ref:`Compute <compute_anchor>` operation, it is possible to calculate the eventual mesh size. For this, select the mesh in the **Object Browser** and from the **Mesh** menu select **Evaluate**.
Before :ref:`the mesh computation <compute_anchor>`, it is also possible to see the mesh preview. This operation allows to incrementally compute the mesh, dimension by dimension, and to discard an unsatisfactory mesh.
For this, select the mesh in the Object Browser. From the **Mesh** menu select **Preview** or click "Preview" button |prv| in the toolbar or activate "Preview" item from the pop-up menu.
If the mesh contains concurrent :ref:`sub-meshes <constructing_submeshes_page>`, it is possible to change the priority of their computation, i.e. to change the priority of applying algorithms to the shared sub-shapes of the Mesh shape.
Choose **Change sub-mesh priority** from the **Mesh** menu or a pop-up menu. The opened dialog shows a list of sub-meshes in the order of their priority.
The sub-meshes become concurrent if they share sub-shapes that can be meshed with different algorithms (or different hypotheses). In the example, we have three sub-meshes with concurrent algorithms, because they have different hypotheses.
Mesh Computation Information box does not appear if you set :ref:`Mesh computation/Show a computation result notification <show_comp_result_pref>` preference to the "Never" value. This option gives the possibility to control mesh computation reporting. There are the following possibilities: always show the information box, show only if an error occurs or never. By default, the information box is always shown after mesh computation operation.
For example you can generate a 2D mesh, modify it using e.g. :ref:`Pattern mapping <pattern_mapping_page>`, and then generate a 3D mesh basing on the modified 2D mesh. The workflow is as follows:
Nodes and elements added :ref:`manually <adding_nodes_and_elements_page>` cannot be used in this workflow because the manually created entities are not attached to any geometry and thus (usually) cannot be found by the mesher paving a geometry.