Salome HOME
10a504910aa33f94b7c9d75ac31eba7042e69d5e
[tools/eficas.git] / Telemac / postel3d_cata_auto.py
1
2 # -*- coding: latin-1 -*-
3
4 from Accas import *
5 class DateJJMMAAAA:
6   def __init__(self):
7     self.ntuple=3
8
9   def __convert__(self,valeur):
10     if type(valeur) == types.StringType: return None
11     if len(valeur) != self.ntuple: return None
12     return valeur
13
14   def info(self):
15     return "Date : jj/mm/aaaa "
16
17   __repr__=info
18   __str__=info
19
20 class grma(GEOM):
21   pass
22
23 import types
24 class Tuple:
25   def __init__(self,ntuple):
26     self.ntuple=ntuple
27
28   def __convert__(self,valeur):
29     if type(valeur) == types.StringType:
30       return None
31     if len(valeur) != self.ntuple:
32       return None
33     return valeur
34
35   def info(self):
36     return "Tuple de %s elements" % self.ntuple
37
38
39
40 JdC = JDC_CATA (code = 'POSTEL3D',
41                 execmodul = None,
42                 )
43 # =======================================================================
44 # Catalog entry for the MAP function : c_pre_interfaceBody_mesh
45 # =======================================================================
46
47 VERSION_CATALOGUE="TRUNK_20201028"
48 # -----------------------------------------------------------------------
49 COMPUTATION_ENVIRONMENT = PROC(nom= "COMPUTATION_ENVIRONMENT",op = None,
50 # -----------------------------------------------------------------------
51 #   -----------------------------------
52     INPUT = FACT(statut='o',
53 #   -----------------------------------
54 #       -----------------------------------
55         DATA = FACT(statut='o',
56 #       -----------------------------------
57 #           -----------------------------------
58             RD_RESULT_FILE_FORMAT = SIMP(statut ='o',
59 #           -----------------------------------
60                 typ = 'TXM',
61                 into = ['SERAFIN','SERAFIND','MED'],
62                 defaut = 'SERAFIN',
63                 fr = """Format du fichier de resultats.
64 Les valeurs possibles sont :
65 \begin{itemize}
66 \item SERAFIN : format standard simple precision pour \tel ;
67 \item SERAFIND: format standard double precision pour \tel ;
68 \item MED     : format MED base sur HDF5.
69 \end{itemize}""",
70                 ang = """Results file format. Possible values are:
71 \begin{itemize}
72 \item SERAFIN : classical single precision format in \tel,
73 \item SERAFIND: classical double precision format in \tel,
74 \item MED     : MED format based on HDF5.
75 \end{itemize}""",
76             ),
77 #           -----------------------------------
78             RD_RESULT_FILE = SIMP(statut ='o',
79 #           -----------------------------------
80                 typ = ('Fichier','All Files (*)'),
81                 defaut = '',
82                 fr = """Nom du fichier des resultats 3D obtenu par un calcul avec
83 \telemac{3D}.""",
84                 ang = """Name of the 3D result file generated by a \telemac{3D} run.""",
85             ),
86 #           -----------------------------------
87             GEOMETRY_FILE_FORMAT = SIMP(statut ='o',
88 #           -----------------------------------
89                 typ = 'TXM',
90                 into = ['SERAFIN','SERAFIND','MED'],
91                 defaut = 'SERAFIN',
92                 fr = """Format du fichier de geometrie.
93 Les valeurs possibles sont :
94 \begin{itemize}
95 \item SERAFIN : format standard simple precision pour \tel ;
96 \item SERAFIND: format standard double precision pour \tel ;
97 \item MED     : format MED base sur HDF5.
98 \end{itemize}""",
99                 ang = """Geometry file format.
100 Possible values are:
101 \begin{itemize}
102 \item SERAFIN : classical single precision format in \tel,
103 \item SERAFIND: classical double precision format in \tel,
104 \item MED     : MED format based on HDF5.
105 \end{itemize}""",
106             ),
107 #           -----------------------------------
108             GEOMETRY_FILE = SIMP(statut ='o',
109 #           -----------------------------------
110                 typ = ('Fichier','All Files (*)'),
111                 defaut = '',
112                 fr = """Nom du fichier de geometrie.""",
113                 ang = """Name of the geometry file.""",
114             ),
115 #           -----------------------------------
116             FORTRAN_FILE = SIMP(statut ='f',
117 #           -----------------------------------
118                 typ = ('Fichier','All Files (*)'),
119                 defaut = '',
120                 fr = """Nom du fichier FORTRAN a soumettre.\\
121 Il ne sert a priori qu''a dimensionner les tableaux utilises par
122 \postel, mais peut contenir des sous-programmes modifies ou propres
123 a l''utilisateur.""",
124                 ang = """Name of FORTRAN file to be submitted.\\
125 It is supposed to be used only to dimension the array used by \postel
126 but can also contain subroutines modified by the user.""",
127             ),
128         ),
129     ),
130 #   -----------------------------------
131     GLOBAL = FACT(statut='o',
132 #   -----------------------------------
133 #       -----------------------------------
134         PARALLEL_PROCESSORS = SIMP(statut ='f',
135 #       -----------------------------------
136             typ = 'I',
137             defaut = 0,
138             fr = """Nombre de processeurs pour la decomposition en parallele:
139 \begin{itemize}
140 \item 0 : 1 machine, compilation sans bibliotheque de parallelisme ;
141 \item 1 : 1 machine, compilation avec bibliotheque de parallelisme ;
142 \item 2 : 2 processeurs ou machines en parallele etc...
143 \end{itemize}""",
144             ang = """Number of processors for domain partition.
145 \begin{itemize}
146 \item 0: 1 machine, compiling without parallel library,
147 \item 1: 1 machine, compiling with a parallel library,
148 \item 2: 2 processors or machines in parallel etc...
149 \end{itemize}""",
150         ),
151     ),
152 )
153 # -----------------------------------------------------------------------
154 GENERAL = PROC(nom= "GENERAL",op = None,
155 # -----------------------------------------------------------------------
156 #   -----------------------------------
157     NUMBER_OF_FIRST_RECORD_FOR_CROSS_SECTIONS = SIMP(statut ='o',
158 #   -----------------------------------
159         typ = 'I',
160         defaut = 1,
161         fr = """Seuls les enregistrements au-dela de ce numero seront traites
162 pour les coupes.""",
163         ang = """Only records after that time will be in the cross sections.""",
164     ),
165 #   -----------------------------------
166     PRINTOUT_PERIOD_FOR_CROSS_SECTIONS = SIMP(statut ='o',
167 #   -----------------------------------
168         typ = 'I',
169         defaut = 1,
170         fr = """Periode en nombre d''enregistrements entre 2 coupes.""",
171         ang = """Period in number of records between two cross sections.""",
172     ),
173 )
174 # -----------------------------------------------------------------------
175 HORIZONTAL_CROSS_SECTION = PROC(nom= "HORIZONTAL_CROSS_SECTION",op = None,
176 # -----------------------------------------------------------------------
177 #   -----------------------------------
178     NUMBER_OF_HORIZONTAL_CROSS_SECTIONS = SIMP(statut ='o',
179 #   -----------------------------------
180         typ = 'I',
181         defaut = 0,
182         fr = """Permet de definir simultanement plusieurs coupes horizontales.
183 La valeur maximale autorisee est 9.""",
184         ang = """Allow multiple horizontal sections. The maximum value is 9.""",
185     ),
186 #   -----------------------------------
187     b_NUMBER_OF_HORIZONTAL_CROSS_SECTIONSG = BLOC(condition="NUMBER_OF_HORIZONTAL_CROSS_SECTIONS > 0",
188 #   -----------------------------------
189 #       -----------------------------------
190         HORIZONTAL_CROSS_SECTION_FILE_FORMAT = SIMP(statut ='o',
191 #       -----------------------------------
192             typ = 'TXM',
193             into = ['SERAFIN','SERAFIND','MED'],
194             defaut = 'SERAFIN',
195             fr = """Format du fichier de resultats.
196 Les valeurs possibles sont :
197 \begin{itemize}
198 \item SERAFIN : format standard simple precision pour \tel ;
199 \item SERAFIND: format standard double precision pour \tel ;
200 \item MED     : format MED base sur HDF5.
201 \end{itemize}""",
202             ang = """Results file format. Possible values are:
203 \begin{itemize}
204 \item SERAFIN : classical single precision format in \tel,
205 \item SERAFIND: classical double precision format in \tel,
206 \item MED     : MED format based on HDF5.
207 \end{itemize}""",
208         ),
209 #       -----------------------------------
210         HORIZONTAL_CROSS_SECTION_FILE = SIMP(statut ='o',
211 #       -----------------------------------
212             typ = ('Fichier','All Files (*)','Sauvegarde'),
213             defaut = '',
214             fr = """Nom generique des fichiers des coupes horizontales.
215 Le fichier contenant la coupe $i$ aura pour nom ce nom generique suivi
216 de l''extension .i.""",
217             ang = """Generic name for the horizontal cross sections file.
218 The file containing the cross section $i$ name will be the generic
219 followed by the extension .i.""",
220         ),
221 #       -----------------------------------
222         REFERENCE_LEVEL_FOR_EACH_HORIZONTAL_CROSS_SECTION = SIMP(statut ='o',
223 #       -----------------------------------
224             typ = 'I', min=0, max='**',
225             defaut = [0,1,2,3,4,5,6,7,8],
226             fr = """Chaque coupe horizontale sera parallele a son plan de reference.
227 Ainsi il est possible de faire des coupes par exemple :
228 \begin{itemize}
229 \item a telle distance au-dessus du fond ;
230 \item a telle distance sous la surface ;
231 \item suivant un plan intermediaire\ldots
232 \end{itemize}
233 Le plan 0 correspond au plan parfaitement horizontal a la cote 0.""",
234             ang = """Each horizontal cross section will be parallel to its reference
235 plane. It is then possible to make cross sections which are:
236 \begin{itemize}
237 \item at a chosen distance above the bottom,
238 \item at a chosen distance below the surface,
239 \item referenced to an inbetween plane\ldots
240 \end{itemize}
241 Plane 0 corresponds to the plane perfecly horizontal to the height 0.""",
242         ),
243 #       -----------------------------------
244         ELEVATION_FROM_REFERENCE_LEVEL = SIMP(statut ='o',
245 #       -----------------------------------
246             typ = 'R', min=0, max='**',
247             defaut = [0.,0.,0.,0.,0.,0.,0.,0.,0.],
248             fr = """Decalage entre la coupe et son plan de reference, ceci pour
249 chaque coupe horizontale.""",
250             ang = """Gap between the cross sections and its reference plane, this
251 must be defined for cross section.""",
252         ),
253     ),
254 )
255 # -----------------------------------------------------------------------
256 VERTICAL_CROSS_SECTION = PROC(nom= "VERTICAL_CROSS_SECTION",op = None,
257 # -----------------------------------------------------------------------
258 #   -----------------------------------
259     NUMBER_OF_VERTICAL_CROSS_SECTIONS = SIMP(statut ='o',
260 #   -----------------------------------
261         typ = 'I',
262         defaut = 0,
263         fr = """Permet de definir simultanement plusieurs coupes verticales.
264 La valeur maximale autorisee est 9.""",
265         ang = """Allow multiple vertical sections. The maximum value is 9.""",
266     ),
267 #   -----------------------------------
268     b_NUMBER_OF_VERTICAL_CROSS_SECTIONSG = BLOC(condition="NUMBER_OF_VERTICAL_CROSS_SECTIONS > 0",
269 #   -----------------------------------
270 #       -----------------------------------
271         VERTICAL_CROSS_SECTION_FILE_FORMAT = SIMP(statut ='o',
272 #       -----------------------------------
273             typ = 'TXM',
274             into = ['SERAFIN','SERAFIND','MED'],
275             defaut = 'SERAFIN',
276             fr = """Format du fichier de resultats.
277 Les valeurs possibles sont :
278 \begin{itemize}
279 \item SERAFIN : format standard simple precision pour \tel ;
280 \item SERAFIND: format standard double precision pour \tel ;
281 \item MED     : format MED base sur HDF5.
282 \end{itemize}""",
283             ang = """Results file format. Possible values are:
284 \begin{itemize}
285 \item SERAFIN : classical single precision format in \tel,
286 \item SERAFIND: classical double precision format in \tel,
287 \item MED     : MED format based on HDF5.
288 \end{itemize}""",
289         ),
290 #       -----------------------------------
291         VERTICAL_CROSS_SECTION_FILE = SIMP(statut ='o',
292 #       -----------------------------------
293             typ = ('Fichier','All Files (*)','Sauvegarde'),
294             defaut = '',
295             fr = """Nom generique des fichiers des coupes verticales.
296 Le fichier contenant la coupe $i$ au $j$e pas de temps enregistre aura
297 pour nom ce nom generique suivi de l extension .i.j.""",
298             ang = """Generic name for the vertical cross sections file.  The file
299 containing the cross section $i$ for the $j$ time step name will be the
300 generic followed by the extension .i.j.""",
301         ),
302 #       -----------------------------------
303         NUMBER_OF_NODES_FOR_VERTICAL_CROSS_SECTION_DISCRETIZATION = SIMP(statut ='o',
304 #       -----------------------------------
305             typ = 'I',
306             defaut = 120,
307             fr = """Il s''agit du nombre de points suivant l''horizontale.""",
308             ang = """It is the number of points along the horizontal.""",
309         ),
310 #       -----------------------------------
311         DISTORSION_BETWEEN_VERTICAL_AND_HORIZONTAL = SIMP(statut ='o',
312 #       -----------------------------------
313             typ = 'R', min=0, max='**',
314             defaut = [1.,1.,1.,1.,1.,1.,1.,1.,1.],
315             fr = """Rapport entre echelles verticale et horizontale pour chaque
316 coupe verticale.""",
317             ang = """Ratio between vertical and horizontal scales for each vertical
318 cross section.""",
319         ),
320 #       -----------------------------------
321         ABSCISSAE_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_1 = SIMP(statut ='o',
322 #       -----------------------------------
323             typ = 'R', min=0, max='**',
324             fr = """Tout est dans le titre.""",
325             ang = """It is all said in the title.""",
326         ),
327 #       -----------------------------------
328         ORDINATES_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_1 = SIMP(statut ='o',
329 #       -----------------------------------
330             typ = 'R', min=0, max='**',
331             fr = """Tout est dans le titre.""",
332             ang = """It is all said in the title.""",
333         ),
334     ),
335 #   -----------------------------------
336     b_NUMBER_OF_VERTICAL_CROSS_SECTIONSH = BLOC(condition="NUMBER_OF_VERTICAL_CROSS_SECTIONS > 1",
337 #   -----------------------------------
338 #       -----------------------------------
339         ABSCISSAE_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_2 = SIMP(statut ='o',
340 #       -----------------------------------
341             typ = 'R', min=0, max='**',
342             fr = """Tout est dans le titre.""",
343             ang = """It is all said in the title.""",
344         ),
345 #       -----------------------------------
346         ORDINATES_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_2 = SIMP(statut ='o',
347 #       -----------------------------------
348             typ = 'R', min=0, max='**',
349             fr = """Tout est dans le titre.""",
350             ang = """It is all said in the title.""",
351         ),
352     ),
353 #   -----------------------------------
354     b_NUMBER_OF_VERTICAL_CROSS_SECTIONSI = BLOC(condition="NUMBER_OF_VERTICAL_CROSS_SECTIONS > 2",
355 #   -----------------------------------
356 #       -----------------------------------
357         ABSCISSAE_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_3 = SIMP(statut ='o',
358 #       -----------------------------------
359             typ = 'R', min=0, max='**',
360             fr = """Tout est dans le titre.""",
361             ang = """It is all said in the title.""",
362         ),
363 #       -----------------------------------
364         ORDINATES_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_3 = SIMP(statut ='o',
365 #       -----------------------------------
366             typ = 'R', min=0, max='**',
367             fr = """Tout est dans le titre.""",
368             ang = """It is all said in the title.""",
369         ),
370     ),
371 #   -----------------------------------
372     b_NUMBER_OF_VERTICAL_CROSS_SECTIONSJ = BLOC(condition="NUMBER_OF_VERTICAL_CROSS_SECTIONS > 3",
373 #   -----------------------------------
374 #       -----------------------------------
375         ABSCISSAE_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_4 = SIMP(statut ='o',
376 #       -----------------------------------
377             typ = 'R', min=0, max='**',
378             fr = """Tout est dans le titre.""",
379             ang = """It is all said in the title.""",
380         ),
381 #       -----------------------------------
382         ORDINATES_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_4 = SIMP(statut ='o',
383 #       -----------------------------------
384             typ = 'R', min=0, max='**',
385             fr = """Tout est dans le titre.""",
386             ang = """It is all said in the title.""",
387         ),
388     ),
389 #   -----------------------------------
390     b_NUMBER_OF_VERTICAL_CROSS_SECTIONSK = BLOC(condition="NUMBER_OF_VERTICAL_CROSS_SECTIONS > 4",
391 #   -----------------------------------
392 #       -----------------------------------
393         ABSCISSAE_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_5 = SIMP(statut ='o',
394 #       -----------------------------------
395             typ = 'R', min=0, max='**',
396             fr = """Tout est dans le titre.""",
397             ang = """It is all said in the title.""",
398         ),
399 #       -----------------------------------
400         ORDINATES_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_5 = SIMP(statut ='o',
401 #       -----------------------------------
402             typ = 'R', min=0, max='**',
403             fr = """Tout est dans le titre.""",
404             ang = """It is all said in the title.""",
405         ),
406     ),
407 #   -----------------------------------
408     b_NUMBER_OF_VERTICAL_CROSS_SECTIONSL = BLOC(condition="NUMBER_OF_VERTICAL_CROSS_SECTIONS > 5",
409 #   -----------------------------------
410 #       -----------------------------------
411         ABSCISSAE_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_6 = SIMP(statut ='o',
412 #       -----------------------------------
413             typ = 'R', min=0, max='**',
414             fr = """Tout est dans le titre.""",
415             ang = """It is all said in the title.""",
416         ),
417 #       -----------------------------------
418         ORDINATES_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_6 = SIMP(statut ='o',
419 #       -----------------------------------
420             typ = 'R', min=0, max='**',
421             fr = """Tout est dans le titre.""",
422             ang = """It is all said in the title.""",
423         ),
424     ),
425 #   -----------------------------------
426     b_NUMBER_OF_VERTICAL_CROSS_SECTIONSM = BLOC(condition="NUMBER_OF_VERTICAL_CROSS_SECTIONS > 6",
427 #   -----------------------------------
428 #       -----------------------------------
429         ABSCISSAE_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_7 = SIMP(statut ='o',
430 #       -----------------------------------
431             typ = 'R', min=0, max='**',
432             fr = """Tout est dans le titre.""",
433             ang = """It is all said in the title.""",
434         ),
435 #       -----------------------------------
436         ORDINATES_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_7 = SIMP(statut ='o',
437 #       -----------------------------------
438             typ = 'R', min=0, max='**',
439             fr = """Tout est dans le titre.""",
440             ang = """It is all said in the title.""",
441         ),
442     ),
443 #   -----------------------------------
444     b_NUMBER_OF_VERTICAL_CROSS_SECTIONSN = BLOC(condition="NUMBER_OF_VERTICAL_CROSS_SECTIONS > 7",
445 #   -----------------------------------
446 #       -----------------------------------
447         ABSCISSAE_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_8 = SIMP(statut ='o',
448 #       -----------------------------------
449             typ = 'R', min=0, max='**',
450             fr = """Tout est dans le titre.""",
451             ang = """It is all said in the title.""",
452         ),
453 #       -----------------------------------
454         ORDINATES_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_8 = SIMP(statut ='o',
455 #       -----------------------------------
456             typ = 'R', min=0, max='**',
457             fr = """Tout est dans le titre.""",
458             ang = """It is all said in the title.""",
459         ),
460     ),
461 #   -----------------------------------
462     b_NUMBER_OF_VERTICAL_CROSS_SECTIONSO = BLOC(condition="NUMBER_OF_VERTICAL_CROSS_SECTIONS > 8",
463 #   -----------------------------------
464 #       -----------------------------------
465         ABSCISSAE_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_9 = SIMP(statut ='o',
466 #       -----------------------------------
467             typ = 'R', min=0, max='**',
468             fr = """Tout est dans le titre.""",
469             ang = """It is all said in the title.""",
470         ),
471 #       -----------------------------------
472         ORDINATES_OF_THE_VERTICES_OF_VERTICAL_CROSS_SECTION_9 = SIMP(statut ='o',
473 #       -----------------------------------
474             typ = 'R', min=0, max='**',
475             fr = """Tout est dans le titre.""",
476             ang = """It is all said in the title.""",
477         ),
478     ),
479 )
480 # -----------------------------------------------------------------------
481 INTERNAL = PROC(nom= "INTERNAL",op = None,
482 # -----------------------------------------------------------------------
483     UIinfo = {"groupes": ("CACHE")},
484 #   -----------------------------------
485     STEERING_FILE = SIMP(statut ='o',
486 #   -----------------------------------
487         typ = ('Fichier','All Files (*)'),
488         defaut = '',
489         fr = """Nom du fichier contenant les references des fichiers et
490 les options du calcul a realiser.""",
491         ang = """Name of the file containing the parameters of the computation.
492 Written by the user.""",
493     ),
494 #   -----------------------------------
495     DICTIONARY = SIMP(statut ='o',
496 #   -----------------------------------
497         typ = ('Fichier','All Files (*)'),
498         defaut = 'postel3d.dico',
499         fr = """Dictionnaire des mots cles.""",
500         ang = """Key word dictionary.""",
501     ),
502 )
503 TEXTE_NEW_JDC = "\
504 COMPUTATION_ENVIRONMENT();\
505 GENERAL();\
506 HORIZONTAL_CROSS_SECTION();\
507 VERTICAL_CROSS_SECTION();\
508 "
509 Ordre_Des_Commandes = (
510 'COMPUTATION_ENVIRONMENT',
511 'GENERAL',
512 'HORIZONTAL_CROSS_SECTION',
513 'VERTICAL_CROSS_SECTION',
514 'INTERNAL')
515 try:
516     import TelApy
517     source = "eficas"
518 except Exception as excpt:
519     source = "Telemac"
520 enum = source+'.postel3d_enum_auto'
521 dicoCasEn = source+'.postel3d_dicoCasEnToCata'
522 dicoCasFr = source+'.postel3d_dicoCasFrToCata'