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 #########################################
20 Creation / modification of polylines
21 #########################################
23 .. |contour_garonne| image:: /../_static/contourGaronne.png
26 .. |contour_lit_majeur| image:: /../_static/contourLitMajeur.png
29 .. |icone_polyligne_xy| image:: /../_static/icon_polyline_xy.png
32 .. |createPolyligneDialogue1| image:: /../_static/createPolyligneDialogue1.png
35 .. |insertNewSection| image:: /../_static/insertNewSection.png
38 .. |createPolyligneDialogue2| image:: /../_static/createPolyligneDialogue2.png
41 .. |addition_mode| image:: /../_static/additionMode.png
44 .. |ajoutPointsPolyligne| image:: /../_static/ajoutPointsPolyligne.png
47 .. |modification_mode| image:: /../_static/modificationMode.png
50 .. |undoPoly| image:: /../_static/undoPoly.png
53 .. |modificationPolyligne2| image:: /../_static/modificationPolyligne2.png
56 We are going to create three lines by drawing on the maps and the bathymetry.
58 * A closed contour representing a portion of the Garonne (extending beyond the study domain defined later)
59 represented by the dark blue surface in the following image:
63 * Another closed contour on a portion of the major bed of the river (still extending beyond the study domain
64 both upstream and downstream), corresponding to the bathymetry field garonne_point_L93.
66 * A closed contour in broken lines that will delineate the boundaries of our study domain.
68 The contour of the major bed and the study domain:
72 Drawing the river banks
73 =======================
75 The context menu |icone_polyligne_xy| of the *POLYLINES* folder in the SALOME study tree is used to create a polyline.
77 The first section of the creation dialog box is used to name the polyline.
78 It is important to give the objects meaningful names as a large number of them may be need to be handled.
80 * **remark** : do not use accentuated characters in object names: this may induce problems, fr instance in dump Python scripts.
82 They can always be renamed later:
84 |createPolyligneDialogue1|
86 The polylines may comprise several sections. We will only be using one, which has to be created:
90 In the dialog box related to the section, choose a spline-type, closed line and click on the add button.
92 |createPolyligneDialogue2|
94 * **Note**: There are two types of polyline:
96 * *spline*: a single continuous line, with derivative continuity passing through all the points.
97 This type of line is privileged when creating curved lines; the control points will not be reused in the mesh,
98 resulting in more flexibility control of the mesh refinement.
100 * polyline: a single continuous line, composed of straight segments. This type of line must be used for artificial
101 objects comprising straight segments and whenever broken lines are needed. The points are kept in the mesh.
103 Once the section has been created, points must be added by switching to the addition mode:
107 Now click on the map, starting at one end **(upstream or downstream of the domain)** and follow the contour of the river.
108 Each click adds a point and the closed contour is progressively drawn. One or more of the last points can be deleted
109 with the undo / redo buttons:
113 * **Note**: **The choice of where to start a closed line is important: the corresponding point is the only mesh-imposed
114 point. In the case of a river, it is best to put this point outside the domain.**
116 |ajoutPointsPolyligne|
118 Continue to add points as needed until you arrive back at the starting point, having represented the two banks.
119 There is no need to add too many points, unless the riverbank is deeply incised and these details need to be captured.
120 For example, about sixty points are required along the river portion of interest in this case.
122 When the entry is finished, confirm the created section by clicking *apply and close*.
124 Modifying and editing polylines
125 -------------------------------
127 If the result is not satisfactory, the polyline can be modified through the associated context menu,
128 by first selecting the section and afterwards clicking on modification mode:
132 It is then possible to:
134 * Select a single point by clicking on it,
136 * Select several points by enclosing them in a selection box,
138 * Create an intermediate point by clicking on the line, between two points.
140 The selected point(s) can be moved using drag-and-drop (left button click and hold down while moving).
142 They remain selected until another click or selection is made.
144 The Undo button can be used, if needed, to cancel the latest changes.
146 The coordinates of the selected points are displayed in the dialog box as editable text.
148 |modificationPolyligne2|
150 Two lines appear when editing: a precise, solid black line that is not recalculated each time an edit is made
151 and a red line that changes with each modification. The latter is less precise but is redrawn more quickly
152 (This is an important factor when lines containing a "large" number of points need to be modified).
154 The line can be recalculated from within the dialog box by clicking the *apply* button.
155 If you wish to continue the modifications, the section can then be reselected with a double click,
156 followed by *OK* or *Cancel*.
158 * **Note**: In edition mode, double clicking on the section provides options to change the segment type,
159 from spline to polyline or vice versa, and the closure.
161 Drawing the contour of the major bed and the study domain
162 =========================================================
164 Once the river has been drawn, the next step is to draw the contour of the major river bed bathymetry,
165 *garonne_point_L93*, then define the outside contour of the computational domain,
166 which must cut the other two lines upstream and downstream.
168 **It is preferable for the computational domain to cut the river perpendicular to its axis,
169 in order to correctly define the upstream and downstream boundary conditions.
170 The creation of acute angles at the boundary of the domain should be avoided, as they increase the risk
171 of over-constrained triangles appearing when the mesh is created**
172 (this problem that can be corrected by diagonal detection and inversion).
176 :ref:`ref_exempleInondation`