2 Copyright (C) 2015-2016 EDF
4 This file is part of SALOME HYDRO module.
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.
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.
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/>.
19 #########################################
21 #########################################
23 .. |mesh_init| image:: ../_static/mesh_init.png
28 .. |mesh_edit| image:: ../_static/mesh_edit.png
33 .. |mesh_hypo_edit| image:: ../_static/mesh_hypo_edit.png
38 .. |vtk_view_fitall| image:: ../_static/vtk_view_fitall.png
43 .. |vtk_view_top| image:: ../_static/vtk_view_top.png
49 .. |Capture_CreateMesh| image:: ../_static/Capture_CreateMesh.png
52 .. |Capture_HypothesisConstruction| image:: ../_static/Capture_HypothesisConstruction.png
55 .. |Capture_CreateSubMesh| image:: ../_static/Capture_CreateSubMesh.png
58 .. |Capture_HypothesisLocalLength| image:: ../_static/Capture_HypothesisLocalLength.png
61 .. |Capture_HypothesisNbSegments| image:: ../_static/Capture_HypothesisNbSegments.png
64 .. |Capture_WarningOrder| image:: ../_static/Capture_WarningOrder.png
67 .. |Capture_OrderingSubMeshes| image:: ../_static/Capture_OrderingSubMeshes.png
70 .. |Capture_MeshComputationSucceed| image:: ../_static/Capture_MeshComputationSucceed.png
73 .. |Capture_CreateGroupsFromGeometry| image:: ../_static/Capture_CreateGroupsFromGeometry.png
77 Once the geometry is ready, the *SMESH* mesh module can be activated.
79 Introduction to SMESH operations
80 ================================
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.
85 This algorithm and these hypotheses apply everywhere except where a part of the geometry (*sub-shape*) has been modified.
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.
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.
93 Dimension 1 meshes therefore take priority over and are a prerequisite for dimension 2 meshes.
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.
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.
105 Algorithms and underlying Hypotheses for the geometry
106 =====================================================
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.
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|.
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.
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.
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.
125 |Capture_HypothesisConstruction|
127 After confirming the hypothesis selections, validate the mesh creation dialog by clicking *Apply and Close*.
129 The mesh appears under the name *Mesh_1* in the tree with an icon indicating its status: *not generated or incomplete*.
131 The mesh can be renamed, either directly or by selecting the Edit dialog from the context menu.
133 The edit dialog box |mesh_edit| also offers the possibility of changing the algorithm or
134 modifying the hypotheses: |mesh_hypo_edit|.
139 A sub-mesh is created by selecting the mesh in the study tree (context menu: *Create sub-mesh*).
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.
145 It is useful to immediately rename the sub-mesh (first line of the dialog).
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.
151 |Capture_CreateSubMesh|
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.
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**.
162 |Capture_HypothesisLocalLength|
164 The definition of the sub-mesh is validated with the *Apply and Close* button in the sub-mesh dialog.
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*.
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.
173 |Capture_HypothesisNbSegments|
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:
178 |Capture_WarningOrder| |Capture_OrderingSubMeshes|
180 Select *SectionsGaronne* and move it up to the top of the list.
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.
189 |Capture_MeshComputationSucceed|
191 The mesh icon in the study tree has changed and now indicates as status *correctly generated*.
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.
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*.
205 The mesh must be verified to ensure it meets TELEMAC requirements.
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.
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).
219 Over-constrained triangles
220 --------------------------
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).
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.
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.
232 Creation of groups / Saving the mesh
233 ====================================
235 Groups of mesh nodes and mesh elements are useful in the bathymetry interpolation step and for defining the boundary conditions.
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.
241 |Capture_CreateGroupsFromGeometry|
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.
246 To save the mesh in MED file format, select the mesh and use the menu command: *File / Export / MED file*.
250 :ref:`ref_english_exempleInondation`