3 \page constructing_meshes_page Constructing meshes
5 \n Construction of a mesh on some geometry consists of:
7 <li> \ref create_mesh_anchor "Creating of a mesh object"</li>
8 <li> \ref evaluate_anchor "Evaluating mesh size" (optional)</li>
9 <li> \ref preview_anchor "Previewing the mesh" (optional)</li>
10 <li> \ref submesh_order_anchor "Changing sub-mesh priority" (optional)</li>
11 <li> \ref compute_anchor "Computing the mesh"</li>
12 <li> \ref edit_anchor "Editing the mesh" (optional)</li>
15 \anchor create_mesh_anchor
16 <h2>Creation of a mesh object</h2>
17 <em>To construct a mesh:</em>
19 <li>Select a geometrical object for meshing.</li>
20 <li>In the \b Mesh menu select <b>Create Mesh</b> or click <em>"Create
21 Mesh"</em> button in the toolbar.
24 \image html image32.png
25 <em>"Create Mesh" button</em>
28 The following dialog box will appear:
30 \image html createmesh-inv.png
33 <li> To filter off irrelevant meshing algorithms, you can
34 select <b>Mesh Type</b> in the corresponding list from <b>Any,
35 Hexahedral, Tetrahedral, Triangular </b> and \b Quadrilateral (there
36 can be less items for the geometry of lower dimensions).
38 Selection of a mesh type hides all meshing algorithms that can not
39 generate elements of this type.</li>
41 <li>Apply \subpage basic_meshing_algos_page "meshing algorithms" and
42 \subpage about_hypo_page "hypotheses" which will be used to compute
45 "Create mesh" dialog box contains several tab pages titled \b 3D,
46 \b 2D, \b 1D and \b 0D. The title of each page reflects the
47 dimension of the CAD model (geometry) the algorithms listed on
48 this page affect and the maximal dimension of elements the algorithms
49 generate. For example, \b 3D page lists the algorithms that affect
50 3D geometrical objects (solids) and generate 3D mesh elements
51 (tetrahedra, hexahedra etc.)
54 - Some page(s) can be disabled if the source geometrical
55 object does not include shapes (sub-shapes) of the corresponding
56 dimension(s). For example, if the input object is a geometrical face,
57 \b 3D page is disabled.
58 - Some algorithms affect the geometry of several dimensions,
59 i.e. "1D-2D" or "1D-2D-3D". If such an algorithm is selected by the
60 user, the dialog box pages related to the corresponding lower level
61 dimensions are disabled.
62 - \b 0D page does not refer to the 0D elements, but to 0D
63 geometry (vertices). Mesh module does not provide algorithms that
64 produce 0D elements. Currently \b 0D page provides only one
65 algorithm "Segments around vertex" that allows specyfying the required
66 size of mesh edges about the selected vertex (or vertices).
68 For example, you need to mesh a 3D object.
70 First, type the name of your mesh in the \b Name box, by default,
71 it is "Mesh_1". Then select the geometrical object you wish to
72 mesh in the Object Browser and click "Select" button near \b Geometry
73 field (if the name of the object has not yet appeared in \b Geometry field).
75 \image html image120.png
76 <em>"Select" button</em>
79 Now you can define 3D Algorithm and 3D Hypotheses, which will be
80 applied to the solids of your geometrical object. Click the <em>"Add
81 Hypothesis"</em> button to add a hypothesis.
83 \image html image121.png
84 <em>"Add Hypothesis" button</em>
86 Click the <em>"Plus"</em> button to enable adding more additional hypotheses.
88 Click the <em>"Edit Hypothesis"</em> button to change the values for the
91 \image html image122.png
92 <em>"Edit Hypothesis" button</em>
95 Most 2D and 3D algorithms can work without hypotheses using
96 default meshing parameters. Some algorithms do not require any
97 hypotheses. After selection of an algorithm "Hypothesis" field of
98 the dialog can contain:
100 <li> <em>\<Default\></em> if the algorithm can work using default
102 <li> <em>\<None\></em> if the algorithm requires a hypothesis defining
104 <li> If the algorithm does not use hypotheses, this field is grayed.</li>
106 After selection of an algorithm <b>Add. Hypothesis</b> field can contain:
108 <li> <em>\<None\></em> if the algorithm can be tuned
109 using an additional hypothesis.</li>
110 <li> If the algorithm does not use additional hypotheses, this field is grayed.</li>
113 Proceed in the same way with 2D and 1D Algorithms and Hypotheses that
114 will be used to mesh faces and edges of your geometry. (Note
115 that any object has edges, even if their existence is not
116 apparent, for example, a sphere has 4 edges). Note that the
117 choice of hypotheses and lower dimension algorithms depends on
118 the higher dimension algorithm.
120 If you wish you can select different algorithms and/or hypotheses
121 for meshing some parts of your CAD model by \ref constructing_submeshes_page.
123 Some algorithms generate mesh of several dimensions, while others
124 produce mesh of only one dimension. In the latter case there must
125 be one Algorithm and zero or several
126 Hypotheses for each dimension of your object, otherwise you will
127 not get any mesh at all. Of course, if you wish to mesh a face,
128 which is a 2D object, you do not need to define a 3D Algorithm and
131 In the <b>Object Browser</b> the structure of the new mesh will be
132 displayed as follows:
135 \image html image88.jpg
140 <li>a mesh name (<em>Mesh_mechanic</em>);
141 <li>a reference to the geometrical object on the basis of
142 which the mesh has been constructed (\a mechanic);</li>
143 <li><b>Applied hypotheses</b> folder containing the references
144 to the hypotheses applied at the construction of the mesh;</li>
145 <li><b>Applied algorithms</b> folder containing the references
146 to the algorithms applied at the construction of the mesh.</li>
149 There is an alternative way to assign Algorithms and Hypotheses by
150 clicking <b>Assign a set of hypotheses</b> button and selecting among
151 pre-defined sets of hypotheses. In addition to the standard
152 sets of hypotheses, it is possible to create custom sets by editing
153 CustomMeshers.xml file located in the home directory. CustomMeshers.xml
154 file must describe sets of hypotheses in the
155 same way as ${SMESH_ROOT_DIR}/share/salome/resources/smesh/StdMeshers.xml
156 file does (sets of hypotheses are enclosed between <hypotheses-set-group>
159 \image html hypo_sets.png
160 List of sets of hypotheses. Tag <em>[custom]</em> is
161 automatically added to the sets defined by the user.
163 \note \a Automatic in the names of pre-defined sets of
164 hypotheses means only that initially \ref
165 automatic_length_anchor "Automatic Length" hypothesis was
166 included in these sets, and not that these sets are suitable for
167 meshing any geometry.
171 Consider trying a sample script for construction of a mesh from our
172 \ref tui_creating_meshes_page "TUI Scripts" section.
174 \anchor evaluate_anchor
175 <h2>Evaluating mesh size</h2>
177 After the mesh object is created and all hypotheses are assigned and
178 before \ref compute_anchor "Compute" operation, it is possible to
179 calculate the eventual mesh size. For this, select the mesh in
180 the <b>Object Browser</b> and from the \b Mesh menu select \b
181 Evaluate. The result of evaluation will be displayed in the following
184 \image html mesh_evaluation_succeed.png
186 \anchor preview_anchor
187 <h2>Previewing the mesh</h2>
189 Before \ref compute_anchor "the mesh computation", it is also possible
190 to see the mesh preview.
192 For this, select the mesh in the Object Browser. From the \b Mesh menu
193 select \b Preview or click "Preview" button in the toolbar or activate
194 "Preview" item from the pop-up menu.
197 \image html mesh_precompute.png
198 <em>"Preview" button</em>
201 Select <b>1D mesh</b> or <b>2D mesh</b> preview mode in the Preview dialog.
203 \image html preview_mesh_1D.png "1D mesh preview shows nodes computed on geometry edges"
205 \image html preview_mesh_2D.png "2D mesh preview shows edge mesh elements, computed on geometry faces"
207 <b>Compute</b> button computes the whole mesh.
209 When the Preview dialog is closed, the question about the storage of temporarily
210 created mesh elements appears:
212 \image html preview_tmp_data.png
214 These elements can be kept in the mesh.
217 \anchor submesh_order_anchor
218 <h2>Changing sub-mesh priority</h2>
220 If the mesh contains concurrent \ref constructing_submeshes_page "sub-meshes",
221 it is possible to change the priority of their computation, i.e. to
222 change the priority of applying algorithms to the shared sub-shapes of
225 <em>To change submesh priority:</em>
227 Choose "Change submesh priority" from the Mesh menu or a pop-up
228 menu. The opened dialog shows a list of submeshes in the order of
231 There is an example of submesh order modifications taking a Mesh created on a Box
232 shape. The main Mesh object:
234 <li><i>1D</i> <b>Wire discretisation</b> with <b>Number of Segments</b>=20</li>
235 <li><i>2D</i> <b>Triangle (Mefisto)</b> with Hypothesis<b>Max Element Area</b>
238 The first submesh object <b>Submesh_1</b> created on <b>Face_1</b> is:
240 <li><i>1D</i> <b>Wire discretisation</b> with <b>Number of Segments</b>=4</li>
241 <li><i>2D</i> <b>Triangle (Mefisto)</b> with Hypothesis <b>MaxElementArea</b>=1200</li>
243 The second submesh object <b>Submesh_2</b> created on <b>Face_2</b> is:
245 <li><i>1D</i> <b>Wire discretisation</b> with <b>Number of Segments</b>=8</li>
246 <li><i>2D</i> <b>Triangle (Mefisto)</b> with Hypothesis <b>MaxElementArea</b>=1200</li>
249 And the last submesh object <b>Submesh_3</b> created on <b>Face_3</b> is:
251 <li><i>1D</i> <b>Wire discretisation</b> with <b>Number of Segments</b>=12</li>
252 <li><i>2D</i> <b>Triangle (Mefisto)</b> with Hypothesis <b>MaxElementArea</b>=1200</li>
255 The sub-meshes become concurrent if they share sub-shapes that can be
256 meshed with different algorithms (or different hypotheses). In the
257 example, we have three submeshes with concurrent algorithms, because
258 they have different hypotheses.
260 The first mesh computation is made with:
262 \image html mesh_order_123.png
263 <em>"Mesh order SubMesh_1, SubMesh_2, SubMesh_3"</em></center>
265 \image html mesh_order_123_res.png
266 <em>"Result mesh with order SubMesh_1, SubMesh_2, SubMesh_3 "</em></center>
268 The next mesh computation is made with:
270 \image html mesh_order_213.png
271 <em>"Mesh order SubMesh_2, SubMesh_1, SubMesh_3"</em></center>
273 \image html mesh_order_213_res.png
274 <em>"Result mesh with order SubMesh_2, SubMesh_1, SubMesh_3 "</em></center>
276 And the last mesh computation is made with:
278 \image html mesh_order_321.png
279 <em>"Mesh order SubMesh_3, SubMesh_2, SubMesh_1"</em></center>
280 <center>\image html mesh_order_321_res.png
281 <em>"Result mesh with order SubMesh_3, SubMesh_2, SubMesh_1 "</em></center>
283 As we can see, each mesh computation has a different number of result
284 elements and a different mesh discretization on the shared edges (the edges
285 that are shared between <b>Face_1</b>, <b>Face_2</b> and <b>Face_3</b>)
287 Additionally, submesh priority (the order of applied algorithms) can
288 be modified not only in a separate dialog box, but also in
289 the <b>Preview</b>. This helps to preview different mesh results,
290 modifying the order of submeshes.
292 \image html mesh_order_preview.png
293 <em>"Preview with submesh priority list box"</em></center>
295 If there are no concurrent submeshes under the Mesh object, the user
296 will see the following information.
298 \image html mesh_order_no_concurrent.png
299 <em>"No concurrent submeshes detected"</em></center>
302 \anchor compute_anchor
303 <h2>Computing the mesh</h2>
305 It is equally possible to skip \ref evaluate_anchor "the Evaluation"
306 and \ref preview_anchor "the Preview" and to \b Compute the mesh after
307 the hypotheses are assigned. For this, select your mesh in
308 the <b>Object Browser</b>. From the \b Mesh menu select \b Compute or
309 click "Compute" button of the toolbar.
312 \image html image28.png
313 <em>"Compute" button</em>
316 After the mesh computation finishes, the Mesh Computation information
317 box appears. In case of a success, the box shows
318 information on number of entities of different types in the mesh.
320 \image html meshcomputationsucceed.png
322 If the mesh computation failed, the information about the cause of the
323 failure is provided in \b Errors table.
325 \image html meshcomputationfail.png
327 After you select the error, <b>Show Sub-shape</b> button allows
328 visualizing in magenta the geometrical entity that causes the error.
330 \image html failed_computation.png
331 <em>3D algorithm failed to compute mesh on a box shown using <b>Show
332 Sub-shape</b> button</em>
334 <b>Publish Sub-shape</b> button publishes the sub-shape, whose meshing
335 has failed, in GEOM component as a child of the mesh geometry, which
336 allows analyzing the problem geometry and creating a submesh on it in
337 order to locally tune the hypotheses.
339 If the failure is caused by an invalid input mesh and the algorithm has
340 found which mesh entities are bad, <b>Show bad Mesh</b>
341 button appears in the dialog. Clicked, it shows the bad mesh entities in
342 the Viewer in magenta. Sometimes the shown mesh entities are too small
343 or/and hidden by other mesh elements. They can be seen after
344 switching the mesh to Wireframe visualization mode or switching off
345 the visualization of faces and volumes (if any).
347 <b>Bad Mesh to Group</b> button creates groups of bad mesh entities
348 to facilitate their analysis.
350 \image html show_bad_mesh.png
351 <em>Edges bounding a hole in the surface are shown in magenta using <b>Show
352 bad Mesh</b> button</em>
354 \note Mesh Computation Information box does not appear if you set
355 "Mesh computation/Show a computation result notification" preference
356 to the "Never" value. This option gives the possibility to control mesh
357 computation reporting. There are the following possibilities: always
358 show the information box, show only if an error occurs or never.
359 By default, the information box is always shown after mesh computation operation.
363 <h2>Editing the mesh</h2>
365 It is possible to \ref modifying_meshes_page "edit the mesh" of
366 lower dimension before generation of mesh of higher dimension.
368 For example you can generate 2D mesh, modify it using e.g.
369 \ref pattern_mapping_page, and then generate 3D mesh basing on the
370 modified 2D mesh. The workflow is following:
371 - Define 1D and 2D meshing algorithms.
372 - Compute the mesh. 2D mesh is generated.
373 - Apply \ref pattern_mapping_page.
374 - Define 3D meshing algorithms without modifying 1D and 2D algorithms
376 - Compute the mesh. 3D mesh is generated.
378 \note Nodes and elements added \ref adding_nodes_and_elements_page
379 "manually" can't be used in this workflow because the manually created
380 entities are not attached to any geometry and thus (usually) can't be
381 found by a mesher paving some geometry.
383 <b>See Also</b> a sample TUI Script demonstrates the possibility of
384 \ref tui_editing_while_meshing "Intermediate edition while meshing"