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