Salome HOME
fix warnings on tutorial build
[modules/hydro.git] / doc / salome / tutorial / english / english_maillage.rst
1 ..
2    Copyright (C) 2015-2016 EDF
3
4    This file is part of SALOME HYDRO module.
5
6    SALOME HYDRO module is free software: you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation, either version 3 of the License, or
9    (at your option) any later version.
10
11    SALOME HYDRO module is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with SALOME HYDRO module.  If not, see <http://www.gnu.org/licenses/>.
18
19 #########################################
20 Mesh creation
21 #########################################
22
23 .. |mesh_init| image:: ../_static/mesh_init.png
24    :align: middle
25    :width: 16pt
26    :height: 16pt
27
28 .. |mesh_edit| image:: ../_static/mesh_edit.png
29    :align: middle
30    :width: 16pt
31    :height: 16pt
32
33 .. |mesh_hypo_edit| image:: ../_static/mesh_hypo_edit.png
34    :align: middle
35    :width: 16pt
36    :height: 16pt
37
38 .. |vtk_view_fitall| image:: ../_static/vtk_view_fitall.png
39    :align: middle
40    :width: 16pt
41    :height: 16pt
42
43 .. |vtk_view_top| image:: ../_static/vtk_view_top.png
44    :align: middle
45    :width: 16pt
46    :height: 16pt
47
48
49 .. |Capture_CreateMesh| image:: ../_static/Capture_CreateMesh.png
50    :align: middle
51
52 .. |Capture_HypothesisConstruction| image:: ../_static/Capture_HypothesisConstruction.png
53    :align: middle
54
55 .. |Capture_CreateSubMesh| image:: ../_static/Capture_CreateSubMesh.png
56    :align: middle
57
58 .. |Capture_HypothesisLocalLength| image:: ../_static/Capture_HypothesisLocalLength.png
59    :align: middle
60
61 .. |Capture_HypothesisNbSegments| image:: ../_static/Capture_HypothesisNbSegments.png
62    :align: middle
63
64 .. |Capture_WarningOrder| image:: ../_static/Capture_WarningOrder.png
65    :align: middle
66
67 .. |Capture_OrderingSubMeshes| image:: ../_static/Capture_OrderingSubMeshes.png
68    :align: middle
69
70 .. |Capture_MeshComputationSucceed| image:: ../_static/Capture_MeshComputationSucceed.png
71    :align: middle
72
73 .. |Capture_CreateGroupsFromGeometry| image:: ../_static/Capture_CreateGroupsFromGeometry.png
74    :align: middle
75
76
77 Once the geometry is ready, the *SMESH* mesh module can be activated.
78
79 Introduction to SMESH operations
80 ================================
81
82 To specify the mesh, a default algorithm is generally defined with its parameter values:
83 these are the underlying assumptions of the algorithm, referred to as *"hypotheses"* in the SMESH module.
84
85 This algorithm and these hypotheses apply everywhere except where a part of the geometry (*sub-shape*) has been modified.
86
87 It is therefore possible to generate submeshes on a face or a group of faces, an edge or a group of edges,
88 in order to define specific algorithms and/or hypotheses.
89
90 During the meshing operation, the geometry of the part to be meshed is explored, starting with dimension 1 (edges)
91 then dimension 2 (faces) and finally dimension 3 (volumes).  In this example, there are no volumes.
92
93 Dimension 1 meshes therefore take priority over and are a prerequisite for dimension 2 meshes.
94
95 Certain algorithms manage several dimensions (in this case, edges and faces) simultaneously.
96 When these algorithms tolerate prescribed mesh from user-specified edges, the definition of the sub-meshes of
97 the face or faces concerned will be taken into account, otherwise it will not.
98 Similarly, according to the algorithm selected for a face, the 1D tab of the Create mesh dialog box will
99 either be active or not.
100
101 As a result, there may be occasions where, for certain *sub-shapes*, several algorithms and/or hypotheses
102 are defined, in which case a hierarchy of priority must be established. These situations are automatically
103 detected and the user is offered a list of choices.
104
105 Algorithms and underlying Hypotheses for the geometry
106 =====================================================
107
108 In this example, a triangle mesh will be specified as the default option over the whole domain
109 and the mesh of the minor bed will be customised to obtain stretched triangles oriented along the flow path.
110
111 To start defining the mesh, select the *HYDRO_garonne_1* geometry in the study tree and the
112 *Mesh / Create Mesh* menu or click on the icon |mesh_init|.
113
114 In the *Create Mesh* dialog box, select the mesh algorithm *Netgen 1D–2D*,
115 which will apply by default to all of the geometry.
116
117   |Capture_CreateMesh|
118
119 The mesh hypotheses must be specified: Click on the active button in the *Hypothesis* row to choose a hypothesis type,
120 and select *Netgen 2D Parameters* from the drop-down options.
121
122 In the newly opened window, select a maximum edge length of 200 (metres) and a minimum length of 50.
123 For the rate of increase in triangle size, *Fineness*, choose Very Fine, to preserve the quality of the triangles.
124
125   |Capture_HypothesisConstruction|
126
127 After confirming the hypothesis selections, validate the mesh creation dialog by clicking *Apply and Close*.
128
129 The mesh appears under the name *Mesh_1* in the tree with an icon indicating its status: *not generated or incomplete*.
130
131 The mesh can be renamed, either directly or by selecting the Edit dialog from the context menu.
132
133 The edit dialog box |mesh_edit| also offers the possibility of changing the algorithm or
134 modifying the hypotheses: |mesh_hypo_edit|.
135
136 Sub-meshes
137 ==========
138
139 A sub-mesh is created by selecting the mesh in the study tree (context menu: *Create sub-mesh*).
140
141 The geometry needs to be entered in the open dialog by clicking on the *litMineur* face listed under *HYDRO_garonne_1*
142 in the study tree. To make this selection, the navigation arrow on the *Geometry* line must be active,
143 which it is by default.
144
145 It is useful to immediately rename the sub-mesh (first line of the dialog).
146
147 Next, select the *Quadrangle (Medial Axis projection)* algorithm.
148 This algorithm reconstructs an imaginary hydraulic axis and decomposes the river into quadrangles
149 at right angles to the hydraulic axis.
150
151   |Capture_CreateSubMesh|
152
153 The length of the quadrangles and their number in the river cross-section still need to be defined.
154 In the *1D* tab of the *litMineur* sub-mesh dialog, choose the *Wire Discretisation* algorithm
155 and the *Local Length* hypothesis and then select a length of 100 (metres).
156 It is desirable to rename the hypothesis at this stage.
157
158 **Note**: The hypotheses and algorithms can be shared between several meshes and sub-meshes,
159 enabling to modify in one place everything that needs to remain consistent,
160 so **it is useful to give them meaningful names now that will help to identify them later**.
161
162   |Capture_HypothesisLocalLength|
163
164 The definition of the sub-mesh is validated with the *Apply and Close* button in the sub-mesh dialog.
165
166 The length defined above applies both lengthwise and width wise. To control the number of transverse mesh elements,
167 a new sub-mesh is necessary, which will be applied to the edge group *SectionsGaronne*.
168
169 Create a sub-mesh on *SectionsGaronne*, this time taking *Wire Discretisation* as algorithm
170 and *Nb. Segments* as the hypothesis.
171 Select 8 segments and *Equidistant distribution* to have a regularly distributed submesh.
172
173   |Capture_HypothesisNbSegments|
174
175 Use the *Apply and Close* button to validate the defined settings for this sub-mesh.
176 A priority needs to be established between two definitions:
177
178   |Capture_WarningOrder|  |Capture_OrderingSubMeshes|
179
180 Select *SectionsGaronne* and move it up to the top of the list.
181
182 Mesh generation
183 ===============
184
185 After validating the previous step, the mesh is ready to be generated.
186 To do so, select the mesh and click on the *Compute* context menu.
187 An information box displaying basic statistics appears at the end of the computation.
188
189 |Capture_MeshComputationSucceed|
190
191 The mesh icon in the study tree has changed and now indicates as status *correctly generated*.
192
193 The mesh is still not complete for the requirements of the example case but it can now be viewed.
194 To display it, click on *show* then *FitAll*  |vtk_view_fitall|
195 and top view |vtk_view_top| (*-0Z*) in the 3D viewer icon bar.
196
197 The *Modification/Cutting of Quadrangles* menu is now used to cut the quadrangles.
198 In the dialog, check *apply to all*, *use diagonal 1-3* then *preview*:
199 the proposed modification appears and can be checked by zooming in with the mouse wheel.
200 Validate with *Apply and Close*.
201
202 Mesh control
203 ============
204
205 The mesh must be verified to ensure it meets TELEMAC requirements.
206
207 Mesh orientation
208 ----------------
209
210 For XY surface meshes, **triangles may be oriented by default in SALOME in the opposite direction to the one expected by TELEMAC**,
211 depending on the direction used to draw the lines. Thus, SALOME may orients triangles with the normal pointing downwards from the face.
212 This can be checked via the mesh colour (darker blue on the back than on the front) or by using the *Orientation of Faces* command
213 in the 3D view context menu of the mesh. This command draws one arrow per triangle.
214 Only a point is seen on the back of the face; the view angle has to be changed to see the arrows.
215
216 To reorient the faces, use the *Modification / Orientation* menu and check the *Apply to All* option.
217 After validating the operation, the faces change colour (lighter blue).
218
219 Over-constrained triangles
220 --------------------------
221
222 The use of different boundary conditions on two edges of a triangle should be avoided and, more generally,
223 avoid having imposing boundary conditions on two edges (no degrees of freedom on the triangle).
224
225 Mesh generators sometimes create such triangles in the corners of the mesh.  This will happen with Netgen in the case of acute angles.
226 Whenever possible, avoid creating acute angles at the domain boundaries.
227
228 Over-constrained triangles are detected using the *Controls / Face Controls / Over-constrained faces* menu command.
229 To correct this problem, the *Modification / Diagonal Inversion* menu command should be used,
230 selecting the internal edge of the triangle in question.
231
232 Creation of groups / Saving the mesh
233 ====================================
234
235 Groups of mesh nodes and mesh elements are useful in the bathymetry interpolation step and for defining the boundary conditions.
236
237 Mesh groups are defined with the *Create Groups from Geometry* command in the context menu of the mesh.
238 The **element** and **node** groups are constituted successively by selecting
239 all the groups and sub Shapes of the HYDRO_garonne_1 geometry.
240
241   |Capture_CreateGroupsFromGeometry|
242
243 These groups appear in the study tree under the mesh after validation of the dialog.
244 They can be seen with *show only* and it is also possible to highlight them using the *Auto Color* option in the mesh context menu.
245
246 To save the mesh in MED file format, select the mesh and use the menu command:  *File / Export / MED file*.
247
248 .. only:: html
249
250    :ref:`ref_english_exempleInondation`