Salome HOME
Merge branch 'BR_2018_V8_5' into BR_PY3
[modules/hydro.git] / doc / salome / tutorial / english / english_polylignes.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 Creation / modification of polylines
21 #########################################
22
23 .. |contour_garonne| image:: /../_static/contourGaronne.png
24    :align: middle
25
26 .. |contour_lit_majeur| image:: /../_static/contourLitMajeur.png
27    :align: middle
28
29 .. |icone_polyligne_xy| image:: /../_static/icon_polyline_xy.png
30    :align: middle
31
32 .. |createPolyligneDialogue1| image:: /../_static/createPolyligneDialogue1.png
33    :align: middle
34
35 .. |insertNewSection| image:: /../_static/insertNewSection.png
36    :align: middle
37
38 .. |createPolyligneDialogue2| image:: /../_static/createPolyligneDialogue2.png
39    :align: middle
40
41 .. |addition_mode| image:: /../_static/additionMode.png
42    :align: middle
43
44 .. |ajoutPointsPolyligne| image:: /../_static/ajoutPointsPolyligne.png
45    :align: middle
46
47 .. |modification_mode| image:: /../_static/modificationMode.png
48    :align: middle
49
50 .. |undoPoly| image:: /../_static/undoPoly.png
51    :align: middle
52
53 .. |modificationPolyligne2| image:: /../_static/modificationPolyligne2.png
54    :align: middle
55
56 We are going to create three lines by drawing on the maps and the bathymetry.
57  
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: 
60
61   |contour_garonne|
62
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. 
65
66 * A closed contour in broken lines that will delineate the boundaries of our study domain.
67
68 The contour of the major bed and the study domain: 
69
70   |contour_lit_majeur|
71
72 Drawing the river banks
73 =======================
74
75 The context menu |icone_polyligne_xy| of the *POLYLINES* folder in the SALOME study tree is used to create a polyline.
76
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. 
79
80 * **remark** : do not use accentuated characters in object names: this may induce problems, fr instance in dump Python scripts.
81   
82 They can always be renamed later: 
83
84   |createPolyligneDialogue1|
85
86 The polylines may comprise several sections. We will only be using one, which has to be created: 
87
88   |insertNewSection|
89
90 In the dialog box related to the section, choose a spline-type, closed line and click on the add button. 
91
92   |createPolyligneDialogue2|
93
94  * **Note**: There are two types of polyline: 
95
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.
99  
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. 
102
103 Once the section has been created, points must be added by switching to the addition mode: 
104
105   |addition_mode|
106
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: 
110
111   |undoPoly|
112
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.**
115
116   |ajoutPointsPolyligne|
117
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.
121
122 When the entry is finished, confirm the created section by clicking *apply and close*.
123
124 Modifying and editing polylines
125 -------------------------------
126  
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:
129
130   |modification_mode|
131
132 It is then possible to: 
133
134  * Select a single point by clicking on it, 
135
136  * Select several points by enclosing them in a selection box, 
137
138  * Create an intermediate point by clicking on the line, between two points. 
139
140 The selected point(s) can be moved using drag-and-drop (left button click and hold down while moving).
141
142 They remain selected until another click or selection is made. 
143
144 The Undo button can be used, if needed, to cancel the latest changes. 
145
146 The coordinates of the selected points are displayed in the dialog box as editable text.
147
148   |modificationPolyligne2|
149
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).
153
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*. 
157
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. 
160
161 Drawing the contour of the major bed and the study domain
162 =========================================================
163
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. 
167
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).
173
174 .. only:: html
175
176    :ref:`ref_exempleInondation`