Salome HOME
fix tests with Z interpolation to the nearest bathy point: The mesh varies slightly...
[modules/hydro.git] / doc / salome / examples / h019_normalCaseManualInterpolZStrickler.py
1 # -*- coding: utf-8 -*-
2
3 import os
4 HYDRO_SAMPLES = os.path.join( os.environ["HYDRO_ROOT_DIR"], "bin/salome/test/HYDRO")
5
6 import sys
7 import salome
8
9 salome.salome_init()
10
11 #----------------------
12 # --- HYDRO
13 #----------------------
14
15 from HYDROPy import *
16 from PyQt5.QtCore import *
17 from PyQt5.QtGui import *
18
19 hydro_doc = HYDROData_Document.Document()
20
21 hydro_doc.SetLocalCS( 430000, 6.35e+06 )
22
23 garonne_ign_01 = hydro_doc.CreateObject( KIND_IMAGE )
24 garonne_ign_01.SetName( "garonne_ign_01" )
25
26 garonne_ign_01.SetZLevel( 0 )
27
28
29 if not(garonne_ign_01.LoadImage(os.path.join(HYDRO_SAMPLES, "garonne_ign_01.png" ))):
30   raise ValueError('problem while loading image')
31
32 garonne_ign_01.SetLocalPoints( QPoint( 40, 817 ),
33                                QPoint( 1325, 85 ) )
34
35 garonne_ign_01.SetGlobalPoints( 1,
36                                 QPointF( 471562, 6.36775e+06 ),
37                                 QPointF( 489400, 6.37702e+06 ) )
38
39 garonne_ign_01.Update()
40
41 garonne_ign_02 = hydro_doc.CreateObject( KIND_IMAGE )
42 garonne_ign_02.SetName( "garonne_ign_02" )
43
44 garonne_ign_02.SetZLevel( 1 )
45
46
47 if not(garonne_ign_02.LoadImage( os.path.join(HYDRO_SAMPLES, "garonne_ign_02.png" ))):
48   raise ValueError('problem while loading image')
49
50 garonne_ign_02.SetLocalPoints( QPoint( 1389, 447 ),
51                                QPoint( 784, 481 ) )
52
53 garonne_ign_02.SetGlobalPoints( 3,
54                                 QPointF( 631, 95 ),
55                                 QPointF( 26, 129 ) )
56 garonne_ign_02.SetTrsfReferenceImage( garonne_ign_01 )
57
58 garonne_ign_02.Update()
59
60
61 def_strickler_table_06 = hydro_doc.CreateObject( KIND_STRICKLER_TABLE )
62 def_strickler_table_06.SetName( "def_strickler_table_06" )
63
64 def_strickler_table_06.SetAttrName( "CODE_06" )
65
66 def_strickler_table_06.Set( "Pelouses et pâturages naturels", 31 )
67 def_strickler_table_06.SetAttrValue( "Pelouses et pâturages naturels", "321" )
68 def_strickler_table_06.SetColor( "Pelouses et pâturages naturels", QColor( 204, 242, 77 ) )
69
70 def_strickler_table_06.Set( "Aéroports", 43 )
71 def_strickler_table_06.SetAttrValue( "Aéroports", "124" )
72 def_strickler_table_06.SetColor( "Aéroports", QColor( 230, 204, 230 ) )
73
74 def_strickler_table_06.Set( "Systèmes culturaux et parcellaires complexes", 19 )
75 def_strickler_table_06.SetAttrValue( "Systèmes culturaux et parcellaires complexes", "242" )
76 def_strickler_table_06.SetColor( "Systèmes culturaux et parcellaires complexes", QColor( 255, 230, 77 ) )
77
78 def_strickler_table_06.Set( "Cultures annuelles associées à des cultures permanentes", 27 )
79 def_strickler_table_06.SetAttrValue( "Cultures annuelles associées à des cultures permanentes", "241" )
80 def_strickler_table_06.SetColor( "Cultures annuelles associées à des cultures permanentes", QColor( 255, 230, 166 ) )
81
82 def_strickler_table_06.Set( "Forêt et végétation arbustive en mutation", 9 )
83 def_strickler_table_06.SetAttrValue( "Forêt et végétation arbustive en mutation", "324" )
84 def_strickler_table_06.SetColor( "Forêt et végétation arbustive en mutation", QColor( 166, 242, 0 ) )
85
86 def_strickler_table_06.Set( "Décharges", 21 )
87 def_strickler_table_06.SetAttrValue( "Décharges", "132" )
88 def_strickler_table_06.SetColor( "Décharges", QColor( 166, 77, 0 ) )
89
90 def_strickler_table_06.Set( "Végétation clairsemée", 43 )
91 def_strickler_table_06.SetAttrValue( "Végétation clairsemée", "333" )
92 def_strickler_table_06.SetColor( "Végétation clairsemée", QColor( 204, 255, 204 ) )
93
94 def_strickler_table_06.Set( "Prairies et autres surfaces toujours en herbe à usage agricole", 33 )
95 def_strickler_table_06.SetAttrValue( "Prairies et autres surfaces toujours en herbe à usage agricole", "231" )
96 def_strickler_table_06.SetColor( "Prairies et autres surfaces toujours en herbe à usage agricole", QColor( 230, 230, 77 ) )
97
98 def_strickler_table_06.Set( "Périmètres irrigués en permanence", 43 )
99 def_strickler_table_06.SetAttrValue( "Périmètres irrigués en permanence", "212" )
100 def_strickler_table_06.SetColor( "Périmètres irrigués en permanence", QColor( 255, 255, 0 ) )
101
102 def_strickler_table_06.Set( "Plans d'eau", 90 )
103 def_strickler_table_06.SetAttrValue( "Plans d'eau", "512" )
104 def_strickler_table_06.SetColor( "Plans d'eau", QColor( 128, 242, 230 ) )
105
106 def_strickler_table_06.Set( "Territoires agroforestiers", 14 )
107 def_strickler_table_06.SetAttrValue( "Territoires agroforestiers", "244" )
108 def_strickler_table_06.SetColor( "Territoires agroforestiers", QColor( 242, 204, 166 ) )
109
110 def_strickler_table_06.Set( "Forêts mélangées", 10 )
111 def_strickler_table_06.SetAttrValue( "Forêts mélangées", "313" )
112 def_strickler_table_06.SetColor( "Forêts mélangées", QColor( 77, 255, 0 ) )
113
114 def_strickler_table_06.Set( "Glaciers et neiges éternelles", 75 )
115 def_strickler_table_06.SetAttrValue( "Glaciers et neiges éternelles", "335" )
116 def_strickler_table_06.SetColor( "Glaciers et neiges éternelles", QColor( 166, 230, 204 ) )
117
118 def_strickler_table_06.Set( "Plages, dunes et sable", 39 )
119 def_strickler_table_06.SetAttrValue( "Plages, dunes et sable", "331" )
120 def_strickler_table_06.SetColor( "Plages, dunes et sable", QColor( 230, 230, 230 ) )
121
122 def_strickler_table_06.Set( "Zones incendiées", 65 )
123 def_strickler_table_06.SetAttrValue( "Zones incendiées", "334" )
124 def_strickler_table_06.SetColor( "Zones incendiées", QColor( 0, 0, 0 ) )
125
126 def_strickler_table_06.Set( "Tissu urbain continu", 15 )
127 def_strickler_table_06.SetAttrValue( "Tissu urbain continu", "111" )
128 def_strickler_table_06.SetColor( "Tissu urbain continu", QColor( 230, 0, 77 ) )
129
130 def_strickler_table_06.Set( "Chantiers", 17 )
131 def_strickler_table_06.SetAttrValue( "Chantiers", "133" )
132 def_strickler_table_06.SetColor( "Chantiers", QColor( 255, 77, 255 ) )
133
134 def_strickler_table_06.Set( "Estuaires", 98 )
135 def_strickler_table_06.SetAttrValue( "Estuaires", "522" )
136 def_strickler_table_06.SetColor( "Estuaires", QColor( 166, 255, 230 ) )
137
138 def_strickler_table_06.Set( "Marais maritimes", 74 )
139 def_strickler_table_06.SetAttrValue( "Marais maritimes", "421" )
140 def_strickler_table_06.SetColor( "Marais maritimes", QColor( 204, 204, 255 ) )
141
142 def_strickler_table_06.Set( "Forêts de conifères", 13 )
143 def_strickler_table_06.SetAttrValue( "Forêts de conifères", "312" )
144 def_strickler_table_06.SetColor( "Forêts de conifères", QColor( 0, 166, 0 ) )
145
146 def_strickler_table_06.Set( "Surfaces essentiellement agricoles, interrompues par des espaces naturels importants", 16 )
147 def_strickler_table_06.SetAttrValue( "Surfaces essentiellement agricoles, interrompues par des espaces naturels importants", "243" )
148 def_strickler_table_06.SetColor( "Surfaces essentiellement agricoles, interrompues par des espaces naturels importants", QColor( 230, 204, 77 ) )
149
150 def_strickler_table_06.Set( "Tourbières", 65 )
151 def_strickler_table_06.SetAttrValue( "Tourbières", "412" )
152 def_strickler_table_06.SetColor( "Tourbières", QColor( 77, 77, 255 ) )
153
154 def_strickler_table_06.Set( "Extraction de matériaux", 19 )
155 def_strickler_table_06.SetAttrValue( "Extraction de matériaux", "131" )
156 def_strickler_table_06.SetColor( "Extraction de matériaux", QColor( 166, 0, 204 ) )
157
158 def_strickler_table_06.Set( "Réseaux routier et ferroviaire et espaces associés", 35 )
159 def_strickler_table_06.SetAttrValue( "Réseaux routier et ferroviaire et espaces associés", "122" )
160 def_strickler_table_06.SetColor( "Réseaux routier et ferroviaire et espaces associés", QColor( 204, 0, 0 ) )
161
162 def_strickler_table_06.Set( "Mers et océans", 99 )
163 def_strickler_table_06.SetAttrValue( "Mers et océans", "523" )
164 def_strickler_table_06.SetColor( "Mers et océans", QColor( 230, 242, 255 ) )
165
166 def_strickler_table_06.Set( "Equipements sportifs et de loisirs", 40 )
167 def_strickler_table_06.SetAttrValue( "Equipements sportifs et de loisirs", "142" )
168 def_strickler_table_06.SetColor( "Equipements sportifs et de loisirs", QColor( 255, 230, 255 ) )
169
170 def_strickler_table_06.Set( "Forêts de feuillus", 9 )
171 def_strickler_table_06.SetAttrValue( "Forêts de feuillus", "311" )
172 def_strickler_table_06.SetColor( "Forêts de feuillus", QColor( 128, 255, 0 ) )
173
174 def_strickler_table_06.Set( "Vergers et petits fruits", 25 )
175 def_strickler_table_06.SetAttrValue( "Vergers et petits fruits", "222" )
176 def_strickler_table_06.SetColor( "Vergers et petits fruits", QColor( 242, 166, 77 ) )
177
178 def_strickler_table_06.Set( "Végétation sclérophylle", 10 )
179 def_strickler_table_06.SetAttrValue( "Végétation sclérophylle", "323" )
180 def_strickler_table_06.SetColor( "Végétation sclérophylle", QColor( 166, 230, 77 ) )
181
182 def_strickler_table_06.Set( "Landes et broussailles", 12 )
183 def_strickler_table_06.SetAttrValue( "Landes et broussailles", "322" )
184 def_strickler_table_06.SetColor( "Landes et broussailles", QColor( 166, 255, 128 ) )
185
186 def_strickler_table_06.Set( "Tissu urbain discontinu", 32 )
187 def_strickler_table_06.SetAttrValue( "Tissu urbain discontinu", "112" )
188 def_strickler_table_06.SetColor( "Tissu urbain discontinu", QColor( 255, 0, 0 ) )
189
190 def_strickler_table_06.Set( "Cours et voies d'eau", 88 )
191 def_strickler_table_06.SetAttrValue( "Cours et voies d'eau", "511" )
192 def_strickler_table_06.SetColor( "Cours et voies d'eau", QColor( 0, 204, 242 ) )
193
194 def_strickler_table_06.Set( "Oliveraies", 26 )
195 def_strickler_table_06.SetAttrValue( "Oliveraies", "223" )
196 def_strickler_table_06.SetColor( "Oliveraies", QColor( 230, 166, 0 ) )
197
198 def_strickler_table_06.Set( "Vignobles", 24 )
199 def_strickler_table_06.SetAttrValue( "Vignobles", "221" )
200 def_strickler_table_06.SetColor( "Vignobles", QColor( 230, 128, 0 ) )
201
202 def_strickler_table_06.Set( "Rizières", 42 )
203 def_strickler_table_06.SetAttrValue( "Rizières", "213" )
204 def_strickler_table_06.SetColor( "Rizières", QColor( 230, 230, 0 ) )
205
206 def_strickler_table_06.Set( "Zones portuaires", 45 )
207 def_strickler_table_06.SetAttrValue( "Zones portuaires", "123" )
208 def_strickler_table_06.SetColor( "Zones portuaires", QColor( 230, 204, 204 ) )
209
210 def_strickler_table_06.Set( "Zones industrielles ou commerciales et installations publiques", 30 )
211 def_strickler_table_06.SetAttrValue( "Zones industrielles ou commerciales et installations publiques", "121" )
212 def_strickler_table_06.SetColor( "Zones industrielles ou commerciales et installations publiques", QColor( 204, 77, 242 ) )
213
214 def_strickler_table_06.Set( "Marais salants", 73 )
215 def_strickler_table_06.SetAttrValue( "Marais salants", "422" )
216 def_strickler_table_06.SetColor( "Marais salants", QColor( 230, 230, 255 ) )
217
218 def_strickler_table_06.Set( "Marais intérieurs", 60 )
219 def_strickler_table_06.SetAttrValue( "Marais intérieurs", "411" )
220 def_strickler_table_06.SetColor( "Marais intérieurs", QColor( 166, 166, 255 ) )
221
222 def_strickler_table_06.Set( "Espaces verts urbains", 25 )
223 def_strickler_table_06.SetAttrValue( "Espaces verts urbains", "141" )
224 def_strickler_table_06.SetColor( "Espaces verts urbains", QColor( 255, 166, 255 ) )
225
226 def_strickler_table_06.Set( "Lagunes littorales", 95 )
227 def_strickler_table_06.SetAttrValue( "Lagunes littorales", "521" )
228 def_strickler_table_06.SetColor( "Lagunes littorales", QColor( 0, 255, 166 ) )
229
230 def_strickler_table_06.Set( "Roches nues", 45 )
231 def_strickler_table_06.SetAttrValue( "Roches nues", "332" )
232 def_strickler_table_06.SetColor( "Roches nues", QColor( 204, 204, 204 ) )
233
234 def_strickler_table_06.Set( "Terres arables hors périmètres d'irrigation", 31 )
235 def_strickler_table_06.SetAttrValue( "Terres arables hors périmètres d'irrigation", "211" )
236 def_strickler_table_06.SetColor( "Terres arables hors périmètres d'irrigation", QColor( 255, 255, 168 ) )
237
238 def_strickler_table_06.Set( "Zones intertidales", 75 )
239 def_strickler_table_06.SetAttrValue( "Zones intertidales", "423" )
240 def_strickler_table_06.SetColor( "Zones intertidales", QColor( 166, 166, 230 ) )
241
242
243 def_strickler_table_06.Update()
244
245 garonne = hydro_doc.CreateObject( KIND_POLYLINEXY )
246 garonne.SetName( "garonne" )
247
248 garonne.SetZLevel( 2 )
249
250 garonne.AddSection( "Section_1", 1, 1 )
251 garonne.AddPoint( 0, gp_XY( 38191.48, 33184.55 ) )
252 garonne.AddPoint( 0, gp_XY( 38553.78, 33013.53 ) )
253 garonne.AddPoint( 0, gp_XY( 38993.90, 32767.64 ) )
254 garonne.AddPoint( 0, gp_XY( 39678.58, 32533.58 ) )
255 garonne.AddPoint( 0, gp_XY( 40240.26, 32305.27 ) )
256 garonne.AddPoint( 0, gp_XY( 40717.94, 32193.70 ) )
257 garonne.AddPoint( 0, gp_XY( 41361.00, 32464.18 ) )
258 garonne.AddPoint( 0, gp_XY( 41831.41, 32626.69 ) )
259 garonne.AddPoint( 0, gp_XY( 41950.14, 32618.24 ) )
260 garonne.AddPoint( 0, gp_XY( 42524.97, 32419.61 ) )
261 garonne.AddPoint( 0, gp_XY( 42909.80, 32291.33 ) )
262 garonne.AddPoint( 0, gp_XY( 43177.03, 32269.95 ) )
263 garonne.AddPoint( 0, gp_XY( 43465.65, 32344.78 ) )
264 garonne.AddPoint( 0, gp_XY( 43754.27, 32152.37 ) )
265 garonne.AddPoint( 0, gp_XY( 44128.40, 31842.37 ) )
266 garonne.AddPoint( 0, gp_XY( 44003.90, 31269.93 ) )
267 garonne.AddPoint( 0, gp_XY( 44010.82, 30869.63 ) )
268 garonne.AddPoint( 0, gp_XY( 44064.26, 30655.84 ) )
269 garonne.AddPoint( 0, gp_XY( 44434.73, 30366.18 ) )
270 garonne.AddPoint( 0, gp_XY( 45208.04, 30484.81 ) )
271 garonne.AddPoint( 0, gp_XY( 45705.01, 30287.34 ) )
272 garonne.AddPoint( 0, gp_XY( 45933.89, 30046.87 ) )
273 garonne.AddPoint( 0, gp_XY( 46127.34, 29490.68 ) )
274 garonne.AddPoint( 0, gp_XY( 46111.60, 29226.08 ) )
275 garonne.AddPoint( 0, gp_XY( 46228.62, 28784.05 ) )
276 garonne.AddPoint( 0, gp_XY( 46247.64, 28449.75 ) )
277 garonne.AddPoint( 0, gp_XY( 46108.48, 28086.94 ) )
278 garonne.AddPoint( 0, gp_XY( 45618.52, 27553.74 ) )
279 garonne.AddPoint( 0, gp_XY( 45276.77, 27042.78 ) )
280 garonne.AddPoint( 0, gp_XY( 45001.89, 26273.15 ) )
281 garonne.AddPoint( 0, gp_XY( 45167.76, 25975.34 ) )
282 garonne.AddPoint( 0, gp_XY( 46018.15, 25848.84 ) )
283 garonne.AddPoint( 0, gp_XY( 46378.94, 25872.21 ) )
284 garonne.AddPoint( 0, gp_XY( 46885.57, 25937.64 ) )
285 garonne.AddPoint( 0, gp_XY( 47278.36, 25782.88 ) )
286 garonne.AddPoint( 0, gp_XY( 47153.86, 25728.04 ) )
287 garonne.AddPoint( 0, gp_XY( 46987.51, 25749.97 ) )
288 garonne.AddPoint( 0, gp_XY( 46658.26, 25715.71 ) )
289 garonne.AddPoint( 0, gp_XY( 45650.76, 25634.46 ) )
290 garonne.AddPoint( 0, gp_XY( 45122.63, 25748.21 ) )
291 garonne.AddPoint( 0, gp_XY( 44797.63, 26325.09 ) )
292 garonne.AddPoint( 0, gp_XY( 45114.51, 27168.75 ) )
293 garonne.AddPoint( 0, gp_XY( 45508.28, 27713.21 ) )
294 garonne.AddPoint( 0, gp_XY( 45994.19, 28382.53 ) )
295 garonne.AddPoint( 0, gp_XY( 45927.01, 29201.34 ) )
296 garonne.AddPoint( 0, gp_XY( 45756.39, 29859.47 ) )
297 garonne.AddPoint( 0, gp_XY( 45390.76, 30151.97 ) )
298 garonne.AddPoint( 0, gp_XY( 45039.85, 30120.84 ) )
299 garonne.AddPoint( 0, gp_XY( 44513.26, 30084.28 ) )
300 garonne.AddPoint( 0, gp_XY( 43923.42, 30426.28 ) )
301 garonne.AddPoint( 0, gp_XY( 43768.81, 30934.29 ) )
302 garonne.AddPoint( 0, gp_XY( 43820.10, 31425.20 ) )
303 garonne.AddPoint( 0, gp_XY( 43854.78, 31801.12 ) )
304 garonne.AddPoint( 0, gp_XY( 43479.64, 32053.54 ) )
305 garonne.AddPoint( 0, gp_XY( 42923.47, 32051.85 ) )
306 garonne.AddPoint( 0, gp_XY( 42493.64, 32187.97 ) )
307 garonne.AddPoint( 0, gp_XY( 42074.27, 32302.91 ) )
308 garonne.AddPoint( 0, gp_XY( 41624.75, 32330.93 ) )
309 garonne.AddPoint( 0, gp_XY( 41325.93, 32187.97 ) )
310 garonne.AddPoint( 0, gp_XY( 40879.52, 31987.29 ) )
311 garonne.AddPoint( 0, gp_XY( 40308.78, 32018.46 ) )
312 garonne.AddPoint( 0, gp_XY( 39782.86, 32207.17 ) )
313 garonne.AddPoint( 0, gp_XY( 38814.10, 32560.43 ) )
314 garonne.AddPoint( 0, gp_XY( 38302.17, 32903.70 ) )
315
316 garonne.Update()
317
318
319 domaine = hydro_doc.CreateObject( KIND_POLYLINEXY )
320 domaine.SetName( "domaine" )
321
322 domaine.SetZLevel( 3 )
323
324 domaine.AddSection( "Section_1", 0, 1 )
325 domaine.AddPoint( 0, gp_XY( 39901.15, 34762.30 ) );
326 domaine.AddPoint( 0, gp_XY( 38086.50, 29964.69 ) );
327 domaine.AddPoint( 0, gp_XY( 44835.83, 24264.97 ) );
328 domaine.AddPoint( 0, gp_XY( 46758.56, 25021.86 ) );
329 domaine.AddPoint( 0, gp_XY( 46757.20, 26601.21 ) );
330 domaine.AddPoint( 0, gp_XY( 48566.45, 30152.81 ) );
331 domaine.AddPoint( 0, gp_XY( 45532.36, 33239.83 ) );
332 domaine.AddPoint( 0, gp_XY( 43548.77, 34048.39 ) );
333
334 domaine.Update()
335
336
337 lit_majeur = hydro_doc.CreateObject( KIND_POLYLINEXY )
338 lit_majeur.SetName( "lit_majeur" )
339
340 lit_majeur.SetZLevel( 7 )
341
342 lit_majeur.AddSection( "Section_1", 1, 1 )
343 lit_majeur.AddPoint( 0, gp_XY( 41225.22, 34118.46 ) )
344 lit_majeur.AddPoint( 0, gp_XY( 41716.41, 33705.87 ) )
345 lit_majeur.AddPoint( 0, gp_XY( 42384.43, 33293.27 ) )
346 lit_majeur.AddPoint( 0, gp_XY( 42561.26, 32684.19 ) )
347 lit_majeur.AddPoint( 0, gp_XY( 42875.62, 32369.83 ) )
348 lit_majeur.AddPoint( 0, gp_XY( 43700.82, 32350.18 ) )
349 lit_majeur.AddPoint( 0, gp_XY( 44526.02, 31662.51 ) )
350 lit_majeur.AddPoint( 0, gp_XY( 45370.87, 31819.69 ) )
351 lit_majeur.AddPoint( 0, gp_XY( 46274.66, 31682.16 ) )
352 lit_majeur.AddPoint( 0, gp_XY( 46981.97, 31328.50 ) )
353 lit_majeur.AddPoint( 0, gp_XY( 47021.27, 30719.43 ) )
354 lit_majeur.AddPoint( 0, gp_XY( 47217.74, 30051.41 ) )
355 lit_majeur.AddPoint( 0, gp_XY( 47846.46, 29560.22 ) )
356 lit_majeur.AddPoint( 0, gp_XY( 48730.61, 28735.02 ) )
357 lit_majeur.AddPoint( 0, gp_XY( 48809.20, 27732.99 ) )
358 lit_majeur.AddPoint( 0, gp_XY( 49143.21, 27163.21 ) )
359 lit_majeur.AddPoint( 0, gp_XY( 49654.05, 26829.20 ) )
360 lit_majeur.AddPoint( 0, gp_XY( 49693.34, 25355.63 ) )
361 lit_majeur.AddPoint( 0, gp_XY( 48612.72, 23214.04 ) )
362 lit_majeur.AddPoint( 0, gp_XY( 47453.51, 23115.80 ) )
363 lit_majeur.AddPoint( 0, gp_XY( 46471.13, 24176.77 ) )
364 lit_majeur.AddPoint( 0, gp_XY( 45960.29, 25257.39 ) )
365 lit_majeur.AddPoint( 0, gp_XY( 44899.32, 25591.40 ) )
366 lit_majeur.AddPoint( 0, gp_XY( 44270.60, 26573.78 ) )
367 lit_majeur.AddPoint( 0, gp_XY( 43248.92, 27909.82 ) )
368 lit_majeur.AddPoint( 0, gp_XY( 42757.73, 28243.83 ) )
369 lit_majeur.AddPoint( 0, gp_XY( 42266.54, 28342.07 ) )
370 lit_majeur.AddPoint( 0, gp_XY( 41736.06, 28106.30 ) )
371 lit_majeur.AddPoint( 0, gp_XY( 41402.05, 28833.26 ) )
372 lit_majeur.AddPoint( 0, gp_XY( 40910.86, 28911.85 ) )
373 lit_majeur.AddPoint( 0, gp_XY( 40576.85, 29324.45 ) )
374 lit_majeur.AddPoint( 0, gp_XY( 40144.60, 29599.51 ) )
375 lit_majeur.AddPoint( 0, gp_XY( 39024.69, 30130.00 ) )
376 lit_majeur.AddPoint( 0, gp_XY( 38612.09, 30365.77 ) )
377 lit_majeur.AddPoint( 0, gp_XY( 38828.21, 33391.50 ) )
378
379 lit_majeur.Update()
380
381
382 Cloud_02 = hydro_doc.CreateObject( KIND_BATHYMETRY )
383 Cloud_02.SetName( "Cloud_02" )
384
385 Cloud_02.SetAltitudesInverted( 0 )
386 if not(Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))):
387   raise ValueError('problem while loading bathymetry')
388
389 Cloud_02.Update()
390
391
392 garonne_point_L93 = hydro_doc.CreateObject( KIND_BATHYMETRY )
393 garonne_point_L93.SetName( "garonne_point_L93" )
394
395 garonne_point_L93.SetAltitudesInverted( 0 )
396 if not(garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))):
397   raise ValueError('problem while loading bathymetry')
398
399 garonne_point_L93.Update()
400
401
402 litMineur = hydro_doc.CreateObject( KIND_IMMERSIBLE_ZONE )
403 litMineur.SetName( "litMineur" )
404
405 litMineur.SetZLevel( 6 )
406
407 litMineur.SetAltitudeObject( garonne_point_L93 )
408 litMineur.SetPolyline( garonne )
409
410 litMineur.Update()
411
412
413 litMajeur = hydro_doc.CreateObject( KIND_IMMERSIBLE_ZONE )
414 litMajeur.SetName( "litMajeur" )
415
416 litMajeur.SetZLevel( 5 )
417
418 litMajeur.SetFillingColor( QColor( 0, 170, 127, 255 ) )
419
420 litMajeur.SetAltitudeObject( Cloud_02 )
421 litMajeur.SetPolyline( lit_majeur )
422
423 litMajeur.Update()
424
425
426 domaineEtendu = hydro_doc.CreateObject( KIND_IMMERSIBLE_ZONE )
427 domaineEtendu.SetName( "domaineEtendu" )
428
429 domaineEtendu.SetZLevel( 4 )
430
431 domaineEtendu.SetFillingColor( QColor( 201, 203, 55, 255 ) )
432
433 domaineEtendu.SetAltitudeObject( Cloud_02 )
434 domaineEtendu.SetPolyline( domaine )
435
436 domaineEtendu.Update()
437
438 # Land cover Map
439
440
441 CLC_decoupe = hydro_doc.CreateObject( KIND_LAND_COVER_MAP )
442 CLC_decoupe.SetName( "CLC_decoupe" )
443
444 CLC_decoupe.SetZLevel( 13 )
445
446 if not(CLC_decoupe.ImportSHP( os.path.join(HYDRO_SAMPLES, 'HYDRO', 'CLC_decoupe.shp') )):
447   raise ValueError('problem while loading LandCoverMap shape')
448 attr_values = []
449 attr_values.append( "124" )
450 attr_values.append( "133" )
451 attr_values.append( "511" )
452 attr_values.append( "241" )
453 attr_values.append( "132" )
454 attr_values.append( "142" )
455 attr_values.append( "141" )
456 attr_values.append( "522" )
457 attr_values.append( "131" )
458 attr_values.append( "324" )
459 attr_values.append( "312" )
460 attr_values.append( "311" )
461 attr_values.append( "313" )
462 attr_values.append( "335" )
463 attr_values.append( "521" )
464 attr_values.append( "322" )
465 attr_values.append( "411" )
466 attr_values.append( "421" )
467 attr_values.append( "422" )
468 attr_values.append( "523" )
469 attr_values.append( "223" )
470 attr_values.append( "321" )
471 attr_values.append( "331" )
472 attr_values.append( "512" )
473 attr_values.append( "231" )
474 attr_values.append( "212" )
475 attr_values.append( "213" )
476 attr_values.append( "332" )
477 attr_values.append( "122" )
478 attr_values.append( "243" )
479 attr_values.append( "242" )
480 attr_values.append( "211" )
481 attr_values.append( "244" )
482 attr_values.append( "111" )
483 attr_values.append( "112" )
484 attr_values.append( "412" )
485 attr_values.append( "222" )
486 attr_values.append( "221" )
487 attr_values.append( "333" )
488 attr_values.append( "323" )
489 attr_values.append( "334" )
490 attr_values.append( "121" )
491 attr_values.append( "423" )
492 attr_values.append( "123" )
493 types = []
494 types.append( "Aéroports" )
495 types.append( "Chantiers" )
496 types.append( "Cours et voies d'eau" )
497 types.append( "Cultures annuelles associées à des cultures permanentes" )
498 types.append( "Décharges" )
499 types.append( "Equipements sportifs et de loisirs" )
500 types.append( "Espaces verts urbains" )
501 types.append( "Estuaires" )
502 types.append( "Extraction de matériaux" )
503 types.append( "Forêt et végétation arbustive en mutation" )
504 types.append( "Forêts de conifères" )
505 types.append( "Forêts de feuillus" )
506 types.append( "Forêts mélangées" )
507 types.append( "Glaciers et neiges éternelles" )
508 types.append( "Lagunes littorales" )
509 types.append( "Landes et broussailles" )
510 types.append( "Marais intérieurs" )
511 types.append( "Marais maritimes" )
512 types.append( "Marais salants" )
513 types.append( "Mers et océans" )
514 types.append( "Oliveraies" )
515 types.append( "Pelouses et pâturages naturels" )
516 types.append( "Plages, dunes et sable" )
517 types.append( "Plans d'eau" )
518 types.append( "Prairies et autres surfaces toujours en herbe à usage agricole" )
519 types.append( "Périmètres irrigués en permanence" )
520 types.append( "Rizières" )
521 types.append( "Roches nues" )
522 types.append( "Réseaux routier et ferroviaire et espaces associés" )
523 types.append( "Surfaces essentiellement agricoles, interrompues par des espaces naturels importants" )
524 types.append( "Systèmes culturaux et parcellaires complexes" )
525 types.append( "Terres arables hors périmètres d'irrigation" )
526 types.append( "Territoires agroforestiers" )
527 types.append( "Tissu urbain continu" )
528 types.append( "Tissu urbain discontinu" )
529 types.append( "Tourbières" )
530 types.append( "Vergers et petits fruits" )
531 types.append( "Vignobles" )
532 types.append( "Végétation clairsemée" )
533 types.append( "Végétation sclérophylle" )
534 types.append( "Zones incendiées" )
535 types.append( "Zones industrielles ou commerciales et installations publiques" )
536 types.append( "Zones intertidales" )
537 types.append( "Zones portuaires" )
538 if CLC_decoupe.ImportDBF( os.path.join(HYDRO_SAMPLES, 'HYDRO', 'CLC_decoupe.dbf'), 'CODE_06', attr_values, types ) != CLC_decoupe.DBFStatus_OK:
539   raise ValueError('problem while loading LandCoverMap data base')
540
541
542 # Calculation case
543 garonne_1 = hydro_doc.CreateObject( KIND_CALCULATION )
544 garonne_1.SetName( "garonne_1" )
545
546 garonne_1.SetAssignmentMode( HYDROData_CalculationCase.MANUAL )
547 garonne_1.AddGeometryObject( litMineur )
548 garonne_1.AddGeometryObject( domaineEtendu )
549 garonne_1.AddGeometryObject( litMajeur )
550
551 case_geom_group = domaineEtendu.GetGroup( 0 )
552 garonne_1.AddGeometryGroup( case_geom_group )
553 case_geom_group = litMineur.GetGroup( 0 )
554 garonne_1.AddGeometryGroup( case_geom_group )
555 case_geom_group = litMajeur.GetGroup( 0 )
556 garonne_1.AddGeometryGroup( case_geom_group )
557 garonne_1.SetBoundaryPolyline( domaine )
558 garonne_1.SetStricklerTable( def_strickler_table_06 )
559 garonne_1.SetLandCoverMap( CLC_decoupe )
560
561 # Start the algorithm of the partition and assignment
562 garonne_1.Update()
563 garonne_1_litMineur = hydro_doc.FindObjectByName( "garonne_1_Reg_1" )
564 garonne_1_Zone_1 = hydro_doc.FindObjectByName( "garonne_1_Zone_1" )
565 garonne_1_Zone_1.SetMergeType( HYDROData_Zone.Merge_ZMIN )
566 garonne_1_Zone_1.SetColor( QColor( 192, 113, 64 ))
567 garonne_1_litMineur.AddZone( garonne_1_Zone_1 )
568
569 garonne_1_riveDroite = hydro_doc.FindObjectByName( "garonne_1_Reg_2" )
570 garonne_1_Zone_2 = hydro_doc.FindObjectByName( "garonne_1_Zone_2" )
571 garonne_1_Zone_2.SetColor( QColor( 141, 192, 64 ))
572 garonne_1_riveDroite.AddZone( garonne_1_Zone_2 )
573
574 garonne_1_Zone_3 = hydro_doc.FindObjectByName( "garonne_1_Zone_3" )
575 garonne_1_Zone_3.SetMergeType( HYDROData_Zone.Merge_Object )
576 Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" )
577 garonne_1_Zone_3.SetMergeObject( Cloud_02 )
578 garonne_1_Zone_3.SetColor( QColor( 64, 192, 77 ))
579 garonne_1_riveDroite.AddZone( garonne_1_Zone_3 )
580
581 garonne_1_riveGauche = hydro_doc.FindObjectByName( "garonne_1_Reg_3" )
582 garonne_1_Zone_4 = hydro_doc.FindObjectByName( "garonne_1_Zone_4" )
583 garonne_1_Zone_4.SetMergeType( HYDROData_Zone.Merge_Object )
584 Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" )
585 garonne_1_Zone_4.SetMergeObject( Cloud_02 )
586 garonne_1_Zone_4.SetColor( QColor( 64, 75, 192 ))
587 garonne_1_riveGauche.AddZone( garonne_1_Zone_4 )
588
589 garonne_1_Zone_5 = hydro_doc.FindObjectByName( "garonne_1_Zone_5" )
590 garonne_1_Zone_5.SetColor( QColor( 64, 192, 77 ))
591 garonne_1_riveGauche.AddZone( garonne_1_Zone_5 )
592
593 garonne_1_litMineur.SetName("garonne_1_litMineur")
594 garonne_1_riveDroite.SetName("garonne_1_riveDroite")
595 garonne_1_riveGauche.SetName("garonne_1_riveGauche")
596
597 # Export of the calculation case
598 garonne_1_entry = garonne_1.Export()
599
600 #----------------------
601 # --- Geometry
602 #----------------------
603
604 # Get geometry shape and print debug information
605 import GEOM
606 from salome.geom import geomBuilder
607 import math
608 import SALOMEDS
609 from salome.hydrotools.controls import controlGeomProps
610
611 geompy = geomBuilder.New()
612
613 print("Entry:", garonne_1_entry)
614 HYDRO_garonne_1 = salome.IDToObject( str( garonne_1_entry ) )
615 print("Geom shape:", HYDRO_garonne_1)
616 print("Geom shape name:", HYDRO_garonne_1.GetName())
617
618
619 # --- manual definition: geometrical faces
620
621 [garonne_litMineur,garonne_riveDroite,garonne_riveGauche] = geompy.SubShapeAll(HYDRO_garonne_1, geompy.ShapeType["FACE"])
622
623 controlGeomProps(geompy, garonne_riveGauche,  29149.36918,  35948828.352061)
624 controlGeomProps(geompy, garonne_litMineur,   30337.548492,  3488480.304388)
625 controlGeomProps(geompy, garonne_riveDroite,  32012.343241, 25998769.23615)
626
627 # --- manual identification of all useful edge groups (boundary conditions)
628
629 allEdgesIds = geompy.SubShapeAllIDs(HYDRO_garonne_1, geompy.ShapeType["EDGE"])
630 print("allEdgesIds", allEdgesIds)
631
632 (isDone, ClosedFreeBoundary, OpenFreeBoundary) = geompy.GetFreeBoundary(HYDRO_garonne_1)
633 geompy.addToStudyInFather(HYDRO_garonne_1, ClosedFreeBoundary[0], "ClosedFreeBoundary")
634
635 freeBoundary = geompy.ExtractShapes(ClosedFreeBoundary[0], geompy.ShapeType["EDGE"], True)
636 freeBoundaryIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, freeBoundary[i]) for i in range(len(freeBoundary)) ]
637 print("freeBoundaryIds", freeBoundaryIds)
638
639 [litMineur_droite] = geompy.GetSharedShapesMulti([garonne_riveDroite, garonne_litMineur], geompy.ShapeType["EDGE"], True)
640 [litMineur_gauche] = geompy.GetSharedShapesMulti([garonne_riveGauche, garonne_litMineur], geompy.ShapeType["EDGE"], True)
641 geompy.addToStudyInFather(HYDRO_garonne_1, litMineur_droite, "litMineur_droite")
642 geompy.addToStudyInFather(HYDRO_garonne_1, litMineur_gauche, "litMineur_gauche")
643 rives = [litMineur_droite, litMineur_gauche]
644 rivesIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, rives[i]) for i in range(len(rives)) ]
645 print("rivesIds", rivesIds)
646
647 edges_litMineur = geompy.GetSharedShapesMulti([HYDRO_garonne_1, garonne_litMineur], geompy.ShapeType["EDGE"], True)
648 edges_riveGauche = geompy.GetSharedShapesMulti([HYDRO_garonne_1, garonne_riveGauche], geompy.ShapeType["EDGE"], True)
649 edges_riveDroite = geompy.GetSharedShapesMulti([HYDRO_garonne_1, garonne_riveDroite], geompy.ShapeType["EDGE"], True)
650 edges_litMineurIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, edges_litMineur[i]) for i in range(len(edges_litMineur)) ]
651 edges_riveGaucheIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, edges_riveGauche[i]) for i in range(len(edges_riveGauche)) ]
652 edges_riveDroiteIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, edges_riveDroite[i]) for i in range(len(edges_riveDroite)) ]
653
654 print("edges_litMineurIds", edges_litMineurIds) 
655 print("edges_riveGaucheIds", edges_riveGaucheIds)
656 print("edges_riveDroiteIds", edges_riveDroiteIds)
657
658 sectionsIds = [Id for Id in edges_litMineurIds if Id not in rivesIds]
659 print("sectionsIds", sectionsIds)
660 SectionsGaronne = geompy.CreateGroup(HYDRO_garonne_1, geompy.ShapeType["EDGE"])
661 geompy.UnionIDs(SectionsGaronne, sectionsIds)
662 geompy.addToStudyInFather(HYDRO_garonne_1, SectionsGaronne, "SectionsGaronne")
663
664 bordGaucheDomaineIds = [Id for Id in freeBoundaryIds if Id in edges_riveGaucheIds]
665 bordDroiteDomaineIds = [Id for Id in freeBoundaryIds if Id in edges_riveDroiteIds]
666 print("bordGaucheDomaineIds", bordGaucheDomaineIds)
667 print("bordDroiteDomaineIds", bordDroiteDomaineIds)
668 bordGaucheDomaine = geompy.CreateGroup(HYDRO_garonne_1, geompy.ShapeType["EDGE"])
669 geompy.UnionIDs(bordGaucheDomaine, bordGaucheDomaineIds)
670 geompy.addToStudyInFather(HYDRO_garonne_1, bordGaucheDomaine, "bordGaucheDomaine")
671 bordDroiteDomaine = geompy.CreateGroup(HYDRO_garonne_1, geompy.ShapeType["EDGE"])
672 geompy.UnionIDs(bordDroiteDomaine, bordDroiteDomaineIds)
673 geompy.addToStudyInFather(HYDRO_garonne_1, bordDroiteDomaine, "bordDroiteDomaine")
674
675 amont = geompy.GetEdgeNearPoint(HYDRO_garonne_1, geompy.MakeVertex(46757.861314, 25833.234752, 0))
676 aval = geompy.GetEdgeNearPoint(HYDRO_garonne_1, geompy.MakeVertex(39078.979127, 32588.627279, 0))
677 geompy.addToStudyInFather(HYDRO_garonne_1, amont, "amont")
678 geompy.addToStudyInFather(HYDRO_garonne_1, aval, "aval")
679
680 #----------------------
681 # --- Meshing
682 #----------------------
683
684 import  SMESH, SALOMEDS
685 from salome.smesh import smeshBuilder
686 from salome.hydrotools.controls import controlMeshStats, controlSubMeshStats
687 import tempfile
688
689 smesh = smeshBuilder.New()
690
691 # --- algorithms and hypothesis
692 garonne_1 = smesh.Mesh(HYDRO_garonne_1)
693
694 NETGEN_2D = garonne_1.Triangle(algo=smeshBuilder.NETGEN_1D2D)
695 NETGEN_2D_Parameters = NETGEN_2D.Parameters()
696 NETGEN_2D_Parameters.SetMaxSize( 200 )
697 NETGEN_2D_Parameters.SetSecondOrder( 0 )
698 NETGEN_2D_Parameters.SetOptimize( 1 )
699 NETGEN_2D_Parameters.SetFineness( 4 )
700 NETGEN_2D_Parameters.SetMinSize( 50 )
701 NETGEN_2D_Parameters.SetUseSurfaceCurvature( 1 )
702 NETGEN_2D_Parameters.SetFuseEdges( 1 )
703 NETGEN_2D_Parameters.SetQuadAllowed( 0 )
704
705 algo2D_litMineur = garonne_1.Quadrangle(algo=smeshBuilder.QUAD_MA_PROJ,geom=garonne_litMineur)
706 algo1D_litMineur = garonne_1.Segment(geom=garonne_litMineur)
707 hypo1D_litMineur = algo1D_litMineur.LocalLength(100,None,1e-07)
708 subMesh_litMineur = algo1D_litMineur.GetSubMesh()
709 smesh.SetName(subMesh_litMineur, "litMineur")
710
711 algo1D_SectionsGaronne = garonne_1.Segment(geom=SectionsGaronne)
712 hypo1D_SectionsGaronne = algo1D_SectionsGaronne.NumberOfSegments(8)
713 hypo1D_SectionsGaronne.SetDistrType( 0 )
714 subMesh_SectionsGaronne = algo1D_SectionsGaronne.GetSubMesh()
715 smesh.SetName(subMesh_SectionsGaronne, "SectionsGaronne")
716
717 isDone = garonne_1.SetMeshOrder( [ [ subMesh_SectionsGaronne, subMesh_litMineur ] ])
718
719 # --- compute mesh
720 isDone = garonne_1.Compute()
721 isDone = garonne_1.SplitQuadObject( garonne_1, 1 )
722 isDone = garonne_1.ReorientObject( garonne_1 )
723
724 # --- geometrical groups of faces
725 riveGauche_1 = garonne_1.GroupOnGeom(garonne_riveGauche,'riveGauche',SMESH.FACE)
726 litMineur_1 = garonne_1.GroupOnGeom(garonne_litMineur,'litMineur',SMESH.FACE)
727 riveDroite_1 = garonne_1.GroupOnGeom(garonne_riveDroite,'riveDroite',SMESH.FACE)
728
729 # --- geometrical groups of edges
730
731 ClosedFreeBoundary_1 = garonne_1.GroupOnGeom(ClosedFreeBoundary[0],'ClosedFreeBoundary',SMESH.EDGE)
732 litMineur_droite_1 = garonne_1.GroupOnGeom(litMineur_droite,'litMineur_droite',SMESH.EDGE)
733 litMineur_gauche_1 = garonne_1.GroupOnGeom(litMineur_gauche,'litMineur_gauche',SMESH.EDGE)
734 SectionsGaronne_1 = garonne_1.GroupOnGeom(SectionsGaronne,'SectionsGaronne',SMESH.EDGE)
735 bordGaucheDomaine_1 = garonne_1.GroupOnGeom(bordGaucheDomaine,'bordGaucheDomaine',SMESH.EDGE)
736 bordDroiteDomaine_1 = garonne_1.GroupOnGeom(bordDroiteDomaine,'bordDroiteDomaine',SMESH.EDGE)
737 amont_1 = garonne_1.GroupOnGeom(amont,'amont',SMESH.EDGE)
738 aval_1 = garonne_1.GroupOnGeom(aval,'aval',SMESH.EDGE)
739
740 # --- geometrical groups of nodes
741
742 garonne_1_litMineur_2 = garonne_1.GroupOnGeom(garonne_litMineur,'garonne_1_litMineur',SMESH.NODE)
743 garonne_1_riveDroite_2 = garonne_1.GroupOnGeom(garonne_riveDroite,'garonne_1_riveDroite',SMESH.NODE)
744 garonne_1_riveGauche_2 = garonne_1.GroupOnGeom(garonne_riveGauche,'garonne_1_riveGauche',SMESH.NODE)
745 ClosedFreeBoundary_2 = garonne_1.GroupOnGeom(ClosedFreeBoundary[0],'ClosedFreeBoundary',SMESH.NODE)
746 litMineur_droite_2 = garonne_1.GroupOnGeom(litMineur_droite,'litMineur_droite',SMESH.NODE)
747 litMineur_gauche_2 = garonne_1.GroupOnGeom(litMineur_gauche,'litMineur_gauche',SMESH.NODE)
748 SectionsGaronne_2 = garonne_1.GroupOnGeom(SectionsGaronne,'SectionsGaronne',SMESH.NODE)
749 bordGaucheDomaine_2 = garonne_1.GroupOnGeom(bordGaucheDomaine,'bordGaucheDomaine',SMESH.NODE)
750 bordDroiteDomaine_2 = garonne_1.GroupOnGeom(bordDroiteDomaine,'bordDroiteDomaine',SMESH.NODE)
751 amont_2 = garonne_1.GroupOnGeom(amont,'amont',SMESH.NODE)
752 aval_2 = garonne_1.GroupOnGeom(aval,'aval',SMESH.NODE)
753
754 garonne_1.SetAutoColor( 1 )
755 tmpdir = tempfile.mkdtemp()
756 print("tmpdir=",tmpdir)
757 fichierMaillage = os.path.join(tmpdir, 'garonne_1.med')
758 garonne_1.ExportMED(fichierMaillage, 0, SMESH.MED_V2_2, 1, None ,1)
759
760 controlMeshStats(garonne_1, 3888, 475, 7597)
761 controlSubMeshStats(litMineur_1, 2384)
762 controlSubMeshStats(riveDroite_1, 2342)
763 controlSubMeshStats(riveGauche_1, 2871)
764
765 if salome.sg.hasDesktop():
766   salome.sg.updateObjBrowser()
767
768 #----------------------
769 # --- Z interpolation with HYDRO
770 #----------------------
771
772 from salome.hydrotools.interpolZ import interpolZ
773 from salome.hydrotools.controls import controlStatZ
774
775 # --- case name in HYDRO
776 nomCas = 'garonne_1'
777
778 # --- med file 2D(x,y) of the case produced by SMESH
779
780 # --- dictionary [med group name] = region name
781 dicoGroupeRegion= dict(litMineur  = 'garonne_1_litMineur',
782                        riveDroite = 'garonne_1_riveDroite',
783                        riveGauche = 'garonne_1_riveGauche',
784                        )
785 # --- value to use for Z when the node is not in a region (used to detect problems)
786 zUndef = 90
787 # --- interpolation Method: 0 = nearest point on bathymetry (default), 1 = linear interpolation
788 interpolMethod = 0
789 # --- produce a 3D mesh (Z set to its value instead of 0
790 m3d = True
791
792 # --- Z interpolation on the bathymety/altimetry on the mesh nodes
793 statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef, interpolMethod, m3d)
794 #print statz
795 refstatz = {'riveDroite': (10.88, 32.61, 24.17, 5.12, 17.57, 31.33, 0.25),
796             'riveGauche': (7.72, 71.86, 24.51, 12.18, 12.90, 60.36, 0.4),
797             'litMineur': (2.06, 25.41, 13.93, 4.33, 8.47, 21.78)}
798 controlStatZ(statz, refstatz)
799
800 # --- add a field on nodes of type double with z values, named "BOTTOM"
801 #createZfield2(fichierMaillage)
802 # --- create a field on nodes of type double with srtickler coefficient values, named "BOTTOM FRICTION"
803 from salome.hydrotools.interpolS import assignStrickler
804
805 fichierFieldZ = os.path.join(tmpdir, 'garonne_1F.med')
806 fichierFieldStrickler = os.path.join(tmpdir, 'garonne_1S.med')
807
808 assignStrickler(nomCas, fichierFieldZ, fichierFieldStrickler)