Salome HOME
Version cmt-01
[tools/eficas.git] / Telemac / Telemac_Cata.py
1 # coding: utf-8
2
3 from Accas import *
4 class DateJJMMAAAA:
5   def __init__(self):
6     self.ntuple=3
7
8   def __convert__(self,valeur):
9     if type(valeur) == types.StringType: return None
10     if len(valeur) != self.ntuple: return None
11     return valeur
12
13   def info(self):
14     return "Date : jj/mm/aaaa "
15
16   __repr__=info
17   __str__=info
18
19 class HeureHHMMSS:
20   def __init__(self):
21     self.ntuple=3
22
23   def __convert__(self,valeur):
24     if type(valeur) == types.StringType: return None
25     if len(valeur) != self.ntuple: return None
26     return valeur
27
28   def info(self):
29     return "heure : hh/mm/ss "
30
31   __repr__=info
32   __str__=info
33
34
35 JdC = JDC_CATA (code = 'MAP',
36                 execmodul = None,
37                 )
38 # ======================================================================
39 # Catalog entry for the MAP function : c_pre_interfaceBody_mesh
40 # ======================================================================
41 INITIALIZATION=PROC(nom="INITIALIZATION",op=None,
42      fr="Initialisation des fichiers d'entrée et de sortie",
43      ang="Input and Output files initialization",
44
45      Title = SIMP( statut='o',typ='TXM'),
46      Working_Directory = SIMP( statut='o',typ='Repertoire',defaut='/tmp'),
47
48      Files= FACT(statut='o',
49           Dictionary     = SIMP( statut='o', typ = ('Fichier', 'Dico (*.dico);;All Files (*)',), defaut='telemac2d.dico',),
50           Geometry_File_Format = SIMP( statut='o',typ='TXM',into=['SERAFIN','MED','SERAFIND'], defaut='SERAFIN',
51           fr='Format du fichier de geometrie. Les valeurs possibles sont : - SERAFIN : format standard simple precision pour Telemac;  - SERAFIND: format standard double precision pour Telemac; - MED     : format MED base sur HDF5',
52           ang='Results file format. Possible values are: - SERAFIN : classical single precision format in Telemac;  - SERAFIND: classical double precision format in Telemac; - MED     : MED format based on HDF5',) ,
53           Geometry_File  = SIMP( statut='o', typ = ('Fichier', 'Geo Files (*.geo);;All Files (*)',),
54                 fr='Nom du fichier contenant le maillage du calcul a realiser.',
55                 ang='Name of the file containing the mesh. This file may also contain the topography and the friction coefficients.'),
56           #Steering_File     = SIMP( statut='o', typ = ('Fichier', 'Steering Files (*.cas);;All Files (*)',),),
57           Results_File_Format = SIMP( statut='o',typ='TXM',into=['SERAFIN','MED','SERAFIND'], defaut='SERAFIN',
58                     fr = 'Format du fichier de resultats. Les valeurs possibles sont : \n- SERAFIN : format standard simple precision pour Telemac;  - SERAFIND: format standard double precision pour Telemac; - MED     : format MED base sur HDF5' ,
59                     ang = 'Results file format. Possible values are:\n - SERAFIN : classical single precision format in Telemac;\n  - SERAFIND: classical double precision format in Telemac; - MED     : MED format based on HDF5' ,),
60  
61           Results_File     = SIMP( statut='o', typ = ('Fichier', 'Steering Files (*.cas);;All Files (*)',),
62                                    fr='Nom du fichier dans lequel seront ecrits les resultats du calcul avec la periodicite donnee par le mot cle : PERIODE POUR LES SORTIES GRAPHIQUES.', ang='Name of the file into which the computation results shall be written, the periodicity being given by the key-word: GRAPHIC PRINTOUT PERIOD.',),
63 # Inexistant eventuellement
64           Fortran_File = SIMP(statut='f',typ = ('Fichier', 'Fortran files (*.f);;All Files (*)'),
65                               fr='Nom du fichier a soumettre',
66                               ang='Name of FORTRAN file to be submitted',),
67           Boundary_Condition_File = SIMP( statut='o', typ = ('Fichier', 'Boundary Condition (*.cli);;All Files (*)',),),
68           Reference_File     = SIMP( statut='f', typ = ('Fichier', 'Reference File (*.ref);;All Files (*)',),),
69      ),
70
71      Formated_And_Binary_Files=FACT( statut='f',
72           Formated_File1     = SIMP( statut='f', typ = ('Fichier', 'formated File (*.txt);;All Files (*)',),),
73           Formated_File2     = SIMP( statut='f', typ = ('Fichier', 'formated File (*.txt);;All Files (*)',),),
74           Binary_Data_File1  = SIMP( statut='f', typ = ('Fichier', 'Reference File (*.txt);;All Files (*)',),),
75           Binary_Data_File2  = SIMP( statut='f', typ = ('Fichier', 'Reference File (*.txt);;All Files (*)',),),
76      ),
77      Computation_Continued=FACT( statut='f',
78           Previous_Computation_File_Format=SIMP( statut='o',typ='TXM',into=['SERAFIN','MED','SERAFIND'],defaut='SERAFIN',),
79           Previous_Computation_File  = SIMP( statut='o', 
80               typ = ('Fichier', 'Computation File (*.res);;All Files (*)',),
81               fr = "Nom d'un fichier contenant les resultats d'un calcul precedent realise sur le meme maillage et dont le dernier pas de temps enregistre va fournir les conditions initiales pour une suite de de calcul.",
82                ang = 'Name of a file containing the results of an earlier computation which was made on the same mesh. The last recorded time step will provid the initial conditions for the new computation.',
83                                          ),
84           Previous_Computation_Comm  = SIMP( statut='f', typ = ('Fichier', 'COMM(*.comm);;All Files (*)',),
85               fr  = "Nom du fichier .comm décrivant le cas précédent",
86               ang = "Name of a file containing the earlier study" ,),
87           Initial_Time_Set     = SIMP(typ=bool, statut='f',
88              fr = 'Remet le temps a zero en cas de suite de calcul',
89              ang = 'Initial time set to zero in case of restart',
90              defaut="False"),
91           Record_Number_For_Restart = SIMP(typ='I', statut='o', defaut=0,
92               fr = "numero de l'enregistrementde depart dans le fichier du calcul precedent. 0 signifie qu'on prend le dernier enregistrement", 
93               ang ="record number to start from in the previous computation file, 0 for last record" ),
94      ),
95      Computation=FACT(statut='o',
96         Machine=FACT( statut='o',
97            Number_of_Processors=SIMP(statut='o',typ='I',val_min=0,defaut=1),
98            Parallel_Computation=SIMP(statut='o',typ=bool,defaut=False),
99          ),
100         Coupling=FACT( statut='o',
101            Sisyphe=SIMP(statut='o',typ=bool,defaut=False),
102            Tomawac=SIMP(statut='o',typ=bool,defaut=False),
103           Delwacq=SIMP(statut='o',typ=bool,defaut=False),
104         ),
105      ),
106 )
107
108 TIDE_PARAMETERS=PROC(nom="TIDE_PARAMETERS",op=None,
109      fr="",
110      ang="",
111      Time=FACT( statut='o',
112        #Original_Date_of_Time=SIMP(statut='f',typ=DateJJMMAAAA,validators=VerifTypeTuple(('R','R','R'))),
113        #Original_Hour_of_Time=SIMP(statut='f',typ=HeureHHMMSS,validators=VerifTypeTuple(('R','R','R'))),
114        Original_Date_of_Time=FACT( statut='o',
115          fr = "Permet de fixer la date d'origine des temps du modele lors de la prise en compte de la force generatrice de la maree.",
116          ang ='Give the date of the time origin of the model when taking into account the tide generating force.', 
117          Year=SIMP(statut='o',typ='I',val_min=1900,defaut=1900),
118          Month=SIMP(statut='o',typ='I',val_min=1,val_max=12,defaut=1),
119          Day=SIMP(statut='o',typ='I',val_min=1,val_max=31,defaut=1),
120           ),
121        Original_Hour_of_Time=FACT( statut='f',
122          fr = "Permet de fixer l'heure d'origine des temps du modele lors de la prise en compte de la force generatrice de la maree.",
123          ang ='Give the time of the time origin of the model when taking into account the tide generating force.', 
124          Hour=SIMP(statut='o',typ='I',val_min=0,val_max=24,defaut=0),
125          Minute=SIMP(statut='o',typ='I',val_min=0,val_max=60,defaut=0),
126          Second=SIMP(statut='o',typ='I',val_min=0,val_max=60,defaut=0),
127          ),
128       ),
129      Location=FACT( statut='f',
130         #regles=( PRESENT_PRESENT('Longitude_of_origin','Latitute_of_origin', ),),
131         #Spatial_Projection=SIMP(statut='f',typ='I',into=[1,2,3]),
132         #Geographic_System=SIMP(statut='f',typ='I',into=[-1,0,1,2,3,4,5]),
133
134         Geographic_System=SIMP(statut='f',typ='TXM',
135               into=["DEFINI PAR L'UTILISATEUR", "WGS84 LONGITUDE/LATITUDE EN DEGRES REELS","WGS84 NORD UTM",'WGS84 SUD UTM','LAMBERT', 'MERCATOR'],
136               defaut="DEFINI PAR L'UTILISATEUR",
137               fr = 'Systeme de coordonnees geographiques dans lequel est construit le modele numerique.',
138               ang = 'Geographic coordinates system in which the numerical model is built.Indicate the corresponding zone with the keyword ',
139         ),
140              b_geo_system  = BLOC(condition = "Geographic_System in ('WGS84 LONGITUDE/LATITUDE EN DEGRES REELS','WGS84 NORD UTM','WGS84 SUD UTM','MERCATOR')",
141              Spatial_Projection=SIMP(statut='o',typ='TXM',into=["CARTESIAN, NOT GEOREFERENCED","MERCATOR","LATITUDE LONGITUDE"]),
142              ang = 'Option 2 or 3 mandatory for spherical coordinates Option 3: latitude and longitude in radians!',
143              b_lat     = BLOC(condition = "Spatial_Projection == 'LATITUDE LONGITUDE' ",
144                  Latitude_of_origin=SIMP(statut='o',typ='R',val_min=-90,val_max=90,fr="en radians", ang="in radians"),
145                  Longitude_of_origin=SIMP(statut='o',typ='R',fr="en radians", ang="in radians"),
146                          ), # fin bloc b_lat
147              ), # fin bloc b_geo
148         Zone_number_in_Geographic_System=SIMP(statut='f',typ='I',into=[-1,0,1,2,3,4,22,30]),
149      ),
150 )
151
152 INITIAL_STATE=PROC(nom="INITIAL_STATE",op=None,
153         Initial_Conditions=SIMP(statut='o',typ='TXM',into=['ZERO ELEVATION', 'CONSTANT ELEVATION','ZERO DEPTH','CONSTANT DEPTH','SPECIAL','TPXO SATELLITE ALTIMETRY'],defaut='ZERO ELEVATION',
154          fr = "Permet de definir les conditions initiales sur les hauteurs d'eau. Les valeurs possibles sont : - COTE NULLE. Initialise la cote de surface libre a 0. Les hauteurs d'eau initiales sont alors retrouvees en faisant la difference entre les cotes de surface libre et du fond. - COTE CONSTANTE . Initialise la cote de surface libre a la valeur donnee par le mot-cle COTE INITIALE. Les hauteurs d'eau initiales sont calculees comme precedemment.- HAUTEUR NULLE .Initialise les hauteurs d'eau a 0. - HAUTEUR CONSTANTE. Initialise les hauteurs d'eau a la valeur donnee par le mot-cle HAUTEUR INITIALE. - PARTICULIERES. Les conditions initiales sur la hauteur d'eau doivent etre precisees dans le sous-programme CONDIN. - ALTIMETRIE SATELLITE TPXO. Les conditions initiales sur la hauteur  d'eau et les vitesses sont etablies sur la base des donnees.  satellite TPXO dont les 8 premiers constistuents ont ete extrait et sauves dans le fichier BASE DE DONNEES DE MAREE." ,
155           ang = 'Makes it possible to define the initial conditions with the water depth. The possible values are as follows: - ZERO ELEVATION-. Initializes the free surface elevation to 0.The initial water depths are then found by computing the difference between the free surface and the bottom.  - CONSTANT ELEVATION-. Initializes the water elevation to the value given by the keyword -INITIAL ELEVATION-. The initial water depths are computed as in the previous case. - ZERO DEPTH-. Initializes the water depths to 0. - CONSTANT DEPTH-. Initializes the water depths to the value givenby the key-word -INITIAL DEPTH-.   - SPECIAL-. The initial conditions with the water depth should be stated in the CONDIN subroutine.   - TPXO SATELITE ALTIMETRY. The initial conditions on the free surface andvelocities are established from the TPXO satellite program data, the harmonicconstituents of which are stored in the TIDE DATA BASE file.', ),
156  
157          b_initial_elevation = BLOC (condition = "Initial_Conditions == 'CONSTANT ELEVATION'",
158            Initial_Elevation       = SIMP(statut='o',typ='R' ),
159          ),
160          b_initial_depth     = BLOC (condition = "Initial_Conditions == 'CONSTANT DEPTH'",
161            Initial_Depth       = SIMP(statut='o',typ='R' ),
162          ),
163          b_special     = BLOC (condition = "Initial_Conditions == 'SPECIAL'",
164            special    = SIMP(statut='o',typ='TXM',defaut="The initial conditions with the water depth should be stated in the CONDIN subroutine"),
165          ),
166          b_initial_TPXO      = BLOC (condition = "Initial_Conditions == 'TPXO SATELLITE ALTIMETRY'",
167           Base_Ascii_De_Donnees_De_Maree     = SIMP( statut='o', typ = ('Fichier', 'All Files (*)',), ),
168            fr  = 'Base de donnees de constantes harmoniques tirees du fichier du modele de maree',
169            ang = 'Tide data base of harmonic constituents extracted from the tidal model file',
170          ),
171
172     Boundary_Conditions=FACT(statut='f', 
173             fr  = 'On donne un ensemble de conditions par frontiere liquide',
174             ang = 'One condition set per liquid boundary is given',
175  # Dans l ideal il faut aller regarder selon les groupes dans le fichier med
176  # en sortie il faut aller chercher le .cli qui va bien 
177             #Liquid_Boundaries=FACT(statut='f',max='**',
178             #    Options=SIMP(statut='f',typ='I',into=['classical boundary conditions','Thompson method based on characteristics'])
179             #    Prescribed_Flowrates=SIMP(statut='f',typ='R'),
180             #    Prescribed_Elevations=SIMP(statut='f',typ='R'),
181             #    Prescribed_Velocity=SIMP(statut='f',typ='R'),
182       # ),
183 # Il va falloir une "traduction dans le langage du dico"
184 # Il faut seulement l un des 3
185         Liquid_Boundaries=FACT(statut='f',max='**',
186                 
187             Options=SIMP(statut='f',typ='I',into=['classical boundary conditions','Thompson method based on characteristics']),
188
189             Type_Condition=SIMP(statut='o',typ='TXM',into=['Flowrates','Elevations','Velocity'],),
190              b_Flowrates     = BLOC (condition = "Type_Condition == 'Flowrates'",
191                 Prescribed_Flowrates=SIMP(statut='o',typ='R'),
192              ),
193              b_Elevations   = BLOC (condition = "Type_Condition == 'Elevations'",
194                 Prescribed_Elevations=SIMP(statut='o',typ='R'),
195              ),
196              b_Velocity   = BLOC (condition = "Type_Condition == 'Velocity'",
197                 Prescribed_Velocity=SIMP(statut='o',typ='R'),
198          ),
199        ),
200        Stage_Discharge_Curves=SIMP(statut='f',typ='I',into=[0,1,2]),
201        Stage_Discharge_Curves_File   = SIMP( statut='f', typ = ('Fichier', 'All Files (*)',),),
202        Treatment_of_Fluxes_at_the_Boundaries   = SIMP( statut='f',typ='I',into=[1,2],sug=1),
203        Option_for_tidal_Boundary_Conditions   = SIMP( statut='f',typ='I',into=[1,2],sug=1),
204    ),
205 )
206
207 NUMERICAL_PARAMETERS=PROC(nom="NUMERICAL_PARAMETERS",op=None,
208         Solver=FACT(statut='o',
209           Equations=SIMP(statut='o',typ='TXM',into=['SAINT-VENANT EF','SAINT-VENANT VF','BOUSSINESQ'],sug='SAINT-VENANT EF'),
210           Solver=SIMP(statut='o',typ='I',into=[1,2,3,4,6,7,8]),
211           Solver_Accuracy=SIMP(statut='o',typ='R'),
212           Maximum_Number_of_Iterations=SIMP(statut='o',typ='I'),
213         ),
214         Time=FACT(statut='f',
215         regles=(AU_MOINS_UN('Number_of_time_Steps','Variable_Time_Step'),
216                 PRESENT_PRESENT('Time_Step','Duration',),),
217            Number_of_Time_Steps=SIMP(statut='f',typ='I'),
218            Time_Step=SIMP(statut='f',typ='R'),
219            Duration=SIMP(statut='f',typ='R'),
220            Variable_Time_Step=SIMP(statut='f',typ=bool),
221         ),
222         Linearity=FACT(statut='f',
223            Treatment_of_Fluxes_at_the_Boundaries =SIMP( statut='f',typ='I',into=[1,2],sug=1),
224            Continuity_Correction  =SIMP(typ=bool, statut='f'),
225            Number_of_Sub_Iterations=SIMP(statut='f',typ='I'),
226         ),
227         Precondionning=FACT(statut='f',
228           Preconditionning=SIMP(statut='f',typ='I',into=[0,2,3,7,11,14,21],sug=2),
229           C_U_Preconditionning  =SIMP(typ=bool, statut='f',),
230           Matrix_Vector_Product =SIMP(statut='f',typ='I',into=[1,2]),
231           Matrix_Storage =SIMP(statut='f',typ='I',into=[1,3]),
232           Mass_Lumping_on_H =SIMP(statut='f',typ='R',sug=0),
233           Mass_Lumping_on_Velocity =SIMP(statut='f',typ='R',sug=0),
234         ),
235         Advection_Propagation=FACT(statut='f',
236           Type_of_Advection=SIMP(statut='f',typ='I',min=4,max=4,into=[1,2,3,4,5,6,7,13,14],defaut=(1,5,1,1),),
237           Advection_of_U_and_V=SIMP(statut='f',typ=bool),
238           Advection_of_H=SIMP(statut='f',typ=bool),
239           Advection_of_Tracers=SIMP(statut='f',typ=bool),
240           Advection_of_K_and_Epsilon=SIMP(statut='f',typ=bool),
241
242          b_upwind     =BLOC(condition = "2 in Type_of_Advection",
243             Upwind_Coefficients=SIMP(statut='o',typ='R',min=4,max=4,)
244            ),
245           Linearized_Propoagation=SIMP(statut='f',typ=bool,sug=False),
246           Mean_Depth_For_Linearity=SIMP(statut='f',typ='R',sug=0.0),
247         ),
248         Discretisation_Implicitation=FACT(statut='f',
249           Discretisation_in_Space=SIMP(statut='f',typ='I',min=4,max=4,into=[11,12,13],defaut=(11,11,11),),
250           Implicitation_for_Diffusion_of_velocity=SIMP(statut='f',typ='R',sug=0),
251           Implicitation_for_Depth=SIMP(statut='f',typ='R',sug=0.55),
252           Implicitation_for_Velocity=SIMP(statut='f',typ='R',sug=0.55),
253           Free_Surface_Gradient_Compatibility=SIMP(statut='f',typ='R',sug=1.),
254         ),
255         Initial_Guess_for_H=SIMP(statut='f',typ='TXM',into=['zero','previous','extrapolation'],defaut='previous',),
256         Initial_Guess_for_U=SIMP(statut='f',typ='TXM',into=['zero','previous','extrapolation'],defaut='previous',),
257 )
258
259 PHYSICAL_PARAMETERS=PROC(nom="PHYSICAL_PARAMETERS",op=None,
260         Atmosphere=FACT(statut='f',
261           Wind=SIMP(statut='f',typ=bool,sug=False),
262           b_Wind     =BLOC(condition = "Wind=='True'",
263             regles=( PRESENT_PRESENT('Wind_Velocity_along_X','Wind_Velocity_along_Y', ),),
264             Coefficient_of_Wind_Influence=SIMP(statut='f',typ='R',sug=0,),
265             Wind_Velocity_along_X=SIMP(statut='f',typ='R',sug=0,),
266             Wind_Velocity_along_Y=SIMP(statut='f',typ='R',sug=0,),
267             Threashold_Depth_for_Wind=SIMP(statut='f',typ='R',sug=0,),
268             Air_Pressure=SIMP(statut='f',typ=bool,sug=False),
269          ),
270           Rain_or_Evaporation=SIMP(statut='f',typ=bool,sug=False),
271           b_Rain     =BLOC(condition = "Rain_or_Evaporation=='True'",
272             Rain_or_Evaporation_in_mm_perday=SIMP(statut='f',typ='I',sug=0),
273                          ),
274          ),
275           Tide_Generating_Force=SIMP(statut='f',typ=bool,sug=False),
276           b_Tide     =BLOC(condition = "Tide_Generating_Force=='True'",
277               Tidal_Data_Base=SIMP(statut='f',typ='I',into=[-1,1,2,3,4]),
278               Coefficient_To_Calibrate_Tidal_Range=SIMP(statut='f',typ='R',sug=1.),
279               Coefficient_To_Calibrate_Tidal_Velocity=SIMP(statut='f',typ='R',sug=999999),
280               Coefficient_To_Calibrate_Sea_Level=SIMP(statut='f',typ='R',sug=0.),
281               Binary_Database_1_for_Tide  = SIMP( statut='f', typ = ('Fichier', '(All Files (*)',),),
282               Binary_Database_2_for_Tide  = SIMP( statut='f', typ = ('Fichier', '(All Files (*)',),),
283          ),
284           Wave_Driver_Currents=SIMP(statut='f',typ=bool,sug=False),
285           b_Wave     =BLOC(condition = "Wave_Driver_Currents=='True'",
286               Record_Number_in_Wave_File=SIMP(statut='f',typ='I',sug=1),
287          ),
288 )
289
290 POST_PROCESSING=PROC(nom="POST_PROCESSING",op=None,
291    Graphic_Printouts=FACT(statut='f',
292         Graphic_Printout_Period=SIMP(statut='o', typ='I',defaut=1),
293         Number_of_First_TimeStep_For_Graphic_Printouts=SIMP(statut='o', typ='I',defaut=1),
294         Variables_For_Graphic_Printouts=SIMP(statut='f',max="**", typ='TXM'),
295         # ajouter le into
296    ),
297   Listing__Printouts=FACT(statut='f',
298         Graphic_Printout_Period=SIMP(statut='o', typ='I',defaut=1),
299         Number_of_First_TimeStep_For_Graphic_Printouts=SIMP(statut='o', typ='I',defaut=1),
300         Variables_to_be_printed=SIMP(statut='f',max="**", typ='TXM'),
301         # ajouter le into
302    ),
303 )