3 \page constructing_meshes_page Constructing meshes
5 \n Construction of a mesh consists of:
7 <li>Selecting a geometrical object for meshing</li>
8 <li>Applying \subpage basic_meshing_algos_page "meshing algorithms" and
9 \subpage about_hypo_page "hypotheses" which will be used at computation of
13 <em>To construct a mesh:</em>
15 <li>In the \b Mesh menu select <b>Create Mesh</b> or click <em>"Create
16 Mesh"</em> button in the toolbar.
18 \image html image32.png
19 <center><em>"Create Mesh" button</em></center>
21 The following dialog box will appear:
23 \image html createmesh-inv.png
25 <li>For example, you need to mesh a 3d object.
26 \n First, type the name for your mesh in the "Name" box, by default,
27 it is "Mesh_1". Then select the object you wish to mesh in the Object
28 Browser and click the "Add" button (if name of the object not yet
29 appeared in \b Geometry field).
31 \image html image120.png
32 <center><em>"Add" button</em></center>
34 Now you can define 1d Algorithm and 1d Hypotheses, which will be
35 applied to the edges of your object. (Note that any object has edges,
36 even if their existence is not apparent, for example, a sphere has 4
37 edges). Click the <em>"Add Hypothesis"</em> button to add a
40 \image html image121.png
41 <center><em>"Add Hypothesis" button</em></center>
43 Click the <em>"Edit Hypothesis"</em> button to define values for the
46 \image html image122.png
47 <center><em>"Edit Hypothesis" button</em></center>
49 The use of additional hypotheses is optional (i.e. you may leave
52 Proceed in the same way with 2d and 3d Algorithms and Hypotheses, note
53 that the choice of hypotheses depends on the algorithm. There must be
54 one Algorithm and zero or several Hypotheses for each dimension of your
55 object (most standard 2D and 3D algorithms can work without
56 hypotheses using some default parameters),
57 otherwise you will not get any mesh at all. Of course, if you
58 wish to mesh a face, which is a 2d object, you don't need to define 3d
59 Algorithm and Hypotheses.
60 \n In the <b>Object Browser</b> the structure of the new mesh will be
63 \image html image88.jpg
67 <li>a reference to the geometrical object on the basis of which the mesh has been constructed;</li>
68 <li><b>Applied hypotheses</b> folder containing the references to the
69 hypotheses applied to the construction of the mesh;</li>
70 <li><b>Applied algorithms</b> folder containing the references to the
71 algorithms applied to the construction of the mesh.</li>
74 There is an alternative way to create a mesh on an object simply by
75 clicking <b>Assign a set of hypotheses</b> button and selecting among
76 pre-defined sets of hypotheses. In addition to the standard
77 sets of hypotheses, it is possible to create custom sets by editing
78 CustomMeshers.xml file located in the home directory. CustomMeshers.xml
79 file must describe sets of hypotheses in the
80 same way as ${SMESH_ROOT_DIR}/share/salome/resources/smesh/StdMeshers.xml
81 file does (sets of hypotheses are enclosed between <hypotheses-set-group>
83 \image html hypo_sets.png
84 <center>List of sets of hypotheses: <em>[custom]</em> is automatically added to the sets defined
88 \anchor preview_mesh_anchor
90 <li> After the mesh object is created and all hypotheses are assigned and
91 before the mesh computation, it is possible to see the mesh preview.
93 For this, select the mesh in the Object Browser. From the \b Mesh menu
94 select \b Preview or click "Preview" button in the
95 toolbar or activate "Preview" item from the pop-up menu.
97 \image html mesh_precompute.png
98 <center><em>"Preview" button</em></center>
100 Select <b>1D mesh</b> or <b>2D mesh</b> preview mode in the Preview dialog.
103 \image html preview_mesh_1D.png "1D mesh preview shows nodes computed on geometry edges"
105 \image html preview_mesh_2D.png "2D mesh preview shows edge mesh elements, computed on geometry faces"
107 <b>Compute</b> button computes the whole mesh.
109 When the Preview dialog is closed, the question about the storage of temporarily
110 created mesh elements appers:
112 \image html preview_tmp_data.png
114 These elenents can be reused in the next mesh computation.
118 <li>It is equally possible to skip the Preview and \b Compute the mesh
119 after the hypotheses are assigned. For this, select your mesh in the <b>Object
120 Browser</b>. From the \b Mesh menu select \b Compute or click "Compute" button of the
123 \image html image28.png
124 <center><em>"Compute" button</em></center>
126 The Mesh Computation information box appears.
128 \image html meshcomputationsucceed.png
130 If the mesh computation failed, the information about the cause of the
133 \image html meshcomputationfail.png
135 After you select the error, <b>Show Subshape</b> button allows
136 visualizing the geometrical entity that causes it.
138 \image html failed_computation.png "Example of the invalid input mesh"
140 \note Mesh Computation Information box does not appear if you set
141 "Mesh computation/Show a computation result notification" preference
142 to the "Never" value. This option gives the possibility to control mesh
143 computation reporting. There are the following possibilities: always
144 show information box, only if an error occurs or never.
145 By default, the information box is always shown after mesh computation operation.
147 <b>Publish Subshape</b> button publishes the subshape, whose meshing
148 failed, in GEOM component as a child of the mesh geometry, which
149 allows analyzing the problem geometry and creating a submesh on it in
150 order to locally tune hypotheses.
152 <b>NOTE</b> It is possible to define a 1D or a 2D mesh in a
153 python script and then use such submeshes in the construction of a 3D
154 mesh. For this, there exist two algorithms: <b>Use existing edges</b> and <b>Use
155 existing faces</b>. They are not entirely usable from the GUI, so a
156 mesh created using these algorithms should be exported into a python
157 script, edited and then imported into the GUi.
159 <li>It is possible to calculate the eventual mesh size
160 before \b Compute operation. For this, select the mesh in the <b>Object
161 Browser</b> and from the \b Mesh menu select \b Evaluate. The result of
162 evaluation will be displayed in the following information box:
164 \image html mesh_evaluation_succeed.png
169 \anchor mesh_order_anchor
172 If the mesh contains concurrent submeshes, it is possible to change
173 the priority of their computation, i.e. to change the priority of
174 applying algorithms to the shared subshapes of the Mesh shape.</li>
176 <em>To change submesh priority:</em>
178 <li>Choose "Change submesh priority" from the Mesh menu or a popup menu. The opened dialogue
179 shows a list of submeshes in the order of their priority.
181 There is an example of submesh order modifications of the Mesh created on a Box
182 shape. The main Mesh object:
184 <li><i>3D</i> <b>Tetrahedron (Netgen)</b> with Hypothesis<b>Max Element Volume</b></li>
185 <li><i>2D</i> <b>Triangle (Mefisto)</b> with Hypothesis<b>Max Element Area</b>
187 <li><i>1D</i> <b>Wire discretisation</b> with <b>Number of Segments</b>=20</li>
189 The first submesh object <b>Submesh_1</b> created on <b>Face_1</b>
192 <li><i>2D</i> Netgen 1D-2D with Hypothesis <b>Netgen Simple parameters</b>
193 (Number of Segments = 4)</li>
195 The second submesh object <b>Submesh_2</b> created on <b>Face_2</b>
198 <li><i>2D</i> Netgen 1D-2D with Hypothesis <b>Netgen Simple parameters</b>
199 (Number of Segments = 8)</li>
202 And the last submesh object <b>Submesh_3</b> created on <b>Face_3</b>
205 <li><i>2D</i> Netgen 1D-2D with Hypothesis <b>Netgen Simple parameters</b>
206 (Number of Segments = 12)</li>
208 The submeshes become concurrent if they share subshapes that can be meshed
209 with different algorithms (or different hypothesises).
210 In the example, we have three submeshes with concurrent algorithms,
211 because they have different hypotheses.
213 The first mesh computation is made with:
214 \image html mesh_order_123.png
215 <center><em>"Mesh order SubMesh_1, SubMesh_2, SubMesh_3"</em></center>
216 \image html mesh_order_123_res.png
217 <center><em>"Result mesh with order SubMesh_1, SubMesh_2, SubMesh_3 "</em></center>
219 The next mesh computation is made with:
220 \image html mesh_order_213.png
221 <center><em>"Mesh order SubMesh_2, SubMesh_1, SubMesh_3"</em></center>
222 \image html mesh_order_213_res.png
223 <center><em>"Result mesh with order SubMesh_2, SubMesh_1, SubMesh_3 "</em></center>
225 And the last mesh computation is made with:
226 \image html mesh_order_321.png
227 <center><em>"Mesh order SubMesh_3, SubMesh_2, SubMesh_1"</em></center>
228 \image html mesh_order_321_res.png
229 <center><em>"Result mesh with order SubMesh_3, SubMesh_2, SubMesh_1 "</em></center>
231 As we can see, each mesh computation has a different number of result
232 elements and a different mesh discretisation on the shared edges (the edges
233 that are shared between <b>Face_1</b>, <b>Face_2</b> and <b>Face_3</b>)
235 Additionally, submesh priority (the order of applied algorithms) can
236 be modified not only in a separate dialog box, but also in the
237 <b>Preview</b>. This helps to preview different mesh results,
238 modifying the order of submeshes.
239 \image html mesh_order_preview.png
240 <center><em>"Preview with submesh priority list box"</em></center>
242 If there are no concurrent submeshes under the Mesh object, the user will see the
243 following information.
244 \image html mesh_order_no_concurrent.png
245 <center><em>"No concurrent submeshes detected"</em></center>
249 Consider trying a sample script for construction of a mesh from our
250 \ref tui_creating_meshes_page "TUI Scripts" section.