From 9bf98fc1cb51814c31679120598dc309e0802e31 Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Thu, 1 Jun 2017 15:20:31 +0200 Subject: [PATCH] synchronisation avec Yoann --- InterfaceQT4/monWidgetMatrice.py | 7 +- Telemac/Telemac2d_Cata_auto.py | 140 +- ...mDicoTelemac.py => enum_Telemac2d_auto.py} | 103 +- Telemac/labelCataToIhm_en.ts | 1258 +++++++++++++++++ Telemac/prefs.py | 1 + Telemac/prefs_TELEMAC.py | 2 + Telemac/qtEficas_Telemac.py | 1 + UiQT5/desWidgetMatrice.ui | 18 +- Validation/V_MACRO_ETAPE.py | 4 +- convert/convert_TELEMAC.py | 212 +-- generator/generator_TELEMAC.py | 161 ++- 11 files changed, 1651 insertions(+), 256 deletions(-) rename Telemac/{enumDicoTelemac.py => enum_Telemac2d_auto.py} (96%) mode change 100755 => 100644 create mode 100644 Telemac/labelCataToIhm_en.ts diff --git a/InterfaceQT4/monWidgetMatrice.py b/InterfaceQT4/monWidgetMatrice.py index f5711a25..a5c9a582 100644 --- a/InterfaceQT4/monWidgetMatrice.py +++ b/InterfaceQT4/monWidgetMatrice.py @@ -36,6 +36,7 @@ from desWidgetMatrice import Ui_desWidgetMatrice from six.moves import range from PyQt5.QtCore import QSize +from PyQt5.QtWidgets import QTableWidgetItem class MonWidgetMatrice (Ui_desWidgetMatrice,Feuille): @@ -164,9 +165,11 @@ class MonWidgetMatrice (Ui_desWidgetMatrice,Feuille): else : initialFloat=0 self.TBMatrice.setItem(row,column,QTableWidgetItem(str(initialFloat))) - header=QStringList() + #header=QStringList() + header=[] for var in self.listeVariables : - header << var +# header << var + header.append(var) self.TBMatrice.setVerticalHeaderLabels(header) self.TBMatrice.setHorizontalHeaderLabels(header) diff --git a/Telemac/Telemac2d_Cata_auto.py b/Telemac/Telemac2d_Cata_auto.py index fae31b7d..2c871ca7 100755 --- a/Telemac/Telemac2d_Cata_auto.py +++ b/Telemac/Telemac2d_Cata_auto.py @@ -1,5 +1,5 @@ -# coding: utf-8 +# -*- coding: latin-1 -*- from Accas import * class DateJJMMAAAA: @@ -44,7 +44,6 @@ JdC = JDC_CATA (code = 'TELEMAC', # Catalog entry for the MAP function : c_pre_interfaceBody_mesh # ======================================================================= -VERSION_CATALOGUE="TRUNK" # ----------------------------------------------------------------------- COMPUTATION_ENVIRONMENT = PROC(nom= "COMPUTATION_ENVIRONMENT",op = None, # ----------------------------------------------------------------------- @@ -146,7 +145,7 @@ DEPTH-""", # ----------------------------------- ASCII_DATABASE_FOR_TIDE = SIMP(statut ='o', # ----------------------------------- - typ = ('Fichier','All Files (*)'), + typ = ('FichierOuRepertoire','All Files (*)'), defaut = '', fr = """ Base de donnees de constantes harmoniques tirees du fichier du modele de maree. Ancien nom en version 6.1 : BASE DE DONNEES DE MAREE""", @@ -830,7 +829,16 @@ for use.""", VARIABLES_TO_BE_PRINTED = SIMP(statut ='o', # ----------------------------------- typ = 'TXM', min=0, max='**', - into = ["velocity along x axis (m/s)","velocity along y axis (m/s)","wave celerity (m/s)","water depth (m)","free surface elevation (m)","bottom elevation (m)","Froude number","scalar flowrate of fluid (m2/s)","tracer 1, etc.","turbulent kinetic energy in k-epsilon model (J/kg)","dissipation of turbulent energy (W/kg)","turbulent viscosity of k-epsilon model (m2/s)","flowrate along x axis (m2/s)","flowrate along y axis (m2/s)","scalar velocity (m/s)","wind along x axis (m/s)","wind along y axis (m/s)","air pressure (Pa)","friction coefficient","drift along x (m)","drift along y (m)","nombre de courants ","supplementary variable N","supplementary variable O","supplementary variable R","supplementary variable Z","gradient 1, etc."], + intoSug = ["velocity along x axis (m/s)","velocity along y axis (m/s)","wave celerity (m/s)","water depth (m)","free surface elevation (m)","bottom elevation (m)","Froude number","scalar flowrate of fluid (m2/s)","tracer 1, etc.","turbulent kinetic energy in k-epsilon model (J/kg)","dissipation of turbulent energy (W/kg)","turbulent viscosity of k-epsilon model (m2/s)","flowrate along x axis (m2/s)","flowrate along y axis (m2/s)","scalar velocity (m/s)","wind along x axis (m/s)","wind along y axis (m/s)","air pressure (Pa)","friction coefficient","drift along x (m)","drift along y (m)","nombre de courants ","supplementary variable N","supplementary variable O","supplementary variable R","supplementary variable Z","gradient 1, etc."], + fr = """ Nom des variables que l''utilisateur desire ecrire a l''ecran. Meme +possibilites que pour les sorties graphiques.""", + ang = """""", + ), +# ----------------------------------- + PN_VARIABLES_TO_BE_PRINTED = SIMP(statut ='o', +# ----------------------------------- + typ = 'TXM', min=0, max='**', + # into = ["velocity along x axis (m/s)","velocity along y axis (m/s)","wave celerity (m/s)","water depth (m)","free surface elevation (m)","bottom elevation (m)","Froude number","scalar flowrate of fluid (m2/s)","tracer 1, etc.","turbulent kinetic energy in k-epsilon model (J/kg)","dissipation of turbulent energy (W/kg)","turbulent viscosity of k-epsilon model (m2/s)","flowrate along x axis (m2/s)","flowrate along y axis (m2/s)","scalar velocity (m/s)","wind along x axis (m/s)","wind along y axis (m/s)","air pressure (Pa)","friction coefficient","drift along x (m)","drift along y (m)","nombre de courants ","supplementary variable N","supplementary variable O","supplementary variable R","supplementary variable Z","gradient 1, etc."], fr = """ Nom des variables que l''utilisateur desire ecrire a l''ecran. Meme possibilites que pour les sorties graphiques.""", ang = """""", @@ -905,64 +913,55 @@ the solution of the linear system.""", HYDRO = PROC(nom= "HYDRO",op = None, # ----------------------------------------------------------------------- UIinfo = {"groupes": ("CACHE")}, - - - - # ----------------------------------- BOUNDARY_CONDITIONS = FACT(statut='o', -# PNPN --> Attention aux noms cf generator # ----------------------------------- -# ----------------------------------- - LIQUID_BOUNDARIES = FACT(statut ='f', min = 1, max="**", # ----------------------------------- # ----------------------------------- -# BOUNDARY_NAME = SIMP(statut ='o', typ = 'TXM',), -# ----------------------------------- -# ----------------------------------- - BOUNDARY_TYPE = SIMP(statut ='o', typ = 'TXM', into = ['Prescribed Flowrates', 'Prescribed Elevations', 'Prescribed Velocity'],), + LIQUID_BOUNDARIES = FACT(statut ='f', min = 1, max="**", # ----------------------------------- + BOUNDARY_TYPE = SIMP(statut ='o', typ = 'TXM', into = ['Prescribed Flowrates', 'Prescribed Elevations', 'Prescribed Velocity'],), + # ----------------------------------- - # ------------------------------------ - b_Elevations = BLOC (condition = "BOUNDARY_TYPE == 'Prescribed Elevations'", -# ------------------------------------ + # ------------------------------------ + b_Elevations = BLOC (condition = "BOUNDARY_TYPE == 'Prescribed Elevations'", + # ------------------------------------ -# ----------------------------------- - PRESCRIBED_ELEVATIONS = SIMP(statut ='o', -# ----------------------------------- - typ = 'R', - fr = """ Valeurs des cotes imposees aux frontieres liquides entrantes. Lire la -partie du mode d''emploi consacree aux conditions aux limites""", - ang = """ Values of prescribed elevations at the inflow boundaries. The section -about boundary conditions is to be read in the manual""", - ), - ), - # ------------------------------------ - b_Flowrates = BLOC (condition = "BOUNDARY_TYPE == 'Prescribed Flowrates'", -# ------------------------------------ -# ----------------------------------- - PRESCRIBED_FLOWRATES = SIMP(statut ='o', -# ----------------------------------- - typ = 'R', - fr = """ Valeurs des debits imposes aux frontieres liquides entrantes. Lire la -partie du mode d''emploi consacree aux conditions aux limites""", - ang = """ Values of prescribed flowrates at the inflow boundaries. The section -about boundary conditions is to be read in the manual""", - ), - ), - b_Velocity = BLOC (condition = "BOUNDARY_TYPE == 'Prescribed Velocity'", -# ----------------------------------- - PRESCRIBED_VELOCITIES = SIMP(statut ='o', -# ----------------------------------- - typ = 'R', - fr = """ Valeurs des vitesses imposees aux frontieres liquides entrantes. Lire -la partie du mode d''emploi consacree aux conditions aux limites""", - ang = """ Values of prescribed velocities at the liquid inflow boundaries. Refer -to the section dealing with the boundary conditions""", - ), - ), - ), -# ----------------------------------- + # ----------------------------------- + PRESCRIBED_ELEVATIONS = SIMP(statut ='o', + # ----------------------------------- + typ = 'R', + fr = """ Valeurs des cotes imposees aux frontieres liquides entrantes. Lire la + partie du mode d''emploi consacree aux conditions aux limites""", + ang = """ Values of prescribed elevations at the inflow boundaries. The section + about boundary conditions is to be read in the manual""", + ), + ), + # ------------------------------------ + b_Flowrates = BLOC (condition = "BOUNDARY_TYPE == 'Prescribed Flowrates'", + # ------------------------------------ + # ----------------------------------- + PRESCRIBED_FLOWRATES = SIMP(statut ='o', + # ----------------------------------- + typ = 'R', + fr = """ Valeurs des debits imposes aux frontieres liquides entrantes. Lire la + partie du mode d''emploi consacree aux conditions aux limites""", + ang = """ Values of prescribed flowrates at the inflow boundaries. The section + about boundary conditions is to be read in the manual""", + ), + ), + b_Velocity = BLOC (condition = "BOUNDARY_TYPE == 'Prescribed Velocity'", + # ----------------------------------- + PRESCRIBED_VELOCITIES = SIMP(statut ='o', + # ----------------------------------- + typ = 'R', + fr = """ Valeurs des vitesses imposees aux frontieres liquides entrantes. Lire + la partie du mode d''emploi consacree aux conditions aux limites""", + ang = """ Values of prescribed velocities at the liquid inflow boundaries. Refer + to the section dealing with the boundary conditions""", + ), + ), + ), # Fin LIQUID STAGE_DISCHARGE_CURVES = SIMP(statut ='f', # ----------------------------------- typ = 'TXM', max='**', @@ -1535,28 +1534,28 @@ adjoint""", # ----------------------------------- ABSCISSAE_OF_SOURCES = SIMP(statut ='o', # ----------------------------------- - typ = 'R', min=0, max='**', + typ = 'R', min= 2, max= 2, fr = """ Valeurs des abscisses des sources de debit et de traceur.""", ang = """ abscissae of sources of flowrate and/or tracer""", ), # ----------------------------------- ORDINATES_OF_SOURCES = SIMP(statut ='o', # ----------------------------------- - typ = 'R', min=0, max='**', + typ = 'R', min= 2, max= 2, fr = """ Valeurs des ordonnees des sources de debit et de traceur.""", ang = """ ordinates of sources of flowrate and/or tracer""", ), # ----------------------------------- WATER_DISCHARGE_OF_SOURCES = SIMP(statut ='o', # ----------------------------------- - typ = 'R', min=0, max='**', + typ = 'R', min= 2, max= 2, fr = """ Valeurs des debits des sources.""", ang = """ values of water discharge of sources""", ), # ----------------------------------- VELOCITIES_OF_THE_SOURCES_ALONG_X = SIMP(statut ='f', # ----------------------------------- - typ = 'R', min=0, max='**', + typ = 'R', min= 2, max= 2, fr = """ Vitesses du courant a chacune des sources. Si elles ne sont pas donnees, on considere que la vitesse est celle du courant""", ang = """ Velocities at the sources. If they are not given, the velocity of the @@ -1565,7 +1564,7 @@ flow at this location is taken""", # ----------------------------------- VELOCITIES_OF_THE_SOURCES_ALONG_Y = SIMP(statut ='f', # ----------------------------------- - typ = 'R', min=0, max='**', + typ = 'R', min= 2, max= 2, fr = """ Vitesses du courant a chacune des sources""", ang = """ Velocities at the sources""", ), @@ -2443,9 +2442,9 @@ through this technique.""", # ----------------------------------- TREATMENT_OF_FLUXES_AT_THE_BOUNDARIES = SIMP(statut ='o', # ----------------------------------- - typ = 'TXM', + typ = 'TXM', min=0, max='**', into = ["Priority to prescribed values","Priority to fluxes"], - defaut = "Priority to prescribed values", + defaut = ["Priority to prescribed values","Priority to prescribed values"], fr = """ Utilise pour les schemas SUPG, PSI et N, avec option 2, on ne retrouve pas exactement les valeurs imposees des traceurs, mais le flux est correct""", @@ -2530,9 +2529,10 @@ velocity""", ang = """ Defines the number of user differentiators""", ), # ----------------------------------- - NAMES_OF_DIFFERENTIATORS = SIMP(statut ='o', + NAMES_OF_DIFFERENTIATORS = SIMP(statut ='f', # ----------------------------------- typ = 'TXM', min= 2, max= 2, + defaut = ';', fr = """ Noms des differentiateurs utilisateurs en 32 caracteres, 16 pour le nom, 16 pour l''unite""", ang = """ Name of user differentiators in 32 characters, 16 for the name, 16 for @@ -2890,7 +2890,7 @@ POROSITY (DEFINA METHOD)""", TREATMENT_OF_NEGATIVE_DEPTHS = SIMP(statut ='o', # ----------------------------------- typ = 'TXM', - into = ["SMOOTHING","FLUX CONTROL"], + into = ["SMOOTHING","FLUX CONTROL","FLUX CONTROL (ERIA)"], defaut = "SMOOTHING", fr = """ Seulement avec OPTION DE TRAITEMENT DES BANCS DECOUVRANTS = 1 0 : pas de traitement 1 : lissage 2 : limitation des flux""", @@ -2974,14 +2974,14 @@ section dealing with the boundary conditions""", # ----------------------------------- NAMES_OF_TRACERS = SIMP(statut ='o', # ----------------------------------- - typ = 'TXM', min=0, max='**', + typ = 'TXM', max='**', fr = """ Noms des traceurs en 32 caracteres, 16 pour le nom 16 pour l''unite""", ang = """ Name of tracers in 32 characters, 16 for the name, 16 for the unit.""", ), # ----------------------------------- INITIAL_VALUES_OF_TRACERS = SIMP(statut ='o', # ----------------------------------- - typ = 'R', min=0, max='**', + typ = 'R', max='**', defaut = [0.,0.], fr = """ Fixe la valeur initiale du traceur.""", ang = """ Sets the initial value of the tracer.""", @@ -3048,8 +3048,8 @@ BETWEEN 2 AND 15""", # ----------------------------------- PRECONDITIONING_FOR_DIFFUSION_OF_TRACERS = SIMP(statut ='o', # ----------------------------------- - typ = 'TXM', - into = ["diagonal","no preconditioning ","crout","diagonal and crout"], + typ = 'TXM', min=0, max='**', + into = ["no preconditioning ","diagonal","crout","diagonal and crout"], defaut = "diagonal", fr = """ Permet de preconditionner le systeme relatif au traceur. Memes definition et possibilites que pour le mot-cle PRECONDITIONNEMENT. 0 : @@ -3089,13 +3089,13 @@ diffusion of tracer.""", # ----------------------------------- VALUES_OF_THE_TRACERS_AT_THE_SOURCES = SIMP(statut ='o', # ----------------------------------- - typ = 'R', min=0, max='**', + typ = 'R', min= 2, max= 2, fr = """ Valeurs des traceurs a chacune des sources""", ang = """ Values of the tracers at the sources""", ), ), # ----------------------------------- - METEOROLOGY_TRA = FACT(statut='f', + METEOROLOGY_TRA = FACT(statut='o', # ----------------------------------- # ----------------------------------- VALUES_OF_TRACERS_IN_THE_RAIN = SIMP(statut ='o', @@ -3158,6 +3158,7 @@ ADVECTION""", # ----------------------------------- typ = 'R', defaut = 1.E-6, + #max='**', fr = """ Fixe la valeur du coefficient de diffusion du traceur. L''influence de ce parametre sur l''evolution du traceur dans le temps est importante.""", ang = """ Sets the value of the tracer diffusivity.""", @@ -3179,6 +3180,7 @@ ce parametre sur l''evolution du traceur dans le temps est importante.""", # ----------------------------------- typ = 'I', defaut = 1, + max='**', fr = """ Si present remplace et a priorite sur : OPTION POUR LES CARACTERISTIQUES OPTION DE SUPG Si schema PSI ou N : 1=explicite 2=predicteur-correcteur 3=predicteur-correcteur deuxieme ordre en temps diff --git a/Telemac/enumDicoTelemac.py b/Telemac/enum_Telemac2d_auto.py old mode 100755 new mode 100644 similarity index 96% rename from Telemac/enumDicoTelemac.py rename to Telemac/enum_Telemac2d_auto.py index 79834f19..c3d0a281 --- a/Telemac/enumDicoTelemac.py +++ b/Telemac/enum_Telemac2d_auto.py @@ -11,6 +11,8 @@ TelemacdicoEn = { 'F':"Froude number", 'Q':"scalar flowrate of fluid (m2/s)", 'T1':"tracer 1 etc.", + 'T*':"All the tracers 1 to 9.", + 'T1*':"All the tracers 10 to 19.", 'K':"turbulent kinetic energy in k-epsilon model (J/kg)", 'E':"dissipation of turbulent energy (W/kg)", 'D':"turbulent viscosity (m2/s)", @@ -36,6 +38,7 @@ TelemacdicoEn = { 'G1':"gradient 1, etc. ", }, 'VARIABLES_TO_BE_PRINTED' : { + 'No':" ", 'U':"velocity along x axis (m/s)", 'V':"velocity along y axis (m/s)", 'C':"wave celerity (m/s)", @@ -268,6 +271,7 @@ TelemacdicoEn = { 'TREATMENT_OF_NEGATIVE_DEPTHS' : { 1:"SMOOTHING", 2:"FLUX CONTROL", + 3:"FLUX CONTROL (ERIA)", }, 'SOLVER_FOR_DIFFUSION_OF_TRACERS' : { 1:"conjugate gradient", @@ -280,8 +284,8 @@ TelemacdicoEn = { 8:"direct", }, 'PRECONDITIONING_FOR_DIFFUSION_OF_TRACERS' : { - 2:"diagonal", 0:"no preconditioning ", + 2:"diagonal", 7:"crout", 14:"diagonal and crout", }, @@ -368,6 +372,8 @@ TelemacdicoFr = { 'F':"nombre de Froude", 'Q':"debit scalaire du fluide (m2/s)", 'T1':"traceur 1, etc.", + 'T*':"Tous les traceurs de 1a 9.", + 'T1*':"Tous les traceurs 10 a 19.", 'K':"energie turbulente du modele k-epsilon (J/kg)", 'E':"dissipation de l energie turbulente (W/kg)", 'D':"viscosite turbulente (m2/s)", @@ -393,6 +399,7 @@ TelemacdicoFr = { 'G1':"gradient 1, etc. ", }, 'VARIABLES_TO_BE_PRINTED' : { + 'No':" ", 'U':"vitesse suivant l axe des x (m/s)", 'V':"vitesse suivant l axe des y (m/s)", 'C':"celerite des ondes (m/s)", @@ -625,6 +632,7 @@ TelemacdicoFr = { 'TREATMENT_OF_NEGATIVE_DEPTHS' : { 1:"LISSAGE", 2:"LIMITATION DES FLUX", + 3:"LIMITATION DES FLUX (ERIA)", }, 'SOLVER_FOR_DIFFUSION_OF_TRACERS' : { 1:"gradient conjuge", @@ -637,8 +645,8 @@ TelemacdicoFr = { 8:"direct", }, 'PRECONDITIONING_FOR_DIFFUSION_OF_TRACERS' : { - 2:"diagonal", 0:"aucun", + 2:"diagonal", 7:"crout", 14:"diagonal et crout", }, @@ -1410,7 +1418,96 @@ DicoEnumCasFrToEnumCasEn = { 'PARAMETER_ESTIMATION':{ "":"", "FROTTEMENT":"FRICTION", - "FROTTEMENT, PERMANENT":"FROTTEMENT, STEADY", + "FROTTEMENT, PERMANENT":"FRICTION, STEADY", +}, + +'EQUATIONS':{ + "SAINT-VENANT EF":"SAINT-VENANT FE", + "SAINT-VENANT VF":"SAINT-VENANT FV", + "BOUSSINESQ":"BOUSSINESQ", +}, + +'COUPLING_WITH':{ + "SISYPHE":"SISYPHE", + "TOMAWAC":"TOMAWAC", + "DELWAQ":"DELWAQ", +}, + +'PARTITIONING_TOOL':{ + "METIS":"METIS", + "SCOTCH":"SCOTCH", + "PARMETIS":"PARMETIS", + "PTSCOTCH":"PTSCOTCH", +}, + +} +DicoEnumCasFrToEnumCasEn = { +'INITIAL_CONDITIONS':{ + "COTE NULLE":"ZERO ELEVATION", + "COTE CONSTANTE":"CONSTANT ELEVATION", + "HAUTEUR NULLE":"ZERO DEPTH", + "HAUTEUR CONSTANTE":"CONSTANT DEPTH", + "SPECIAL":"SPECIAL", + "PARTICULIERES":"PARTICULIERES", + "PARTICULAR":"PARTICULAR", + "ALTIMETRIE SATELLITE TPXO":"TPXO SATELLITE ALTIMETRY", +}, + +'BINARY_DATA_FILE_1_FORMAT':{ + "BIN":"BIN", + "SERAFIN":"SERAFIN", + "SERAFIND":"SERAFIND", + "MED":"MED", +}, + +'BINARY_DATA_FILE_2_FORMAT':{ + "BIN":"BIN", + "SERAFIN":"SERAFIN", + "SERAFIND":"SERAFIND", + "MED":"MED", +}, + +'GEOMETRY_FILE_FORMAT':{ + "SERAFIN?":"SERAFIN?", + "SERAFIND":"SERAFIND", + "MED":"MED", +}, + +'REFERENCE_FILE_FORMAT':{ + "SERAFIN?":"SERAFIN?", + "SERAFIND":"SERAFIND", + "MED":"MED", +}, + +'PREVIOUS_COMPUTATION_FILE_FORMAT':{ + "SERAFIN?":"SERAFIN?", + "SERAFIND":"SERAFIND", + "MED":"MED", +}, + +'RESULTS_FILE_FORMAT':{ + "SERAFIN?":"SERAFIN?", + "SERAFIND":"SERAFIND", + "MED":"MED", +}, + +'BINARY_RESULTS_FILE_FORMAT':{ + "BIN":"BIN", + "SERAFIN":"SERAFIN", + "SERAFIND":"SERAFIND", + "MED":"MED", +}, + +'BINARY_ATMOSPHERIC_DATA_FILE_FORMAT':{ + "SERAFIN?":"SERAFIN?", + "SERAFIND":"SERAFIND", + "MED":"MED", +}, + +'PARAMETER_ESTIMATION':{ + "":"", + "FROTTEMENT":"FRICTION", + "FROTTEMENT, PERMANENT":"FRICTION, STEADY", }, 'EQUATIONS':{ diff --git a/Telemac/labelCataToIhm_en.ts b/Telemac/labelCataToIhm_en.ts new file mode 100644 index 00000000..da7753aa --- /dev/null +++ b/Telemac/labelCataToIhm_en.ts @@ -0,0 +1,1258 @@ + + + + @default + + ASSIMILATION_STUDY + Assimilation Study traduit + + + COEFFICIENT_TO_CALIBRATE_TIDAL_VELOCITIES + Coefficient to calibrate tidal velocities + + + COST_FUNCTION + Cost function + + + BOTTOM_TOPOGRAPHY_FILE + Bottom topography file + + + DENSITY_OF_ALGAE + Density of algae + + + STEERING_FILE + Steering file + + + NUMBER_OF_CORRECTIONS_OF_DISTRIBUTIVE_SCHEMES + Number of corrections of distributive schemes + + + LONGITUDE_OF_ORIGIN_POINT + Longitude of origin point + + + PREVIOUS_COMPUTATION_FILE + Previous computation file + + + DIAMETER_OF_ROUGHNESS_ELEMENTS + Diameter of roughness elements + + + THICKNESS_OF_ALGAE + Thickness of algae + + + CORIOLIS + Coriolis + + + OPTION_FOR_TIDAL_BOUNDARY_CONDITIONS + Option for tidal boundary conditions + + + NUMBER_OF_TIME_STEPS + Number of time steps + + + ADVECTION + Advection + + + NEWMARK_TIME_INTEGRATION_COEFFICIENT + Newmark time integration coefficient + + + TIME_STEP + Time step + + + VALUE_OF_ATMOSPHERIC_PRESSURE + Value of atmospheric pressure + + + LISTING_FOR_PRINTOUT_PERIOD + Listing for printout period + + + BINARY_DATABASE_2_FOR_TIDE + Binary database 2 for tide + + + VOLUMES_DELWAQ_FILE + Volumes DELWAQ file + + + DESCRIPTION_OF_LIBRARIES + Description of libraries + + + STOP_IF_A_STEADY_STATE_IS_REACHED + Stop if a steady state is reached + + + SALINITY_DELWAQ_FILE + Salinity DELWAQ file + + + IMPLICITATION_FOR_DEPTH + Implicitation for depth + + + DROGUES_FILE + Drogues file + + + TEMPERATURE_FOR_DELWAQ + Temperature for DELWAQ + + + LANGUAGE + Language + + + INITIAL_DEPTH + Initial depth + + + IDENTIFICATION_METHOD + Identification method + + + COEFFICIENT_FOR_DIFFUSION_OF_TRACERS + Coefficient for diffusion of tracers + + + NAMES_OF_DIFFERENTIATORS + Names of differentiators + + + VELOCITY_DIFFUSIVITY + Velocity diffusivity + + + VECTOR_LENGTH + Vector length + + + GRAPHIC_PRINTOUT_PERIOD + Graphic printout period + + + LINEARIZED_PROPAGATION + Linearized propagation + + + PRECONDITIONING + Preconditioning + + + MANNING_DEFAULT_VALUE_FOR_COLEBROOK_WHITE_LAW + Manning default value for colebrook-white law + + + TURBULENCE_MODEL + Turbulence model + + + PRINTOUT_PERIOD_FOR_DROGUES + Printout period for drogues + + + DURATION_OF_RAIN_OR_EVAPORATION_IN_HOURS + Duration of rain or evaporation in hours + + + DEBUGGER + Debugger + + + DICTIONARY + Dictionary + + + SIPHONS_DATA_FILE + Siphons data file + + + WATER_DISCHARGE_OF_SOURCES + Water discharge of sources + + + ADVECTION_OF_U_AND_V + Advection of U and V + + + ANTECEDENT_MOISTURE_CONDITIONS + Antecedent moisture conditions + + + DIFFUSION_OF_VELOCITY + Diffusion of velocity + + + WATER_DENSITY + Water density + + + ORIGIN_COORDINATES + Origin coordinates + + + LATITUDE_OF_ORIGIN_POINT + Latitude of origin point + + + PRESCRIBED_TRACERS_VALUES + Prescribed tracers values + + + MAXIMUM_NUMBER_OF_ITERATIONS_FOR_SOLVER + Maximum number of iterations for solver + + + FLUXLINE + Fluxline + + + INFORMATION_ABOUT_SPALART_ALLMARAS_MODEL + Information about spalart-allmaras model + + + VELOCITY_FOR_DELWAQ + Velocity for DELWAQ + + + PARALLEL_PROCESSORS + Parallel processors + + + ROUGHNESS_COEFFICIENT_OF_BOUNDARIES + Roughness coefficient of boundaries + + + RAINFALL_RUNOFF_MODEL + Rainfall-runoff model + + + PSI_SCHEME_OPTION + Psi scheme option + + + SCHEME_OPTION_FOR_ADVECTION_OF_VELOCITIES + Scheme option for advection of velocities + + + INITIAL_CONDITIONS + Initial conditions + + + INITIAL_TIME_SET_TO_ZERO + Initial time set to zero + + + NUMBER_OF_SUB_ITERATIONS_FOR_NON_LINEARITIES + Number of sub-iterations for non-linearities + + + OPTION_FOR_THE_DIFFUSION_OF_TRACERS + Option for the diffusion of tracers + + + CULVERTS_DATA_FILE + Culverts data file + + + DIAMETER_OF_ALGAE + Diameter of algae + + + ACCURACY_OF_EPSILON + Accuracy of epsilon + + + MAXIMUM_NUMBER_OF_ITERATIONS_FOR_DIFFUSION_OF_TRACERS + Maximum number of iterations for diffusion of tracers + + + MASS_LUMPING_ON_VELOCITY + Mass-lumping on velocity + + + FRICTION_DATA_FILE + Friction data file + + + SCHEME_FOR_ADVECTION_OF_K_EPSILON + Scheme for advection of K-epsilon + + + SOLVER_ACCURACY + Solver accuracy + + + NAMES_OF_POINTS + Names of points + + + TOMAWAC_STEERING_FILE + TOMAWAC steering file + + + BOUNDARY_CONDITIONS_FILE + Boundary conditions file + + + STOP_CRITERIA + Stop criteria + + + BINARY_RESULTS_FILE_FORMAT + Binary results file format + + + TEMPERATURE_DELWAQ_FILE + Temperature DELWAQ file + + + PROPAGATION + Propagation + + + FINITE_VOLUME_SCHEME + Finite volume scheme + + + IMPLICITATION_COEFFICIENT_OF_TRACERS + Implicitation coefficient of tracers + + + CORIOLIS_COEFFICIENT + Coriolis coefficient + + + PRESCRIBED_FLOWRATES + Prescribed flowrates + + + REFINEMENT_LEVELS + Refinement levels + + + NUMBER_OF_FIRST_TIME_STEP_FOR_LISTING_PRINTOUTS + Number of first time step for listing printouts + + + PRINTING_CUMULATED_FLOWRATES + Printing cumulated flowrates + + + NUMBER_OF_FIRST_TIME_STEP_FOR_GRAPHIC_PRINTOUTS + Number of first time step for graphic printouts + + + PHYSICAL_CHARACTERISTICS_OF_THE_TSUNAMI + Physical characteristics of the tsunami + + + MASS_BALANCE + Mass-balance + + + BINARY_DATABASE_1_FOR_TIDE + Binary database 1 for tide + + + SOURCES_FILE + Sources file + + + LAW_OF_TRACERS_DEGRADATION + Law of tracers degradation + + + SECTIONS_INPUT_FILE + Sections input file + + + CONTROL_SECTIONS + Control sections + + + SOLVER_FOR_DIFFUSION_OF_TRACERS + Solver for diffusion of tracers + + + RESULTS_FILE_FORMAT + Results file format + + + SECONDARY_CURRENTS + Secondary currents + + + OPTION_FOR_INITIAL_ABSTRACTION_RATIO + Option for initial abstraction ratio + + + TYPE_OF_WEIRS + Type of weirs + + + NUMBER_OF_SUB_STEPS_OF_DISTRIBUTIVE_SCHEMES + Number of sub-steps of distributive schemes + + + SPACING_OF_ROUGHNESS_ELEMENTS + Spacing of roughness elements + + + SCHEME_OPTION_FOR_ADVECTION_OF_K_EPSILON + Scheme option for advection of K-epsilon + + + COUPLING_WITH + Coupling with + + + LISTING_PRINTOUT_PERIOD + Listing printout period + + + THRESHOLD_DEPTH_FOR_WIND + Threshold depth for wind + + + VELOCITY_PROFILES + Velocity profiles + + + ALGAE_TYPE + Algae type + + + TREATMENT_OF_FLUXES_AT_THE_BOUNDARIES + Treatment of fluxes at the boundaries + + + MINOR_CONSTITUENTS_INFERENCE + Minor constituents inference + + + STAGE_DISCHARGE_CURVES + Stage-discharge curves + + + GLOBAL_NUMBER_OF_THE_POINT_TO_CALIBRATE_HIGH_WATER + Global number of the point to calibrate high water + + + RAIN_OR_EVAPORATION_IN_MM_PER_DAY + Rain or evaporation in mm per day + + + REFERENCE_FILE_FORMAT + Reference file format + + + DIFFUSIVITY_FOR_DELWAQ + Diffusivity for DELWAQ + + + BOTTOM_SURFACES_DELWAQ_FILE + Bottom surfaces DELWAQ file + + + FORMATTED_DATA_FILE_1 + Formatted data file 1 + + + FORMATTED_DATA_FILE_2 + Formatted data file 2 + + + COMPUTATION_CONTINUED + Computation continued + + + RECORD_NUMBER_IN_WAVE_FILE + Record number in wave file + + + C_U_PRECONDITIONING + C-U preconditioning + + + LIST_OF_POINTS + List of points + + + TYPE_OF_ADVECTION + Type of advection + + + WIND_VELOCITY_ALONG_X + Wind velocity along X + + + WIND_VELOCITY_ALONG_Y + Wind velocity along Y + + + TOLERANCES_FOR_IDENTIFICATION + Tolerances for identification + + + PREVIOUS_COMPUTATION_FILE_FORMAT + Previous computation file format + + + DISCRETIZATIONS_IN_SPACE + Discretizations in space + + + BINARY_ATMOSPHERIC_DATA_FILE + Binary atmospheric data file + + + BINARY_RESULTS_FILE + Binary results file + + + EXCHANGES_BETWEEN_NODES_DELWAQ_FILE + Exchanges between nodes DELWAQ file + + + CONTINUITY_CORRECTION + Continuity correction + + + SCHEME_FOR_ADVECTION_OF_VELOCITIES + Scheme for advection of velocities + + + EXCHANGE_AREAS_DELWAQ_FILE + Exchange areas DELWAQ file + + + SISYPHE_STEERING_FILE + Sisyphe steering file + + + IMPLICITATION_FOR_DIFFUSION_OF_VELOCITY + Implicitation for diffusion of velocity + + + ADVECTION_OF_K_AND_EPSILON + Advection of K and epsilon + + + FREE_SURFACE_GRADIENT_COMPATIBILITY + Free surface gradient compatibility + + + VALUES_OF_THE_TRACERS_AT_THE_SOURCES + Values of the tracers at the sources + + + NUMBER_OF_CULVERTS + Number of culverts + + + RELEASE + Release + + + DELWAQ_STEERING_FILE + DELWAQ steering file + + + CONVERGENCE_STUDY + Convergence study + + + NAMES_OF_PRIVATE_VARIABLES + Names of private variables + + + PRECONDITIONING_FOR_DIFFUSION_OF_TRACERS + Preconditioning for diffusion of tracers + + + VALIDATION + Validation + + + NUMBER_OF_SIPHONS + Number of siphons + + + BINARY_ATMOSPHERIC_DATA_FILE_FORMAT + Binary atmospheric data file format + + + WEIRS_DATA_FILE + Weirs data file + + + IMPLICITATION_FOR_VELOCITY + Implicitation for velocity + + + DEFINITION_OF_ZONES + Definition of zones + + + LISTING_PRINTOUT + Listing printout + + + MEAN_DEPTH_FOR_LINEARIZATION + Mean depth for linearization + + + COUPLING_PERIOD_FOR_TOMAWAC + Coupling period for TOMAWAC + + + WAVE_ENHANCED_FRICTION_FACTOR + Wave enhanced friction factor + + + VARIABLES_FOR_GRAPHIC_PRINTOUTS + Variables for graphic printouts + + + DEPTH_IN_FRICTION_TERMS + Depth in friction terms + + + MASS_LUMPING_ON_H + Mass-lumping on H + + + NUMBER_OF_LAGRANGIAN_DRIFTS + Number of lagrangian drifts + + + NON_DIMENSIONAL_DISPERSION_COEFFICIENTS + Non-dimensional dispersion coefficients + + + FOURIER_ANALYSIS_PERIODS + Fourier analysis periods + + + VARIABLES_TO_BE_PRINTED + Variables to be printed + + + EQUATIONS + Equations + + + MAXIMUM_NUMBER_OF_ITERATIONS_FOR_IDENTIFICATION + Maximum number of iterations for identification + + + WIND + Wind + + + SPEED_AND_DIRECTION_OF_WIND + Speed and direction of wind + + + NAMES_OF_CLANDESTINE_VARIABLES + Names of clandestine variables + + + GEOMETRY_FILE_FORMAT + Geometry file format + + + NON_SUBMERGED_VEGETATION_FRICTION + Non-submerged vegetation friction + + + TYPE_OF_SOURCES + Type of sources + + + TIDAL_FLATS + Tidal flats + + + TITLE + Title + + + NUMBER_OF_DIFFERENTIATORS + Number of differentiators + + + ORIGINAL_HOUR_OF_TIME + Original hour of time + + + TIDE_GENERATING_FORCE + Tide generating force + + + LAW_OF_FRICTION_ON_LATERAL_BOUNDARIES + Law of friction on lateral boundaries + + + STAGE_DISCHARGE_CURVES_FILE + Stage-discharge curves file + + + DESIRED_COURANT_NUMBER + Desired courant number + + + DISSIPATION_COEFFICIENT_FOR_SECONDARY_CURRENTS + Dissipation coefficient for secondary currents + + + COUPLING_PERIOD_FOR_SISYPHE + Coupling period for sisyphe + + + ALGAE_TRANSPORT_MODEL + Algae transport model + + + ABSCISSAE_OF_SOURCES + Abscissae of sources + + + LIQUID_BOUNDARIES_FILE + Liquid boundaries file + + + VELOCITIES_OF_THE_SOURCES_ALONG_X + Velocities of the sources along X + + + VELOCITIES_OF_THE_SOURCES_ALONG_Y + Velocities of the sources along Y + + + MAXIMUM_NUMBER_OF_SOURCES + Maximum number of sources + + + SOLVER_OPTION_FOR_TRACERS_DIFFUSION + Solver option for tracers diffusion + + + INFORMATION_ABOUT_SOLVER + Information about solver + + + BINARY_DATA_FILE_1_FORMAT + Binary data file 1 format + + + SALINITY_FOR_DELWAQ + Salinity for DELWAQ + + + COUPLING_DIRECTORY + Coupling directory + + + DELWAQ_PRINTOUT_PERIOD + DELWAQ printout period + + + BOTTOM_SMOOTHINGS + Bottom smoothings + + + AIR_PRESSURE + Air pressure + + + PRESCRIBED_ELEVATIONS + Prescribed elevations + + + MASS_LUMPING_FOR_WEAK_CHARACTERISTICS + Mass-lumping for weak characteristics + + + GRAVITY_ACCELERATION + Gravity acceleration + + + LIMIT_VALUES + Limit values + + + RESULTS_FILE + Results file + + + SCHEME_OPTION_FOR_ADVECTION_OF_TRACERS + Scheme option for advection of tracers + + + OPTION_FOR_CHARACTERISTICS + Option for characteristics + + + OPTION_FOR_THE_TREATMENT_OF_TIDAL_FLATS + Option for the treatment of tidal flats + + + TIME_RANGE_FOR_FOURIER_ANALYSIS + Time range for fourier analysis + + + VERTICAL_FLUXES_DELWAQ_FILE + Vertical fluxes DELWAQ file + + + ORDINATES_OF_SOURCES + Ordinates of sources + + + MAXIMUM_NUMBER_OF_TRACERS + Maximum number of tracers + + + TURBULENCE_REGIME_FOR_SOLID_BOUNDARIES + Turbulence regime for solid boundaries + + + LOCAL_NUMBER_OF_THE_POINT_TO_CALIBRATE_HIGH_WATER + Local number of the point to calibrate high water + + + NODES_DISTANCES_DELWAQ_FILE + Nodes distances DELWAQ file + + + NUMBER_OF_DROGUES + Number of drogues + + + SOLVER_FOR_K_EPSILON_MODEL + Solver for K-Epsilon model + + + SECTIONS_OUTPUT_FILE + Sections output file + + + HARMONIC_CONSTANTS_FILE + Harmonic constants file + + + OPTION_FOR_CULVERTS + Option for culverts + + + ASCII_ATMOSPHERIC_DATA_FILE + ASCII atmospheric data file + + + INITIAL_ELEVATION + Initial elevation + + + ZERO + Zero + + + BREACHES_DATA_FILE + Breaches data file + + + OPTION_FOR_WIND + Option for wind + + + OPTION_OF_THE_HYDROSTATIC_RECONSTRUCTION + Option of the hydrostatic reconstruction + + + NUMBER_OF_TRACERS + Number of tracers + + + DIFFUSIVITY_DELWAQ_FILE + Diffusivity DELWAQ file + + + ADVECTION_OF_TRACERS + Advection of tracers + + + SOLVER_OPTION + Solver option + + + MATRIX_STORAGE + Matrix storage + + + COEFFICIENT_TO_CALIBRATE_TIDAL_RANGE + Coefficient to calibrate tidal range + + + BINARY_DATA_FILE_1 + Binary data file 1 + + + BINARY_DATA_FILE_2 + Binary data file 2 + + + CONTROL_OF_LIMITS + Control of limits + + + RECORD_NUMBER_FOR_RESTART + Record number for restart + + + NUMBER_OF_GAUSS_POINTS_FOR_WEAK_CHARACTERISTICS + Number of Gauss points for weak characteristics + + + COEFFICIENT_OF_WIND_INFLUENCE + Coefficient of wind influence + + + PRECONDITIONING_FOR_K_EPSILON_MODEL + Preconditioning for K-Epsilon model + + + PRODUCTION_COEFFICIENT_FOR_SECONDARY_CURRENTS + Production coefficient for secondary currents + + + MINIMUM_VALUE_OF_DEPTH + Minimum value of depth + + + ELEMENTS_MASKED_BY_USER + Elements masked by user + + + FRICTION_COEFFICIENT + Friction coefficient + + + PRESCRIBED_VELOCITIES + Prescribed velocities + + + NAMES_OF_TRACERS + Names of tracers + + + VELOCITY_DELWAQ_FILE + Velocity DELWAQ file + + + H_CLIPPING + H clipping + + + ZONE_NUMBER_IN_GEOGRAPHIC_SYSTEM + Zone number in geographic system + + + SUPG_OPTION + SUPG option + + + PARAMETER_ESTIMATION + Parameter estimation + + + CHECKING_THE_MESH + Checking the mesh + + + COMPATIBLE_COMPUTATION_OF_FLUXES + Compatible computation of fluxes + + + LIST_OF_FILES + List of files + + + NUMBER_OF_PRIVATE_ARRAYS + Number of private arrays + + + MAXIMUM_NUMBER_OF_FRICTION_DOMAINS + Maximum number of friction domains + + + DURATION + Duration + + + ACCURACY_OF_SPALART_ALLMARAS + Accuracy of spalart-allmaras + + + COEFFICIENT_1_FOR_LAW_OF_TRACERS_DEGRADATION + Coefficient 1 for law of tracers degradation + + + ACCURACY_OF_K + Accuracy of K + + + WATER_QUALITY_PROCESS + Water quality process + + + ADVECTION_OF_H + Advection of H + + + SCHEME_FOR_ADVECTION_OF_TRACERS + Scheme for advection of tracers + + + BINARY_DATA_FILE_2_FORMAT + Binary data file 2 format + + + COEFFICIENT_TO_CALIBRATE_SEA_LEVEL + Coefficient to calibrate sea level + + + OPTION_FOR_THE_DIFFUSION_OF_VELOCITIES + Option for the diffusion of velocities + + + INITIAL_GUESS_FOR_H + Initial guess for H + + + MASS_LUMPING_ON_TRACERS + Mass-lumping on tracers + + + OPTION_FOR_LIQUID_BOUNDARIES + Option for liquid boundaries + + + GEOMETRY_FILE + Geometry file + + + WAQTEL_STEERING_FILE + Waqtel steering file + + + MAXIMUM_NUMBER_OF_ITERATIONS_FOR_ADVECTION_SCHEMES + Maximum number of iterations for advection schemes + + + FLUXLINE_INPUT_FILE + Fluxline input file + + + RAIN_OR_EVAPORATION + Rain or evaporation + + + LAW_OF_BOTTOM_FRICTION + Law of bottom friction + + + MATRIX_VECTOR_PRODUCT + Matrix-vector product + + + ACCURACY_FOR_DIFFUSION_OF_TRACERS + Accuracy for diffusion of tracers + + + MEAN_TEMPERATURE + Mean temperature + + + PARTITIONING_TOOL + Partitioning tool + + + MAXIMUM_NUMBER_OF_BOUNDARIES + Maximum number of boundaries + + + OPTION_FOR_THE_SOLVER_FOR_K_EPSILON_MODEL + Option for the solver for K-Epsilon model + + + SPATIAL_PROJECTION_TYPE + Spatial projection type + + + THRESHOLD_FOR_NEGATIVE_DEPTHS + Threshold for negative depths + + + DEFAULT_PARALLEL_EXECUTABLE + Default parallel executable + + + INITIAL_GUESS_FOR_U + Initial guess for U + + + DIFFUSION_OF_TRACERS + Diffusion of tracers + + + DEFAULT_EXECUTABLE + Default executable + + + FORMATTED_RESULTS_FILE + Formatted results file + + + VALUES_OF_TRACERS_IN_THE_RAIN + Values of tracers in the rain + + + VERTICAL_STRUCTURES + Vertical structures + + + MAXIMUM_NUMBER_OF_ITERATIONS_FOR_K_AND_EPSILON + Maximum number of iterations for K and Epsilon + + + UPWIND_COEFFICIENTS + Upwind coefficients + + + FRICTION_DATA + Friction data + + + NUMBER_OF_WEIRS + Number of weirs + + + OPTION_FOR_TSUNAMI_GENERATION + Option for tsunami generation + + + VARIABLE_TIME_STEP + Variable time-step + + + WAVE_DRIVEN_CURRENTS + Wave driven currents + + + INFORMATION_ABOUT_K_EPSILON_MODEL + Information about K-Epsilon model + + + ZONES_FILE + Zones file + + + SPHERICAL_COORDINATES + Spherical coordinates + + + NORTH + North + + + TREATMENT_OF_THE_LINEAR_SYSTEM + Treatment of the linear system + + + REFERENCE_FILE + Reference file + + + DENSITY_EFFECTS + Density effects + + + ASCII_DATABASE_FOR_TIDE + ASCII database for tide + + + THRESHOLD_DEPTH_FOR_RECEDING_PROCEDURE + Threshold depth for receding procedure + + + OIL_SPILL_MODEL + Oil spill model + + + SOLVER + Solver + + + TIME_STEP_REDUCTION_FOR_K_EPSILON_MODEL + Time step reduction for K-Epsilon model + + + STOCHASTIC_DIFFUSION_MODEL + Stochastic diffusion model + + + ORIGINAL_DATE_OF_TIME + Original date of time + + + GEOGRAPHIC_SYSTEM + Geographic system + + + FORTRAN_FILE + Fortran file + + + PROPAGATION_OPTION + Propagation option + + + OIL_SPILL_STEERING_FILE + Oil spill steering file + + + TIDAL_DATA_BASE + Tidal data base + + + TIDAL_MODEL_FILE + Tidal model file + + + BREACH + Breach + + + TREATMENT_OF_NEGATIVE_DEPTHS + Treatment of negative depths + + + INITIAL_VALUES_OF_TRACERS + Initial values of tracers + + + diff --git a/Telemac/prefs.py b/Telemac/prefs.py index ee45ca9f..f1db1e19 100644 --- a/Telemac/prefs.py +++ b/Telemac/prefs.py @@ -16,6 +16,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +from __future__ import absolute_import code="TELEMAC" import sys, os if os.path.dirname(os.path.abspath(__file__)) not in sys.path : diff --git a/Telemac/prefs_TELEMAC.py b/Telemac/prefs_TELEMAC.py index 282485ad..6cf013e3 100644 --- a/Telemac/prefs_TELEMAC.py +++ b/Telemac/prefs_TELEMAC.py @@ -19,6 +19,7 @@ # # ====================================================================== +from __future__ import absolute_import import os,sys # repIni sert a localiser le fichier editeur.ini # Obligatoire @@ -46,3 +47,4 @@ catalogues=( ) mode_nouv_commande="figee" affiche = "ordre" +translatorFichier = os.path.join(repIni,'labelCataToIhm') diff --git a/Telemac/qtEficas_Telemac.py b/Telemac/qtEficas_Telemac.py index f49b9bcb..a8e58e02 100755 --- a/Telemac/qtEficas_Telemac.py +++ b/Telemac/qtEficas_Telemac.py @@ -24,6 +24,7 @@ # Modules Python # Modules Eficas +from __future__ import absolute_import import sys,os sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')) diff --git a/UiQT5/desWidgetMatrice.ui b/UiQT5/desWidgetMatrice.ui index 7d0a82a6..1874cede 100644 --- a/UiQT5/desWidgetMatrice.ui +++ b/UiQT5/desWidgetMatrice.ui @@ -6,8 +6,8 @@ 0 0 - 802 - 300 + 1067 + 770 @@ -17,7 +17,16 @@ 4 - + + 0 + + + 0 + + + 0 + + 0 @@ -115,8 +124,7 @@ - - + .. diff --git a/Validation/V_MACRO_ETAPE.py b/Validation/V_MACRO_ETAPE.py index c857024a..dcbbad6f 100644 --- a/Validation/V_MACRO_ETAPE.py +++ b/Validation/V_MACRO_ETAPE.py @@ -160,8 +160,8 @@ class MACRO_ETAPE(V_ETAPE.ETAPE): sys.exc_info()[2]) self.cr.fatal( 'Impossible d affecter un type au resultat\n%s' % ' '.join(l[2:])) return 0 - # on teste maintenant si la SD est r\351utilis\351e ou s'il faut la - # cr\351er + # on teste maintenant si la SD est reutilisee ou s'il faut la + # creer valid = 1 if self.reuse: # Un concept reutilise a ete specifie diff --git a/convert/convert_TELEMAC.py b/convert/convert_TELEMAC.py index f833c8db..ac524184 100644 --- a/convert/convert_TELEMAC.py +++ b/convert/convert_TELEMAC.py @@ -22,7 +22,7 @@ from __future__ import absolute_import import re from Extensions.i18n import tr - + from .convert_python import PythonParser import six from six.moves import range @@ -33,11 +33,11 @@ except NameError: pattern_comment_slash = re.compile(r"^\s*/") pattern_comment_slash_vide = re.compile(r"^\s*/\s*$") -pattern_comment_tiret = re.compile(r"^\s*/-*/$") +pattern_comment_tiret = re.compile(r"^\s*/-*/*$") pattern_eta = re.compile(r".*&ETA.*") pattern_fin = re.compile(r".*&FIN.*") -pattern_oui = re.compile(r"^\s*(oui|OUI|YES|yes|TRUE|VRAI)\s*$") -pattern_non = re.compile(r"^\s*(non|NON|NO|no|FALSE|FAUX)\s*$") +pattern_oui = re.compile(r"^\s*(oui|OUI|YES|yes|TRUE|true|vrai|VRAI)\s*$") +pattern_non = re.compile(r"^\s*(non|NON|NO|no|FALSE|false|faux|FAUX)\s*$") pattern_blanc = re.compile(r"^\s*$") pattern_listeVide = re.compile(r"^\s*'\s*'\s*$") pattern_commence_par_quote=re.compile(r'^\s*[\'"].*') @@ -57,18 +57,18 @@ pattern_texteVide = re.compile (r"^\s*(?P'')\s*(?P.*)$") pattern_ContientDouble=re.compile (r"^.*''.*$") -# le pattern texte reconnait -#nom1 nom 2 : ou = chaine entre ' +# le pattern texte reconnait +#nom1 nom 2 : ou = chaine entre ' # avec eventuellement des quotes au milieu par exemple # TITRE = 'TELEMAC 2D : GOUTTE D''EAU DANS UN BASSIN$' -# m.group("texte") va rendre 'TELEMAC 2D : GOUTTE D''EAU DANS UN BASSIN$' +# m.group("texte") va rendre 'TELEMAC 2D : GOUTTE D''EAU DANS UN BASSIN$' #Si le code n est pas Telemac try : #if 1 : from aideAuxConvertisseurs import ListeSupprimeCasToEficas - from enumDicoTelemac import TelemacdicoEn + from enum_Telemac2d_auto import TelemacdicoEn except : pass @@ -93,7 +93,7 @@ class TELEMACParser(PythonParser): """ def convert(self, outformat, appli=None): - + from Accas import A_BLOC, A_FACT, A_SIMP self.dicoCasToCata=appli.readercata.dicoCasToCata @@ -102,7 +102,7 @@ class TELEMACParser(PythonParser): self.Ordre_Des_Commandes=appli.readercata.Ordre_Des_Commandes if appli.langue=='fr' : - from enumDicoTelemac import DicoEnumCasFrToEnumCasEn + from enum_Telemac2d_into import DicoEnumCasFrToEnumCasEn for k in DicoEnumCasFrToEnumCasEn : TelemacdicoEn[k]=DicoEnumCasFrToEnumCasEn[k] @@ -123,7 +123,7 @@ class TELEMACParser(PythonParser): if pattern_fin.match(l) : continue if pattern_blanc.match(l) : continue - if not(pattern_comment_slash.match(l)): + if not(pattern_comment_slash.match(l)): l_lignes_texte.append(l) if trouveComment : if debut: dicoComment['debut']=texteComment @@ -131,14 +131,14 @@ class TELEMACParser(PythonParser): trouveComment = 0 texteComment="" if debut : debut = False - + if pattern_comment_slash.match(l): #if pattern_comment_slash_vide.match(l) : continue if pattern_comment_tiret.match(l) : continue texteComment+=l.replace ('/','',1) texteComment+='\n' trouveComment=1 - + if texteComment != "" : dicoComment['fin']= texteComment @@ -158,7 +158,7 @@ class TELEMACParser(PythonParser): if not(pattern_finit_par_virgule_ou_affect.match(ligne_traitee)): l_lignes.append(nouvelle_ligne) break - + for ligne in l_lignes : if pattern_comment_slash.match(ligne) : continue @@ -166,7 +166,7 @@ class TELEMACParser(PythonParser): #if pattern_eta.match(ligne) : continue #if pattern_fin.match(ligne) : continue #if pattern_blanc.match(ligne) : continue - + finLigne=ligne while finLigne != "" : @@ -180,16 +180,16 @@ class TELEMACParser(PythonParser): self.dictSimp[simpCas]=valeur continue - + m=pattern_ligne.match(finLigne) - if m == None : + if m == None : #print( "________________________________________________") print ('pb avec ****', finLigne , '**** dans ', ligne) #print( "________________________________________________") break - + simpCas=self.traiteIdent(m.group('ident')) - if not simpCas : + if not simpCas : finLigne=m.group('reste') continue @@ -201,7 +201,7 @@ class TELEMACParser(PythonParser): m=pattern_liste_texte.match(finLigne) elif pattern_texteQuote.match(finLigne) : m=pattern_texteQuote.match(finLigne) - elif pattern_flottant.match(finLigne) : + elif pattern_flottant.match(finLigne) : m=pattern_flottant.match(finLigne) elif pattern_texteVide.match(finLigne): m=pattern_texteVide.match(finLigne) @@ -213,12 +213,12 @@ class TELEMACParser(PythonParser): print ("non match") #print ("________________________________________________") break - + valeur=m.group('valeur') if pattern_blanc.match(valeur) : valeur=None - if pattern_flottant.match(finLigne) : + if pattern_flottant.match(finLigne) : valeur=re.sub("d","e",valeur) valeur=re.sub("D","E",valeur) @@ -231,11 +231,11 @@ class TELEMACParser(PythonParser): if ligne in dicoComment.keys(): dicoCommentSimp[simpCas]=dicoComment[ligne] - + if 'TITLE' not in self.dictSimp : import os #self.dictSimp['TITLE']=os.path.basename(self.filename) - + dicoParMC={} for simp in self.dictSimp: @@ -243,14 +243,15 @@ class TELEMACParser(PythonParser): for simp in self.dictSimp: if simp in ListeSupprimeCasToEficas: continue - if simp not in self.dicoInverse : + if simp not in self.dicoInverse : #print ( "************") print ("pb avec dans dicoInverse", simp,'------') + print("dicoInverse",sorted(self.dicoInverse.keys())) #print ("************") continue listeGenea=self.dicoInverse[simp] listeGeneaReverse=[] - for (u,v) in listeGenea : + for (u,v) in listeGenea : if isinstance(v,A_BLOC.BLOC): continue listeGeneaReverse.append(u) listeGeneaReverse.reverse() @@ -260,29 +261,29 @@ class TELEMACParser(PythonParser): MC=listeGeneaReverse[0] if MC in dicoCommentMC : dicoCommentMC[MC]+dicoCommentSimp[simp] else : dicoCommentMC[MC]=dicoCommentSimp[simp] - while i < len(listeGeneaReverse[0:-1]) : + while i < len(listeGeneaReverse[0:-1]) : mot=listeGeneaReverse[i] i=i+1 if mot not in dicoTravail: dicoTravail[mot]={} dicoTravail=dicoTravail[mot] dicoTravail[simp]=self.dictSimp[simp] - + self.textePy="" listeMC=self.tri(list(dicoParMC.keys())) for k in listeMC : - if k in dicoCommentMC : + if k in dicoCommentMC : commentaire="COMMENTAIRE("+repr(dicoCommentMC[k])+")\n" self.textePy+=commentaire self.textePy += str(k )+ "(" self.traiteMC(dicoParMC[k]) self.textePy += ");\n" - - - appli.listeTelemac=self.dictSimp - if 'debut' in dicoComment : + + + appli.listeTelemac=self.dictSimp + if 'debut' in dicoComment : commentaire="COMMENTAIRE("+repr(dicoComment['debut'])+")\n" self.textePy=commentaire+self.textePy - if 'fin' in dicoComment : + if 'fin' in dicoComment : commentaire="COMMENTAIRE("+repr(dicoComment['fin'])+")\n" self.textePy=self.textePy+commentaire @@ -298,7 +299,7 @@ class TELEMACParser(PythonParser): while ident[-1] == " " or ident[-1] == '\t' : ident=ident[0:-1] while ident[0] == " " or ident[0] == '\t' : ident=ident[1:] try : identCata=self.dicoCasToCata[ident] - except : + except : print ( "---> ", "pb mot clef pour", ident) identCata=None return identCata @@ -308,7 +309,7 @@ class TELEMACParser(PythonParser): from Accas import A_BLOC, A_FACT, A_SIMP for k in dico : valeur= dico[k] - if k not in self.dicoMC : kA=self.dicoFrancaisAnglais[k] + if k not in self.dicoMC : kA=self.dicoFrancaisAnglais[k] else : kA=k obj=self.dicoMC[kA] if isinstance(obj,A_FACT.FACT): self.convertFACT(obj,kA,valeur) @@ -319,7 +320,7 @@ class TELEMACParser(PythonParser): def convertFACT(self,obj,nom,valeur): # traitement LIQUID_BOUNDARIES - if nom in TELEMACParser.__dict__ : + if nom in TELEMACParser.__dict__ : TELEMACParser.__dict__[nom](self,) return self.textePy += nom + "=_F( " @@ -333,11 +334,11 @@ class TELEMACParser(PythonParser): def convertSIMP(self,obj,nom,valeur): #print 'in convertSIMP', nom,valeur - if nom in ("PRESCRIBED_FLOWRATES", "PRESCRIBED_VELOCITIES", "PRESCRIBED_ELEVATIONS" ): return - if obj.max==1 : - if hasattr(obj.type[0],'ntuple') : + #if nom in ("PRESCRIBED_FLOWRATES", "PRESCRIBED_VELOCITIES", "PRESCRIBED_ELEVATIONS" ): return + if obj.max==1 : + if hasattr(obj.type[0],'ntuple') : lval=[] - for v in valeur : + for v in valeur : try : v=eval(v,{}) except : pass lval.append(v) @@ -361,8 +362,8 @@ class TELEMACParser(PythonParser): try : valeur=eval(valeur,{}) except : pass - if nom in TelemacdicoEn: - try : + if nom in TelemacdicoEn: + try : valeur=TelemacdicoEn[nom][valeur] self.textePy += nom + "= '" + str(valeur) +"'," return @@ -384,9 +385,10 @@ class TELEMACParser(PythonParser): if valeur != None : print ("pb avec le type de ", obj.nom, obj.type, 'et la valeur ', valeur) - if 'Fichier' in obj.type or 'TXM' in obj.type or 'Repertoire' in obj.type : + if obj.nom == 'ASCII_DATABASE_FOR_TIDE': print (obj.nom,obj.type) + if 'Fichier' in obj.type or 'TXM' in obj.type or 'Repertoire' in obj.type or 'FichierOuRepertoire' in obj.type : valeur=str(valeur) - if valeur == "" or valeur == " " : + if valeur == "" or valeur == " " : self.textePy += nom + "= '" + str(valeur) +"' ," return while valeur[-1] == " " : valeur=valeur[0:-1] @@ -420,14 +422,14 @@ class TELEMACParser(PythonParser): # Attention : on attend une liste mais on a une seule valeur! try : oldValeur=eval(oldValeur,{}) except : pass - if nom in TelemacdicoEn : + if nom in TelemacdicoEn : v=TelemacdicoEn[nom][oldValeur] self.textePy += nom + "= ('" + str(v) +"',)," - else : + else : self.textePy += nom + "= (" + str(oldValeur) +",)," return - - + + if valeur == None : return newVal=[] for v in valeur : @@ -438,7 +440,7 @@ class TELEMACParser(PythonParser): except : pass newVal.append(v) self.textePy += nom + "=" + str(newVal) +"," - + def tri(self, listeIn): @@ -458,58 +460,58 @@ class TELEMACParser(PythonParser): listeOut.insert(i,k) return listeOut - def BOUNDARY_CONDITIONS(self): - texte_Boundaries="BOUNDARY_CONDITIONS=_F(LIQUID_BOUNDARIES=( " - if 'PRESCRIBED_ELEVATIONS' in self.dictSimp: - valeursPE=self.dictSimp["PRESCRIBED_ELEVATIONS"] - if not type(valeursPE)==list : valeursPE = (valeursPE,) - longueur=len(self.dictSimp["PRESCRIBED_ELEVATIONS"]) - else : valeursPE=None - if 'PRESCRIBED_FLOWRATES' in self.dictSimp: - valeursPF=self.dictSimp["PRESCRIBED_FLOWRATES"] - if not type(valeursPF)==list : valeursPF = (valeursPF,) - longueur=len(self.dictSimp["PRESCRIBED_FLOWRATES"]) - else : valeursPF=None - if 'PRESCRIBED_VELOCITIES' in self.dictSimp: - valeursPV=self.dictSimp["PRESCRIBED_VELOCITIES"] - if not type(valeursPV)==list : valeursPV = (valeursPV,) - longueur=len(self.dictSimp["PRESCRIBED_VELOCITIES"]) - else : valeursPV=None - - if valeursPE == None and valeursPF == None and valeursPV == None : - texte_Boundaries +="),\n" - return - - if valeursPE == None or valeursPF == None or valeursPV == None : - listNulle=[] - for i in range(longueur) : listNulle.append('0') - - - if valeursPE == None : valeursPE = listNulle - if valeursPF == None : valeursPF = listNulle - if valeursPV == None : valeursPV = listNulle - - - for e in range(len(valeursPE)): - if valeursPE[e] != "" or valeursPE[e] != "\n" : - if eval(valeursPE[e],{}) != 0 : - texte_Boundaries += "_F(BOUNDARY_TYPE = 'Prescribed Elevations',\n" - texte_Boundaries += "PRESCRIBED_ELEVATIONS = " + str(valeursPE[e]) + "),\n" - continue - - if valeursPF[e] != "" or valeursPF[e] != "\n" : - if eval(valeursPF[e],{}) != 0 : - texte_Boundaries += "_F(BOUNDARY_TYPE = 'Prescribed Flowrates',\n" - texte_Boundaries += "PRESCRIBED_FLOWRATES = " + str(valeursPF[e]) + "),\n" - continue - - if valeursPV[e] != "" or valeursPV[e] != "\n" : - if eval(valeursPV[e],{})!=0 : - texte_Boundaries += "_F( BOUNDARY_TYPE= 'Prescribed Velocity',\n" - texte_Boundaries += "PRESCRIBED_VELOCITIES = " + str(valeursPV[e]) + "),\n" - continue - print ("pb texte_Boundaries avec la valeur numero ", e) - - texte_Boundaries +="),)," - self.textePy += texte_Boundaries - +# def BOUNDARY_CONDITIONS(self): +# texte_Boundaries="BOUNDARY_CONDITIONS=_F(LIQUID_BOUNDARIES=( " +# if 'PRESCRIBED_ELEVATIONS' in self.dictSimp: +# valeursPE=self.dictSimp["PRESCRIBED_ELEVATIONS"] +# if not type(valeursPE)==list : valeursPE = (valeursPE,) +# longueur=len(self.dictSimp["PRESCRIBED_ELEVATIONS"]) +# else : valeursPE=None +# if 'PRESCRIBED_FLOWRATES' in self.dictSimp: +# valeursPF=self.dictSimp["PRESCRIBED_FLOWRATES"] +# if not type(valeursPF)==list : valeursPF = (valeursPF,) +# longueur=len(self.dictSimp["PRESCRIBED_FLOWRATES"]) +# else : valeursPF=None +# if 'PRESCRIBED_VELOCITIES' in self.dictSimp: +# valeursPV=self.dictSimp["PRESCRIBED_VELOCITIES"] +# if not type(valeursPV)==list : valeursPV = (valeursPV,) +# longueur=len(self.dictSimp["PRESCRIBED_VELOCITIES"]) +# else : valeursPV=None +# +# if valeursPE == None and valeursPF == None and valeursPV == None : +# texte_Boundaries +="),\n" +# return +# +# if valeursPE == None or valeursPF == None or valeursPV == None : +# listNulle=[] +# for i in range(longueur) : listNulle.append('0') +# +# +# if valeursPE == None : valeursPE = listNulle +# if valeursPF == None : valeursPF = listNulle +# if valeursPV == None : valeursPV = listNulle +# +# +# for e in range(len(valeursPE)): +# if valeursPE[e] != "" or valeursPE[e] != "\n" : +# if eval(valeursPE[e],{}) != 0 : +# texte_Boundaries += "_F(BOUNDARY_TYPE = 'Prescribed Elevations',\n" +# texte_Boundaries += "PRESCRIBED_ELEVATIONS = " + str(valeursPE[e]) + "),\n" +# continue +# +# if valeursPF[e] != "" or valeursPF[e] != "\n" : +# if eval(valeursPF[e],{}) != 0 : +# texte_Boundaries += "_F(BOUNDARY_TYPE = 'Prescribed Flowrates',\n" +# texte_Boundaries += "PRESCRIBED_FLOWRATES = " + str(valeursPF[e]) + "),\n" +# continue +# +# if valeursPV[e] != "" or valeursPV[e] != "\n" : +# if eval(valeursPV[e],{})!=0 : +# texte_Boundaries += "_F( BOUNDARY_TYPE= 'Prescribed Velocity',\n" +# texte_Boundaries += "PRESCRIBED_VELOCITIES = " + str(valeursPV[e]) + "),\n" +# continue +# print ("pb texte_Boundaries avec la valeur numero ", e) +# +# texte_Boundaries +="),)," +# self.textePy += texte_Boundaries +# diff --git a/generator/generator_TELEMAC.py b/generator/generator_TELEMAC.py index aa246773..2ad9f845 100644 --- a/generator/generator_TELEMAC.py +++ b/generator/generator_TELEMAC.py @@ -34,7 +34,7 @@ from .generator_python import PythonGenerator extensions=('.comm',) #if 1: try : - from enumDicoTelemac import TelemacdicoEn + from enum_Telemac2d_auto import TelemacdicoEn DicoEnumCasEnInverse={} for motClef in TelemacdicoEn: d={} @@ -65,14 +65,14 @@ def entryPoint(): class TELEMACGenerator(PythonGenerator): """ Ce generateur parcourt un objet de type JDC et produit - un texte au format eficas et + un texte au format eficas et un texte au format dictionnaire """ #---------------------------------------------------------------------------------------- def gener(self,obj,format='brut',config=None,appli=None,statut="Entier"): - + self.statut=statut self.langue=appli.langue self.initDico() @@ -95,9 +95,9 @@ class TELEMACGenerator(PythonGenerator): #---------------------------------------------------------------------------------------- # initialisations #---------------------------------------------------------------------------------------- - + def initDico(self) : - + self.PE=False self.FE=False self.VE=False @@ -113,7 +113,7 @@ class TELEMACGenerator(PythonGenerator): self.textVE = 'PRESCRIBED VELOCITIES :' self.nbTracers = 0 self.texteDico = "" - + @@ -125,7 +125,7 @@ class TELEMACGenerator(PythonGenerator): self.texteDico+='\n&ETA\n&FIN\n' if self.statut == 'Leger' : extension = ".Lcas" else : extension = ".cas" - fileDico = fn[:fn.rfind(".")] + extension + fileDico = fn[:fn.rfind(".")] + extension f = open( str(fileDico), 'w') f.write( self.texteDico ) f.close() @@ -136,15 +136,15 @@ class TELEMACGenerator(PythonGenerator): def writeLeger(self,fn,jdc,config,appli) : jdc_formate=self.gener(jdc,config=config,appli=appli,statut="Leger") - self.writeDefault(fn) + self.writeDefault(fn) #---------------------------------------------------------------------------------------- -# analyse de chaque noeud de l'arbre +# analyse de chaque noeud de l'arbre #---------------------------------------------------------------------------------------- def generPROC_ETAPE(self,obj): - if not self.commentaireAvant or self.texteCom.find(obj.nom) < 0: + if not self.commentaireAvant or self.texteCom.find(obj.nom) < 0: self.texteDico += '/------------------------------------------------------------------/\n' self.texteDico += '/\t\t\t'+obj.nom +'\n' self.texteDico += '/------------------------------------------------------------------/\n' @@ -152,43 +152,41 @@ class TELEMACGenerator(PythonGenerator): self.texteCom='' s=PythonGenerator.generPROC_ETAPE(self,obj) if obj.nom in TELEMACGenerator.__dict__ : TELEMACGenerator.__dict__[obj.nom](*(self,obj)) - + return s def generMCSIMP(self,obj) : """recuperation de l objet MCSIMP""" s=PythonGenerator.generMCSIMP(self,obj) - + # Attention pas sur --> ds certains cas non traite par MCFACT ? - # a reflechir avec Yoann + # a reflechir avec Yoann # ajouter le statut ? if self.statut == 'Leger' : if hasattr(obj.definition,'defaut') and (obj.definition.defaut == obj.valeur) and (obj.nom not in self.listeTelemac) : return s if hasattr(obj.definition,'defaut') and obj.definition.defaut != None and (type(obj.valeur) == tuple or type(obj.valeur) == list) and (tuple(obj.definition.defaut) == tuple(obj.valeur)) and (obj.nom not in self.listeTelemac) : return s - + #nomMajuscule=obj.nom.upper() - #nom=nomMajuscule.replace('_',' ') + #nom=nomMajuscule.replace('_',' ') #if nom in listeSupprime or s == "" : return s if s == "" : return s - - sTelemac=s[0:-1] if not( type(obj.valeur) in (tuple,list) ): - if obj.nom in DicoEnumCasEnInverse: + if obj.nom in DicoEnumCasEnInverse: try : sTelemac=str(DicoEnumCasEnInverse[obj.nom][obj.valeur]) - except : + except : if obj.valeur==None : sTelemac=obj.valeur else : print(("generMCSIMP Pb valeur avec ", obj.nom, obj.valeur)) if type(obj.valeur) in (tuple,list) : - if obj.nom in DicoEnumCasEnInverse: + if obj.nom in DicoEnumCasEnInverse: #sT = "'" sT='' for v in obj.valeur: try : sT +=str(DicoEnumCasEnInverse[obj.nom][v]) +";" - except : + except : if obj.definition.intoSug != [] : sT +=str(v) + ";" else : print(("generMCSIMP Pb Tuple avec ", obj.nom, v, obj.valeur)) #sTelemac=sT[0:-1]+"'" @@ -196,27 +194,29 @@ class TELEMACGenerator(PythonGenerator): else : sTelemac=sTelemac[0:-1] if sTelemac.find("'") > 0 : - sTelemac= sTelemac.replace (',',';\n ') + sTelemac= sTelemac.replace (',',';\n ') # on enleve le dernier ';' index=(sTelemac.rfind(";")) sTelemac=sTelemac[:index]+' '+sTelemac[index+1:] - if self.langue=='fr' : s1=str(sTelemac).replace('True','OUI') s2=s1.replace('False','NON') else : s1=str(sTelemac).replace('True','YES') s2=s1.replace('False','NO') - s3=s2.replace(',',';') - if s3 != "" and s3[0]=='(' : + if hasattr(obj.definition,'max'): + s3=s2.replace(',',';') + else: + s3=s2 + if s3 != "" and s3[0]=='(' : try : s3=s3[1:-1] # cas de liste vide except : s3 = ' ' - - + + # LIQUID_BOUNDARIES - if obj.nom in ('PRESCRIBED_FLOWRATES','PRESCRIBED_VELOCITIES','PRESCRIBED_ELEVATIONS') : - return s + #if obj.nom in ('PRESCRIBED_FLOWRATES','PRESCRIBED_VELOCITIES','PRESCRIBED_ELEVATIONS') : + # return s if obj.nom not in self.dicoCataToCas : if obj.nom == 'Consigne' : return "" @@ -224,12 +224,15 @@ class TELEMACGenerator(PythonGenerator): nom=self.dicoCataToCas[obj.nom] if nom in ["VARIABLES FOR GRAPHIC PRINTOUTS", "VARIABLES POUR LES SORTIES GRAPHIQUES", "VARIABLES TO BE PRINTED","VARIABLES A IMPRIMER"] : - if s3 != 'None' : + if s3 != 'None': s3=s3.replace(';',',') s3="'"+ s3 +"'" - if s3 == "" or s3 == " " : s3 = "None" + else: + s3 = "''" + #print("s3+",s3) + if s3 == "" or s3 == " " : s3 = " " ligne=nom+ " : " + s3 + "\n" - if len(ligne) > 72 : ligne=self.redecoupeLigne(nom,s3) + if len(ligne) > 72 : ligne=self.redecoupeLigne(nom,s3) self.texteDico+=ligne def generMCFACT(self,obj): @@ -237,45 +240,63 @@ class TELEMACGenerator(PythonGenerator): """ s=PythonGenerator.generMCFACT(self,obj) if obj.nom in TELEMACGenerator.__dict__ : TELEMACGenerator.__dict__[obj.nom](self,obj) - + return s - - def LIQUID_BOUNDARIES(self,obj): - print ('jkljklj') - if 'BOUNDARY_TYPE' in obj.liste_mc_presents() : - objForme=obj.get_child('BOUNDARY_TYPE') - valForme=objForme.valeur - if valForme == None : return - - nomBloc='b_'+valForme.split(" ")[1] - if nomBloc in obj.liste_mc_presents() : - objBloc=obj.get_child(nomBloc) - objValeur=objBloc.get_child(objBloc.liste_mc_presents()[0]) - valeur=objValeur.valeur - if valeur== None : valeur="0." - if valForme == 'Prescribed Elevations' : - self.PE=True - self.textPE += str(valeur) +"; " - else : self.textPE += "0.; " - if valForme == 'Prescribed Flowrates' : - self.FE=True - self.textFE += str(valeur) +"; " - else : self.textFE += "0.; " - if valForme == 'Prescribed Velocity' : - self.VE=True - self.textVE += str(valeur) +"; " - else : self.textVE += "0.; " - - def BOUNDARY_CONDITIONS(self,obj): - # sans '; ' - if self.FE : self.texteDico += self.textFE[0:-2]+'\n' - if self.PE : self.texteDico += self.textPE[0:-2]+'\n' - if self.VE : self.texteDico += self.textVE[0:-2]+'\n' + +# def LIQUID_BOUNDARIES(self,obj): +# print ('jkljklj') +# if 'BOUNDARY_TYPE' in obj.liste_mc_presents() : +# objForme=obj.get_child('BOUNDARY_TYPE') +# valForme=objForme.valeur +# if valForme == None : return + + +# if valForme == 'Prescribed Unknown': +# nomBloc='b_'+valForme.split(" ")[1] +# if nomBloc in obj.liste_mc_presents() : +# objBloc=obj.get_child(nomBloc) +# valeurPE = objValeur=objBloc.get_child(objBloc.liste_mc_presents()[0]).valeur +# valeurFE = objValeur=objBloc.get_child(objBloc.liste_mc_presents()[1]).valeur +# valeurVE = objValeur=objBloc.get_child(objBloc.liste_mc_presents()[2]).valeur +# if valeurPE== None : valeurPE="0." +# if valeurFE== None : valeurPE="0." +# if valeurVE== None : valeurPE="0." +# self.PE=True +# self.textPE += str(valeurPE) +"; " +# self.FE=True +# self.textFE += str(valeurFE) +"; " +# self.VE=True +# self.textVE += str(valeurVE) +"; " +# else: +# nomBloc='b_'+valForme.split(" ")[1] +# if nomBloc in obj.liste_mc_presents() : +# objBloc=obj.get_child(nomBloc) +# objValeur=objBloc.get_child(objBloc.liste_mc_presents()[0]) +# valeur=objValeur.valeur +# if valeur== None : valeur="0." +# if valForme == 'Prescribed Elevations' : +# self.PE=True +# self.textPE += str(valeur) +"; " +# else : self.textPE += "0.; " +# if valForme == 'Prescribed Flowrates' : +# self.FE=True +# self.textFE += str(valeur) +"; " +# else : self.textFE += "0.; " +# if valForme == 'Prescribed Velocity' : +# self.VE=True +# self.textVE += str(valeur) +"; " +# else : self.textVE += "0.; " + +# def BOUNDARY_CONDITIONS(self,obj): +# # sans '; ' +# if self.FE : self.texteDico += self.textFE[0:-2]+'\n' +# if self.PE : self.texteDico += self.textPE[0:-2]+'\n' +# if self.VE : self.texteDico += self.textVE[0:-2]+'\n' def TRACERS(self,obj): if self.nbTracers != 0 : self.texteDico += 'NUMBER_OF_TRACERS : '+str(self.nbTracers) + '\n' - + def NAME_OF_TRACER(self,obj): print((dir(obj) )) @@ -283,7 +304,7 @@ class TELEMACGenerator(PythonGenerator): def Validation(self,obj): self.texteDico += "VALIDATION : True \n" - + def Date_De_L_Origine_Des_Temps (self,obj): an=obj.get_child('Year').valeur mois=obj.get_child('Month').valeur @@ -319,15 +340,15 @@ class TELEMACGenerator(PythonGenerator): self.texteDico += "TYPE OF ADVECTION = "+ str(listeAdvection) + "\n" self.texteDico += "SUPG OPTION = "+ str(listeSupg) + "\n" self.texteDico += "UPWIND COEFFICIENTS = "+ str(listeUpwind) + "\n" - + def chercheChildren(self,obj): for c in obj.liste_mc_presents(): objc=obj.get_child(c) if hasattr(objc,'liste_mc_presents') and objc.liste_mc_presents() != [] : self.chercheChildren(objc) else : self.listeMCAdvection.append(objc) - - + + def redecoupeLigne(self,nom,valeur) : text=nom+ " : \n" valeur=valeur -- 2.39.2