From: pascale.noyret Date: Mon, 2 May 2016 09:21:45 +0000 (+0200) Subject: sauvegarde du 2 mai X-Git-Tag: V8_1_0~32 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a81d47e98453e85b0ec5a26dc4cb5223fe0d728c;p=tools%2Feficas.git sauvegarde du 2 mai --- diff --git a/InterfaceQT4/editor.py b/InterfaceQT4/editor.py index 247ac6e6..aeee88c6 100755 --- a/InterfaceQT4/editor.py +++ b/InterfaceQT4/editor.py @@ -1166,6 +1166,8 @@ class JDCEditor(Ui_baseWidget,QWidget): if self.jdc.isvalid() != 0 and hasattr(self.generator, "writeDefault"): self.generator.writeDefault(fn) + if self.code=="TELEMAC" and hasattr(self.generator, "writeDefault"): + self.generator.writeDefault(fn) if self.salome : self.appliEficas.addJdcInSalome( self.fichier) diff --git a/Telemac/Telemac_Cata.py b/Telemac/Telemac_Cata.py index 6dc02cc4..dd3b1f07 100644 --- a/Telemac/Telemac_Cata.py +++ b/Telemac/Telemac_Cata.py @@ -204,7 +204,7 @@ The data in this file shall be read on channel 25.',), # ------------------------------------ Initial_Conditions = SIMP(statut = 'o',typ = 'TXM', # ------------------------------------ - into = ['Zero elevation','Constant elevation','Zero depth','Constant depth','Special','TPXO satellite altimetry'], + into = ['Zero elevation','Constant elevation','Zero depth','Constant depth','Special','Tpxo satellite altimetry'], defaut = 'Zero elevation', fr = "Permet de definir les conditions initiales sur les hauteurs d'eau. Les valeurs possibles sont :\n\ - COTE NULLE. Initialise la cote de surface libre a 0. \nLes hauteurs d'eau initiales sont alors retrouvees en faisant la difference entre les cotes de surface libre et du fond. \n\ @@ -269,7 +269,8 @@ The data in this file shall be read on channel 25.',), # ------------------------------------ - Computation_Continued = SIMP( statut = 'o',typ = bool,defaut = False,position = "global_jdc"), + #Computation_Continued = SIMP( statut = 'o',typ = bool,defaut = False,position = "global_jdc"), + Computation_Continued = SIMP( statut = 'o',typ = bool,defaut = False), # ------------------------------------ # ------------------------------------ @@ -550,7 +551,7 @@ BOUNDARY_CONDITIONS = PROC(nom = "BOUNDARY_CONDITIONS",op = None, # ------------------------------------ # ------------------------------------ - Options = SIMP(statut = 'f',typ = 'I', + Option_For_Liquid_Boundaries = SIMP(statut = 'f',typ = 'I', # ------------------------------------ into = ['Classical boundary conditions','Thompson method based on characteristics'], fr = 'On donne 1 entier par frontiere liquide', @@ -804,7 +805,7 @@ the product of relevant options shall be made.', # soizic. choix 3 et 4 et 13 et 14 # Attention recalcul de Type_Of_Advection # ------------------------------------ - Advection_Of_U_And_V = SIMP(statut = 'o',typ = bool, defaut = True, + Advection_Of_U_And_V = SIMP(statut = 'f',typ = bool, defaut = True, # ------------------------------------ fr = 'Prise en compte ou non de la convection de U et V.', ang = 'The advection of U and V is taken into account or ignored.'), @@ -816,9 +817,9 @@ the product of relevant options shall be made.', Type_Of_Advection_U_And_V = SIMP(statut = 'o',typ = 'TXM',position = "global", # ------------------------------------ into = ["Characteristics", "SUPG", "Conservative N-scheme", 'Conservative N-scheme',\ - 'Conservative PSI-scheme', 'Non conservative PSI scheme', 'Implicit non conservative N scheme',\ - 'Edge-based N-scheme'], - defaut = "Characteristics", ), + 'Conservative PSI-scheme', 'Non conservative PSI-scheme', 'Implicit non conservative N-scheme',\ + 'Edge-based N-scheme'], + defaut = "Characteristics", ), # ------------------------------------ b_upwind = BLOC(condition = "Type_Of_Advection_U_And_V == 'SUPG'", @@ -846,10 +847,10 @@ the product of relevant options shall be made.', # ------------------------------------ Type_Of_Advection_H = SIMP(statut = 'o',typ = 'TXM',position = "global", # ------------------------------------ - into = ["characteristics", "SUPG", "conservative N-scheme", 'conservative N-scheme',\ - 'conservative PSI-scheme', 'non conservative PSI scheme', 'implicit non conservative N scheme',\ - 'edge-based N-scheme'], - defaut = "conservative PSI-scheme",), + into = ["Characteristics", "SUPG", "Conservative N-scheme", 'Conservative N-scheme',\ + 'Conservative PSI-scheme', 'Non conservative PSI-scheme', 'Implicit non conservative N-scheme',\ + 'Edge-based N-scheme'], + defaut = "Conservative PSI-scheme",), # ------------------------------------ b_upwind_H = BLOC(condition = "Type_Of_Advection_H == 'SUPG'", # ------------------------------------ @@ -877,14 +878,14 @@ the product of relevant options shall be made.', Type_Of_Advection_K_And_Epsilon = SIMP(statut = 'o',typ = 'TXM',position = "global", # ------------------------------------ into = ["Characteristics", "SUPG", "Conservative N-scheme", 'Conservative N-scheme',\ - 'Conservative PSI-scheme', 'Non conservative PSI scheme', 'Implicit non conservative N scheme',\ + 'Conservative PSI-scheme', 'Non conservative PSI-scheme', 'Implicit non conservative N-scheme',\ 'Edge-based N-scheme'], defaut = "Characteristics",), # ------------------------------------ b_upwind_k = BLOC(condition = "Type_Of_Advection_K_And_Epsilon == 'SUPG'", # ------------------------------------ # ------------------------------------ - Supg_Option_Tracers = SIMP(statut = 'o', defaut = 'Modified SUPG', typ = 'TXM', + Supg_Option_K_And_Epsilon = SIMP(statut = 'o', defaut = 'Modified SUPG', typ = 'TXM', # ------------------------------------ into = ['No upwinding', 'Classical SUPG','Modified SUPG']), @@ -907,13 +908,14 @@ the product of relevant options shall be made.', Type_Of_Advection_Tracers = SIMP(statut = 'o',typ = 'TXM',position = "global", # ------------------------------------ into = ["Characteristics", "SUPG", "Conservative N-scheme", 'Conservative N-scheme',\ - 'Conservative PSI-scheme', 'Non conservative PSI scheme', 'Implicit non conservative N scheme',\ - 'Edge-based N-scheme'],), + 'Conservative PSI-scheme', 'Non conservative PSI-scheme', 'Implicit non conservative N-scheme',\ + 'Edge-based N-scheme'], + ), # ------------------------------------ b_upwind_Tracers = BLOC(condition = "Type_Of_Advection_Tracers == 'SUPG'", # ------------------------------------ # ------------------------------------ - Supg_Option_K_And_Epsilon = SIMP(statut = 'o', defaut = 'Modified SUPG', typ = 'TXM', + Supg_Option_Tracers = SIMP(statut = 'o', defaut = 'Modified SUPG', typ = 'TXM', # ------------------------------------ into = ['No upwinding', 'Classical SUPG','Modified SUPG']), @@ -1097,8 +1099,8 @@ Thus, the convergence can be speeded up when the system is being solved.',), # ------------------------------------ Option_For_The_Diffusion_Of_Velocities = SIMP( statut='o',typ='TXM', # ------------------------------------ - defaut=1 , - into=['Diffusion in the form div( nu grad(U))','Diffusion in the form 1/h div ( h nu grad(U) )'], + defaut='Diffusion in the form div( nu grad(U))' , + into=['Diffusion in the form div( nu grad(U))','Diffusion in the form 1/h div ( h nu grad(U))'], fr = '1: Diffusion de la forme div( nu grad(U) ) 2: Diffusion de la forme 1/h div ( h nu grad(U) )', ang= '1: Diffusion in the form div( nu grad(U) ) 2: Diffusion in the form 1/h div ( h nu grad(U) )',), @@ -1108,9 +1110,24 @@ Thus, the convergence can be speeded up when the system is being solved.',), Discretization_Implicitation = FACT(statut = 'f', # ------------------------------------ -# ------------------------------------ - Discretizations_In_Space = SIMP(statut = 'o',typ = 'TXM', -# ------------------------------------ +# ------------------------------------------------------------------ + Discretizations_In_Space_U_And_V = SIMP(statut = 'o',typ = 'TXM', +# ------------------------------------------------------------------ + into = ["Linear", "Quasi-bubble", "Quadratic"], + defaut = "Linear",), +# ------------------------------------------------------------------ + Discretizations_In_Space_H = SIMP(statut = 'o',typ = 'TXM', +# ------------------------------------------------------------------ + into = ["Linear", "Quasi-bubble", "Quadratic"], + defaut = "Linear",), +# ------------------------------------------------------------------ + Discretizations_In_Space_K_And_Epsilon = SIMP(statut = 'f',typ = 'TXM', +# ------------------------------------------------------------------ + into = ["Linear", "Quasi-bubble", "Quadratic"], + defaut = "Linear",), +# ------------------------------------------------------------------ + Discretizations_In_Space_Tracers = SIMP(statut = 'f',typ = 'TXM', +# ------------------------------------------------------------------ into = ["Linear", "Quasi-bubble", "Quadratic"], defaut = "Linear",), @@ -1706,14 +1723,14 @@ OUTPUT_FILES = PROC(nom = "OUTPUT_FILES",op = None, # ------------------------------------ Variables_For_Graphic_Printouts = SIMP(statut = 'o',max = "**", typ = 'TXM', # ------------------------------------ - 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)", "Courant number ", "Supplementary variable N ", - "Supplementary variable O ", "Supplementary variable R ", "Supplementary variable Z ", "Maximum elevation", - "Time of maximum elevation ", "Maximum velocity", "Time of maximum velocity", "Friction velocity "], + 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)", "Courant number", "Supplementary variable N", + "Supplementary variable O", "Supplementary variable R", "Supplementary variable Z", "Maximum elevation", + "Time of maximum elevation", "Maximum velocity", "Time of maximum velocity", "Friction velocity"], ), #homo="SansOrdreNiDoublon"), @@ -1772,7 +1789,7 @@ OUTPUT_FILES = PROC(nom = "OUTPUT_FILES",op = None, "Tracer", "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)", "Courant number", + "Friction coefficient", "Drift along x (m)", "Drift along y (m)", "Courant number", "Supplementary variable N", "Supplementary variable O", "Supplementary variable R", "Supplementary variable Z"] ,homo="SansOrdreNiDoublon"), @@ -2032,7 +2049,8 @@ is in particular used to compute the Coriolis force. In cartesian coordinates, C # ------------------------------------ Spatial_Projection_Type = SIMP(statut = 'o',typ = 'TXM', # ------------------------------------ - into = ["Mercator","Latitude longitude"]), + defaut="Cartesian, not georeferenced", + into = ["Cartesian, not georeferenced","Mercator","Latitude longitude"]), ), # fin b_Spher # ------------------------------------ @@ -2279,6 +2297,7 @@ Not recommended for use.',), into = ("Diagonal", "No preconditioning", "Diagonal condensed", "Crout", "Diagonal and crout", "Diagonal condensed and crout"), fr = 'Permet de preconditionner le systeme relatif au modele k-epsilon', ang = 'Preconditioning of the linear system in the diffusion step of the k-epsilon model.', + homo="SansOrdreNiDoublon", ), # ----------------------------------------------------------------------- Information_About_K_Epsilon_Model = SIMP(statut = 'o',typ = bool,defaut = True, @@ -2314,6 +2333,7 @@ PARTICLE_TRANSPORT = PROC(nom = "PARTICLE_TRANSPORT",op = None, # ----------------------------------------------------------------------- into = ["Sphere", "Iridaea flaccida (close to ulva)", "Pelvetiopsis limitata", "Gigartina leptorhynchos"], defaut = "Sphere", + homo="SansOrdreNiDoublon", fr = 'Type des algues. Pour sphere les algues seront modelisees comme des spheres, pour les autres choix voir Gaylord et al.(1994)', ang = 'Algae type. For sphere, the algae particles will be modeled as spheres, for the other choices see Gaylord et al.(1994)',), @@ -2480,10 +2500,12 @@ TRACERS = PROC(nom = "TRACERS",op = None, # ----------------------------------------------------------------------- Solver_For_Diffusion_Of_Tracers = SIMP( statut='o',typ='TXM', # ----------------------------------------------------------------------- - defaut='1="conjugate gradient"' , - into =('1="conjugate gradient"', '2="conjugate residual"', '3="conjugate gradient on a normal equation"', - '4="minimum error"', '5="squared conjugate gradient"', '6="cgstab"', '7="gmres "', '8="direct"'),), + defaut='Conjugate gradient' , + into =('Conjugate gradient', 'Conjugate residual', 'Conjugate gradient on a normal equation', + 'Minimum error"', 'Squared conjugate gradient', 'CGSTAB', 'GMRES', 'Direct'), + ), +# Ne faut-il pas un bloc? # ----------------------------------------------------------------------- Solver_Option_For_Tracers_Diffusion = SIMP( statut='o',typ='I', # ----------------------------------------------------------------------- @@ -2494,8 +2516,8 @@ TRACERS = PROC(nom = "TRACERS",op = None, # ----------------------------------------------------------------------- Preconditioning_For_Diffusion_Of_Tracers = SIMP( statut='o',typ='TXM', # ----------------------------------------------------------------------- - defaut='2="diagonal"' , - into =('2="diagonal"', '0="no preconditioning "', '3="diagonal condensed"', '7="crout"', '14="diagonal and crout"', '21="diagonal condensed and crout"'), + defaut='diagonal' , + into =('diagonal', 'no preconditioning', 'diagonal condensed', 'crout', 'diagonal and crout', 'diagonal condensed and crout'), fr = 'Permet de preconditionner le systeme relatif au traceur. Memes definition et possibilites que pour le mot-cle PRECONDITIONNEMENT.', ang= 'Preconditioning of the linear system in the tracer diffusion step. Same definition and possibilities as for the keyword PRECONDITIONING', ), @@ -2578,17 +2600,17 @@ TRACERS = PROC(nom = "TRACERS",op = None, # ------------------------------------ Scheme_For_Advection_Of_Tracers = SIMP( statut='o',typ='TXM', # ------------------------------------ - defaut="CHARACTERISTICS" , - into =("NO ADVECTION", "CHARACTERISTICS", "EXPLICIT + SUPG", "EXPLICIT LEO POSTMA", "EXPLICIT + MURD SCHEME N", - "EXPLICIT + MURD SCHEME PSI", "LEO POSTMA FOR TIDAL FLATS", "N-SCHEME FOR TIDAL FLATS"), + defaut="Characteristics" , + into =("No advection", "Characteristics", "Explicit + SUPG", "Explicit leo postma", "explicit + murd scheme-N", + "explicit + murd scheme-PSI", "Leo postma for tidal flats", "N-scheme for tidal flats"), fr = 'Choix du schema de convection pour les traceurs, remplace FORME DE LA CONVECTION', ang= 'Choice of the advection scheme for the tracers, replaces TYPE OF ADVECTION',), # ------------------------------------ Scheme_Option_For_Advection_Of_Tracers = SIMP( statut='o',typ='TXM', # ------------------------------------ - defaut='explicit' , - into=['explicit','predictor-corrector for tracers'], + defaut='Explicit' , + into=['Explicit','Predictor-corrector for tracers'], fr = 'Si present remplace et a priorite sur : OPTION POUR LES CARACTERISTIQUES OPTION DE SUPG Si schema PSI : 1=explicite 2=predicteur-correcteur pour les traceurs', ang= 'If present replaces and has priority over: OPTION FOR CHARACTERISTICS SUPG OPTION IF PSI SCHEME: 1=explicit 2=predictor-corrector for tracers',), @@ -2611,13 +2633,13 @@ TRACERS = PROC(nom = "TRACERS",op = None, # ----------------------------------------------------------------------- Law1_Of_Tracers_Degradation = SIMP( statut='o',typ='TXM', # ----------------------------------------------------------------------- - into=["NO DEGRADATION","F(T90) LAW"], - defaut="NO DEGRADATION", + into=["No degradation","F(T90) law"], + defaut="No degradation", fr = 'Prise en compte dune loi de decroissance des traceurs', ang= 'Take in account a law for tracers decrease',), # ----------------------------------------------------------------------- - b_Law1 = BLOC(condition = 'Law1_Of_Tracers_Degradation == "F(T90) LAW"', + b_Law1 = BLOC(condition = 'Law1_Of_Tracers_Degradation == "F(T90) law"', # ----------------------------------------------------------------------- # ----------------------------------------------------------------------- Coefficient_1_For_Law_Of_Tracers_Degradation = SIMP( statut='o',typ='R', @@ -2629,13 +2651,13 @@ TRACERS = PROC(nom = "TRACERS",op = None, # ----------------------------------------------------------------------- Law2_Of_Tracers_Degradation = SIMP( statut='o',typ='TXM', # ----------------------------------------------------------------------- - into=["NO DEGRADATION","F(T90) LAW"], - defaut="NO DEGRADATION", + into=["No degradation","F(T90) law"], + defaut="No degradation", fr = 'Prise en compte dune loi de decroissance des traceurs', ang= 'Take in account a law for tracers decrease',), # ----------------------------------------------------------------------- - b_Law2 = BLOC(condition = 'Law2_Of_Tracers_Degradation == "F(T90) LAW"', + b_Law2 = BLOC(condition = 'Law2_Of_Tracers_Degradation == "F(T90) law"', # ----------------------------------------------------------------------- # ----------------------------------------------------------------------- Coefficient_2_For_Law_Of_Tracers_Degradation = SIMP( statut='o',typ='R', diff --git a/Telemac/aideAuxConvertisseurs.py b/Telemac/aideAuxConvertisseurs.py index dde804f9..c2034baf 100644 --- a/Telemac/aideAuxConvertisseurs.py +++ b/Telemac/aideAuxConvertisseurs.py @@ -20,23 +20,26 @@ """Ce module contient le plugin generateur de fichier au format Code_Carmel3D pour EFICAS. """ -listeSupprime = ( 'DAY', 'MONTH', 'YEAR', 'HOUR', 'MINUTE', 'SECOND', 'CONSIGNE' - 'LIMIT VALUES H', 'LIMIT VALUES U', 'LIMIT VALUES V', 'LIMIT VALUES T', - 'SISYPHE', 'TOMAWAC', 'DELWAQ', - 'ADVECTION U AND V', 'ADVECTION H', - 'ADVECTION TRACERS', 'ADVECTION K AND EPSILON', - 'TOLERANCE FOR H', 'TOLERANCE FOR U', 'TOLERANCE FOR V', 'TOLERANCE FOR COUT', - 'SUPG OPTION U AND V', 'SUPG OPTION H', 'SUPG OPTION TRACERS', 'SUPG OPTION K AND EPSILON', - 'UPWIND COEFFICIENTS Of U AND V', 'UPWIND COEFFICIENTS OF H', -) - +listeSupprime = ( + 'CONSIGNE', 'TYPE CONDITION', + 'PRESCRIBED ELEVATIONS', 'PRESCRIBED FLOWRATES', 'PRESCRIBED VELOCITY', + 'ADVECTION U AND V', 'ADVECTION H', 'ADVECTION TRACERS', 'ADVECTION K AND EPSILON', + 'TYPE OF ADVECTION U AND V', 'TYPE OF ADVECTION H', + 'TYPE OF ADVECTION TRACERS', 'TYPE OF ADVECTION K AND EPSILON', + 'SUPG OPTION U AND V', 'SUPG OPTION H', 'SUPG OPTION TRACERS', 'SUPG OPTION K AND EPSILON', + 'UPWIND COEFFICIENTS Of U AND V', 'UPWIND COEFFICIENTS OF H', + 'UPWIND COEFFICIENTS TRACERS', 'UPWIND COEFFICIENTS K AND EPSILON', + 'DAY', 'MONTH', 'YEAR', 'HOUR', 'MINUTE', 'SECOND', +) + +# 'LIMIT VALUES H', 'LIMIT VALUES U', 'LIMIT VALUES V', 'LIMIT VALUES T', +# 'SISYPHE', 'TOMAWAC', 'DELWAQ', +# 'TOLERANCE FOR H', 'TOLERANCE FOR U', 'TOLERANCE FOR V', 'TOLERANCE FOR COUT', +# DicoAglomere= { 'LIMIT VALUES' : ( 'Limit_Values_H', 'Limit_Values_U', 'Limit_Values_V', 'Limit_Values_T'), 'COUPLING WITH' : ( 'Sisyphe', 'Tomawac', 'Delwaq'), -'TYPE OF ADVECTION' : ( 'Advection_U_And_V', 'Advection_H', 'Advection_Tracers','Advection_K_And_Epsilon'), 'TOLERANCE' : ( 'Tolerance_For_H', 'Tolerance_For_U', 'Tolerance_For_V', 'Tolerance_For_cout',), -'SUPG OPTION' : ( 'Supg_Option_U_And_V', 'Supg_Option_H', 'Supg_Option_Tracers', 'Supg_Option_K_And_Epsilon',), -'UPWIND COEFFICIENTS' : ( 'Upwind_Coefficients_Of_U_And_V', 'Upwind_Coefficients_Of_H', ), } DicoEficasToCas= { diff --git a/Telemac/enumDicoTelemac.py b/Telemac/enumDicoTelemac.py index 50b3ab80..509ac1b8 100644 --- a/Telemac/enumDicoTelemac.py +++ b/Telemac/enumDicoTelemac.py @@ -1,10 +1,11 @@ DicoEnumCasEn={ -'PSI SCHEME OPTION' : { +'Psi_Scheme_Option' : { 1 : "Explicit", 2 : "Predictor-corrector" }, -'TYPE OF ADVECTION' : { +# on regroupe les enum quand on separe +'Type_Of_Advection' : { 1 : "Characteristics", 2 : "SUPG", 3 : "Conservative N-scheme", @@ -15,32 +16,33 @@ 13 : "Edge-based N-scheme", 14 : "Edge-based N-scheme" }, + -'GEOMETRY FILE FORMAT' : { +'Geometry_File_Format' : { 'SERAFIN': 'Serafin', 'MED': 'MED', 'SERAFIND': 'SerafinD', }, -'PREVIOUS COMPUTATION FILE FORMAT' : { +'Previous_Computation_File_Format' : { 'SERAFIN': 'Serafin', 'MED': 'MED', 'SERAFIND': 'SerafinD', }, -'REFERENCE FILE FORMAT' : { +'Reference_File_Format' : { 'SERAFIN': 'Serafin', 'MED': 'MED', 'SERAFIND': 'SerafinD', }, -'RESULTS FILE FORMAT' : { +'Results_File_Format' : { 'SERAFIN': 'Serafin', 'MED': 'MED', 'SERAFIND': 'SerafinD', }, -'PRECONDITIONING' : { +'Preconditioning' : { 0 : "No preconditioning", 2 : "Diagonal", 3 : "Diagonal condensee", @@ -50,13 +52,13 @@ 21 : "Diagonal condensed and Crout" }, -'INITIAL GUESS FOR H' : { +'Initial_Guess_For_H' : { 1 : "Previous", 0 : "Zero", 2 : "Extrapolation" }, -'LAW OF BOTTOM FRICTION' : { +'Law_Of_Bottom_Friction' : { 0 : "No friction", 1 : "Haaland", 2 : "Chezy", @@ -65,7 +67,7 @@ 5 : "Nikuradse" }, -'SOLVER FOR DIFFUSION OF TRACERS' : { +'Solver_For_Diffusion_Of_Tracers' : { 1 : "Conjugate gradient", 2 : "Conjugate residual", 3 : "Conjugate gradient on a normal equation", @@ -76,7 +78,7 @@ 8 : "Direct" }, -'SOLVER' : { +'Solver' : { 3 : "Conjugate gradient on a normal equation", 1 : "Conjugate gradient", 2 : "Conjugate residual", @@ -86,7 +88,7 @@ 8 : "Direct" }, -'PRECONDITIONING FOR DIFFUSION OF TRACERS' : { +'Preconditioning_For_Diffusion_Of_Tracers' : { 2 : "Diagonal", 0 : "No preconditioning", 3 : "Diagonal condensed", @@ -95,7 +97,7 @@ 21 : "Diagonal condensed and Crout" }, -'SOLVER FOR K-EPSILON MODEL' : { +'Solver_For_K_Epsilon_Model' : { 1 : "Conjugate gradient", 2 : "Conjugate residuals", 3 : "Conjugate gradient on normal equation", @@ -106,7 +108,7 @@ 8 : "Direct" }, -'PRECONDITIONING FOR K-EPSILON MODEL' : { +'Preconditioning_For_K_Epsilon_Model' : { 2 : "Diagonal", 0 : "No preconditioning", 3 : "Diagonal condensed", @@ -115,12 +117,12 @@ 21 : "Diagonal condensed and Crout" }, -'TURBULENCE MODEL FOR SOLID BOUNDARIES' : { +'Turbulence_Model_For_Solid_Boundaries' : { 1 : "Smooth", 2 : "Rough" }, -'FRICTION COEFFICIENT' : { +'PNPN_Friction_Coefficient' : { 1 : "Linear coefficient", 2 : "Chezy coefficient", 3 : "Strickler coefficient", @@ -129,8 +131,8 @@ }, -'TURBULENCE MODEL' : { - 1 : "Constant viscosity", +'Turbulence_Model' : { + 1 : "Constant Viscosity", 2 : "Elder", 3 : "K-Epsilon Model", 4 : "Smagorinski", @@ -138,7 +140,7 @@ -'ROUGHNESS COEFFICIENT OF BOUNDARIES' : { +'Roughness_Coefficient_Of_Boundaries' : { 1 : "Non programme", 2 : "Coefficient de Chezy", 3 : "Coefficient de Strickler", @@ -147,41 +149,41 @@ }, -'VARIABLES FOR GRAPHIC PRINTOUTS' : { - "U" : "Velocity along X axis (m/s)", - "V" : "Velocity along Y axis (m/s)", - "C" : "Wave celerity (m/s)", - "H" : "Water depth (m)", - "S" : "Free surface elevation (m)", - "B" : "Bottom elevation (m)", - "F" : "Froude number ", - "Q" : "Scalar flowrate of fluid (m2/s)", +'Variables_For_Graphic_Printouts' : { + "U" : "Velocity along X axis (m/s)", + "V" : "Velocity along Y axis (m/s)", + "C" : "Wave celerity (m/s)", + "H" : "Water depth (m)", + "S" : "Free surface elevation (m)", + "B" : "Bottom elevation (m)", + "F" : "Froude number", + "Q" : "Scalar flowrate of fluid (m2/s)", "T1" : "Tracer 1 etc. ", - "K" : "Turbulent kinetic energy in k-epsilon model (J/kg)", - "E" : "Dissipation of turbulent energy (W/kg)", - "D" : "Turbulent viscosity of k-epsilon model (m2/s)", - "I" : "Flowrate along X axis (m2/s)", - "J" : "Flowrate along Y axis (m2/s)", - "M" : "Scalar velocity (m/s)", - "X" : "Wind along X axis (m/s)", - "Y" : "Wind along Y axis (m/s)", - "P" : "Air pressure (Pa)", + "K" : "Turbulent kinetic energy in K-Epsilon model (J/kg)", + "E" : "Dissipation of turbulent energy (W/kg)", + "D" : "Turbulent viscosity of K-Epsilon model (m2/s)", + "I" : "Flowrate along X axis (m2/s)", + "J" : "Flowrate along Y axis (m2/s)", + "M" : "Scalar velocity (m/s)", + "X" : "Wind along X axis (m/s)", + "Y" : "Wind along Y axis (m/s)", + "P" : "Air pressure (Pa)", "W" : "Friction coefficient", - "A" : "Drift along X (m)", - "G" : "Drift along Y (m)", + "A" : "Drift along X (m)", + "G" : "Drift along Y (m)", "L" : "Courant number", - "N" : "Supplementary variable N ", - "O" : "Supplementary variable O ", - "R" : "Supplementary variable R ", - "Z" : "Supplementary variable Z ", + "N" : "Supplementary variable N", + "O" : "Supplementary variable O", + "R" : "Supplementary variable R", + "Z" : "Supplementary variable Z", "MAXZ" : "Maximum elevation", - "TMXZ" : "Time of maximum elevation ", + "TMXZ" : "Time of maximum elevation", "MAXV" : "Maximum velocity", "TMXV" : "Time of maximum velocity", - "US" : "Friction velocity " + "US" : "Friction velocity" }, -'VARIABLES TO BE PRINTED' : { +'Variables_TO_Be_Printed' : { "U" : "Velocity along X axis (m/s)", "V" : "Velocity along Y axis (m/s)", "C" : "Wave celerity (m/s)", @@ -191,9 +193,9 @@ "F" : "Froude number", "Q" : "Scalar flowrate of fluid (m2/s)", "T" : "Tracer", - "K" : "Turbulent kinetic energy in k-epsilon model (J/kg)", + "K" : "Turbulent kinetic energy in K-Epsilon model (J/kg)", "E" : "Dissipation of turbulent energy (W/kg)", - "D" : "Turbulent viscosity of k-epsilon model (m2/s)", + "D" : "Turbulent viscosity of K-Epsilon model (m2/s)", "I" : "Flowrate along X axis (m2/s)", "J" : "Flowrate along Y axis (m2/s)", "M" : "Scalar velocity (m/s)", @@ -211,7 +213,7 @@ }, -'INITIAL CONDITIONS' : { +'Initial_Conditions' : { "ZERO ELEVATION" : "Zero elevation", "CONSTANT ELEVATION" : "Constant elevation", "ZERO DEPTH" : "Zero depth", @@ -220,56 +222,58 @@ "TPXO SATELLITE ALTIMETRY" : "TPXO satellite altimetry", }, -'SUPG_OPTION_U_AND_V' : { +# on regroupe pour Supg +'Supg_Option' : { 0 : "No upwinding", 1 : "Classical SUPG", 2 : "Modified SUPG" }, + -'OPTION FOR THE TREATMENT OF TIDAL FLATS' : { +'Option_For_The_Treatment_Of_Tidal_Flats' : { 1 : "Equations solved everywhere with correction on tidal flats", 2 : "Dry elements frozen", 3 : "1 but with porosity (defina method)", }, -'INITIAL GUESS FOR U' : { +'Initial_Guess_For_U' : { 0 : "Zero", 1 : "Previous", 2 : "Extrapolation", }, -'DISCRETIZATIONS IN SPACE' : { +'Discretizations_In_Space' : { 11 : "Linear", 12 : "Quasi-bubble", 13 : "Quadratic", }, -'MATRIX VECTOR PRODUCT' : { +'Matrix_Vector_Product' : { 1 : "Classic", 2 : "Frontal" }, -'MATRIX STORAGE' : { +'Matrix_Storage' : { 1 : "Classical EBE" , 3 : "Edge-based storage" }, -'OPTION FOR LIQUID BOUNDARIES' : { +'Option_For_Liquid_Boundaries' : { 1 : "Classical boundary conditions", 2 : "Thompson method based on characteristics", }, -'TREATMENT OF THE LINEAR SYSTEM' : { +'Treatment_Of_The_Linear_System' : { 1 : "Coupled", 2 : "Wave equation" }, -'EQUATIONS' : { +'Equations' : { "SAINT-VENANT EF" : "Saint-Venant EF", "SAINT-VENANT VF" : "Saint-Venant VF", "BOUSSINESQ" : "Boussinesq" }, -'VELOCITY PROFILES' : { +'Velocity_ProFiles' : { 1 : "Constant normal profile", 2 : "U and V given in the conlim file", 3 : "Normal velocity given in ubor in the conlim file", @@ -278,25 +282,25 @@ 5 : "QRT(depth) profile, variant", }, -'OPTION FOR THE DIFFUSION OF TRACERS' : { +'Option_For_The_Diffusion_Of_Tracers' : { 1 : "Div( nu grad(T) )", 2 : "1/h Div ( h nu grad(T)" , }, -'OPTION FOR THE DIFFUSION OF VELOCITIES' : { +'Option_For_The_Diffusion_Of_Velocities' : { 1 : "Normal", 2 : "Dirac" }, -'PARAMETER ESTIMATION' : { - "FRICTION" : "Friction", +'Parameter_Estimation' : { + "Friction" : "Friction", "FROTTEMENT" : "Frottement", "STEADY" : "Steady" }, -'IDENTIFICATION METHOD' : { +'Identification_Method' : { 0 : "List of tests", 1 : "Gradient simple", 2 : "Conj gradient", @@ -304,34 +308,34 @@ }, -'FINITE VOLUME SCHEME' : { +'Finite_Volume_Scheme' : { 0 : "Roe scheme", - 1 : "kinetic order 1", - 2 : "kinetic order 2", + 1 : "Kinetic order 1", + 2 : "Kinetic order 2", 3 : "Zokagoa scheme order 1", 4 : "Tchamen scheme order 1", 5 : "HLLC scheme order 1", 6 : "WAF scheme order 2" }, -'STAGE-DISCHARGE CURVES' : { +'Stage-Discharge_Curves' : { 0 : "No one", 1 : "Z(Q)", 2 : "Q(Z)" }, -'TREATMENT OF NEGATIVE DEPTHS' : { +'Treatment_Of_Negative_Depths' : { 0 : "No treatment", 1 : "Smoothing", 2 : "Flux control", }, -'DEPTH IN FRICTION TERMS' : { +'Depth_In_Friction_Terms' : { 1 : "Nodal", 2 : "Average", }, -'LAW OF FRICTION ON LATERAL BOUNDARIES' : { +'Law_Of_Friction_On_Lateral_Boundaries' : { 0 : "No friction", 1 : "Haaland", 2 : "Chezy", @@ -343,12 +347,12 @@ }, -'TREATMENT OF FLUXES AT THE BOUNDARIES': { +'Treatment_Of_Fluxes_AT_The_Boundaries': { 1 : "Priority to prescribed values", 2 : "Priority to fluxes", }, -'OPTION FOR TIDAL BOUNDARY CONDITIONS': { +'Option_For_Tidal_Boundary_Conditions': { 0 : "No tide", 1 : "Real tide (recommended methodology)", 2 : "Astronomical tide", @@ -359,12 +363,12 @@ 7 : "Real tide (methodology before 2010)" }, -'OPTION FOR TSUNAMI GENERATION': { +'Option_For_Tsunami_Generation': { 0 : "No Tsunami", 1 : "Tsunami generated on the basis of the Okada model 1992" }, -#'PHYSICAL CHARACTERISTICS OF THE TSUNAMI': { +#'PHYSICAL Characteristics Of The TSUNAMI': { #AIDE1 : ' # Physical characteristics of the chosen Tsunami model: # - the focal depth (HH), @@ -379,13 +383,13 @@ # - the ellipse ( WxL ) area of influence # }, -'TIDAL DATA BASE': { +'Tidal_Data_Base': { 1 : "JMJ", 2 : "TPXO", 3 : "Miscellaneous (LEGOS-NEA, FES20XX, PREVIMER...)" }, -'GEOGRAPHIC SYSTEM': { +'Geographic_System': { 0 : "Defined by user", 1 : "WGS84 longitude/latitude in real degrees", 2 : "WGS84 northern UTM", @@ -395,7 +399,7 @@ }, -'ZONE NUMBER IN GEOGRAPHIC SYSTEM': { +'Zone_Number_In_Geographic_System': { 1 : "Lambert 1 north", 2 : "Lambert 2 center", 3 : "Lambert 3 south", @@ -405,46 +409,46 @@ }, -'LAW OF TRACERS DEGRADATION': { +'Law_Of_Tracers_Degradation': { 0 : "No degradation", 1 : "F(T90) law" }, -'SPATIAL PROJECTION TYPE': { +'Spatial_Projection_Type': { 1 : "Cartesian, not georeferenced", 2 : "Mercator", 3 : "Latitude longitude" }, -'ALGAE TYPE': { +'Algae_Type': { 1 : "Sphere", 2 : "Iridaea flaccida (close to ulva)", 3 : "Pelvetiopsis limitata", 4 : "Gigartina leptorhynchos" }, -'OPTION FOR CHARACTERISTICS': { +'Option_For_Characteristics': { 1 : "Strong", 2 : "Weak" }, -'STOCHASTIC DIFFUSION MODEL' : { +'Stochastic_Diffusion_Model' : { 0 : "No model", 2 : "??" }, -'NUMBER OF GAUSS POINTS FOR WEAK CHARACTERISTICS' : { +'Number_Of_Gauss_Points_For_Weak_Characteristics' : { 1 : "1 point", 3 : "3 points", 6 : "6 points" }, -'TYPE OF WEIRS': { +'Type_Of_Weirs': { 1 : "Horizontal with same number of nodes upstream/downstream (Historical solution with bord)", 2 : "General (New solution with sources points)" }, -'SCHEME FOR ADVECTION OF VELOCITIES': { +'Scheme_For_Advection_Of_Velocities': { 1 : "Characteristics", 2 : "Explicit + SUPG", 3 : "Explicit leo postma", @@ -454,7 +458,7 @@ 14 : "N-scheme for tidal flats" }, -'SCHEME FOR ADVECTION OF TRACERS': { +'Scheme_For_Advection_Of_Tracers': { 0 : "No advection", 1 : "Characteristics", 2 : "Explicit + SUPG", @@ -466,43 +470,59 @@ }, -'SCHEME FOR ADVECTION OF K-EPSILON': { +'Scheme_For_Advection_Of_K_Epsilon': { 0 : "No advection", 1 : "Characteristics", 2 : "Explicit + SUPG", 3 : "Explicit leo postma", - 4 : "Explicit + murd scheme N", - 5 : "Explicit + murd scheme PSI", + 4 : "Explicit + murd scheme-N", + 5 : "Explicit + murd scheme-PSI", 13 : "Leo postma for tidal flats", 14 : "N-scheme for tidal flats" }, -'SCHEME OPTION FOR ADVECTION OF TRACERS': { +'Scheme_Option_For_Advection_Of_Tracers': { 1 : "explicit", 2 : "predictor-corrector", }, -'SCHEME OPTION FOR ADVECTION OF VELOCITIES': { +'Scheme_Option_For_Advection_Of_Velocities': { 1 : "Explicit", 2 : "Predictor-corrector", }, -'SCHEME OPTION FOR ADVECTION OF K-EPSILON': { +'Scheme_Option_For_Advection_Of_K_Epsilon': { 1 : "Explicit", 2 : "Predictor-corrector", }, -'OPTION FOR WIND': { +'Option_For_Wind': { 0 : "No wind", 1 : "Constant in time and space", 2 : "Variable in time and (constant in space)", 3 : "Variable in time and space" }, -'NEWMARK TIME INTEGRATION COEFFICIENT' :{ +'Newmark_Time_Integration_Coefficient' :{ 1. : "Euler explicit", - 0.5 : "order 2 in time", + 0.5 : "Order 2 in time", }, + + 'Option_For_The_Diffusion_Of_Velocities' : { + 1: 'Diffusion in the form div( nu grad(U))', + 2: 'Diffusion in the form 1/h div ( h nu grad(U))', + }, + } +DicoEnumCasEnInverse={} + +for motClef in DicoEnumCasEn.keys(): + d={} + for valTelemac in DicoEnumCasEn[motClef].keys(): + valEficas= DicoEnumCasEn[motClef][valTelemac] + d[valEficas]=valTelemac + DicoEnumCasEnInverse[motClef]=d + +#print DicoEnumCasEnInverse diff --git a/UiQT5/eficas_en.ts b/UiQT5/eficas_en.ts index 0d3940d6..f89ee2a7 100644 --- a/UiQT5/eficas_en.ts +++ b/UiQT5/eficas_en.ts @@ -2,10 +2,50 @@ @default + + Discretisations_En_Espace + Discretizations_In_Space + + + Option_De_Supg + Supg_Option + + + Forme_De_La_Convection + Type_Of_Advection + + + Cote constante + Constant elevation + + + Cote Nulle + Zero elevation + + + Hauteur Nulle + Zero depth + Hauteur constante Constant depth + + Particulieres + Special + + + Altimetrie satellite tpxo + Tpxo satellite altimetry + + + Sequentiel + Sequential + + + Parallele + Parallel + lecture du fichier impossible : diff --git a/UiQT5/eficas_fr.ts b/UiQT5/eficas_fr.ts index 1e4db6fd..942ddfaa 100644 --- a/UiQT5/eficas_fr.ts +++ b/UiQT5/eficas_fr.ts @@ -2,6 +2,94 @@ @default + + Year + Annee + + + Month + Mois + + + Day + Jour + + + Hour + Heure + + + Minute + Minute + + + Second + Seconde + + + Discretizations_In_Space + Discretisations_En_Espace + + + Discretizations_In_Space_Tracers + Discretisations_En_Espace_Tracers + + + Discretizations_In_Space_U_And_V + Discretisations_En_Espace_U_And_V + + + Discretizations_In_Space_K_And_Epsilon + Discretisations_En_Espace_K_And_Epsilon + + + Discretizations_In_Space_H + Discretisations_En_Espace_H + + + Supg_Option + Option_De_Supg + + + Supg_Option_Tracers + Option_De_Supg_Tracers + + + Supg_Option_U_And_V + Option_De_Supg_U_And_V + + + Supg_Option_K_And_Epsilon + Option_De_Supg_K_And_Epsilon + + + Supg_Option_H + Option_De_Supg_H + + + Type_Of_Advection + Forme_De_La_Convection + + + Forme_De_La_Convection + Type_Of_Advection + + + Type_Of_Advection_Tracers + Forme_De_La_Convection_Tracers + + + Type_Of_Advection_U_And_V + Forme_De_La_Convection_U_And_V + + + Type_Of_Advection_K_And_Epsilon + Forme_De_La_Convection_K_And_Epsilon + + + Type_Of_Advection_H + Forme_De_La_Convection_H + Hauteur constante Constant depth @@ -328,6 +416,10 @@ Option_For_Tidal_Boundary_Conditions Option_Pour_Les_Conditions_Aux_Limites_De_Maree + + Option_For_Liquid_Boundaries + Option_Pour_Les_Frontieres_Liquides + Coefficient_To_Calibrate_Tidal_Velocities Coefficient_De_Calage_Des_Vitesses_De_Courant @@ -604,10 +696,6 @@ Solver_For_Diffusion_Of_Tracers Solveur_Pour_La_Diffusion_Des_Traceurs - - Discretizations_In_Space - Discretisations_En_Espace - Solver_Option Option_Du_Solveur @@ -652,6 +740,10 @@ Matrix_Storage Stockage_Des_Matrices + + Matrix_Vector_Product + Produit_Matrice_Vecteur + Algae_Type Type_Des_Algues @@ -848,10 +940,6 @@ Diffusion_Of_Velocity Diffusion_Des_Vitesses - - Type_Of_Advection - Forme_De_La_Convection - Solver_Option_For_Tracers_Diffusion Option_Du_Solveur_Pour_La_Diffusion_Des_Traceurs diff --git a/convert/convert_TELEMAC.py b/convert/convert_TELEMAC.py index af7f42eb..1351e7f4 100644 --- a/convert/convert_TELEMAC.py +++ b/convert/convert_TELEMAC.py @@ -20,6 +20,7 @@ import re, string from Extensions.i18n import tr from Accas.A_BLOC import BLOC from Accas import * +from Telemac_Cata import Tuple from convert_python import PythonParser @@ -55,7 +56,7 @@ pattern_ContientDouble=re.compile (r"^.*''.*$") try : from aideAuxConvertisseurs import DicoEficasToCas, ListeSupprimeCasToEficas from aideAuxConvertisseurs import ListeCalculCasToEficas, DicoAvecMajuscules - from enumDicoTelemac2 import DicoEnumCasEn + from enumDicoTelemac import DicoEnumCasEn except : pass @@ -105,7 +106,8 @@ class TELEMACParser(PythonParser): finLigne=ligne while finLigne != "" : - print finLigne + #print finLigne + if pattern_comment_slash.match(finLigne) : finLigne=""; continue valeur="" m=pattern_ligne.match(finLigne) if m == None : @@ -211,6 +213,7 @@ class TELEMACParser(PythonParser): ind=simp.find('-') if ind==len(simp)-1 : break simp=simp[0:ind]+'_'+simp[ind+1].upper()+simp[ind+2:] + return simp #---------------------------------------- def traiteIdent(self,listeIdent): @@ -230,6 +233,7 @@ class TELEMACParser(PythonParser): simp=simp[0:-1] while simp[-1] == " " : simp=simp[0:-1] if simp.find('-') > 0 : simp=self.redecoupeSimp(simp) + return simp @@ -261,30 +265,30 @@ class TELEMACParser(PythonParser): def generSIMP(self,obj,nom,valeur): if nom in ("Prescribed_Flowrates", "Prescribed_Velocities", "Prescribed_Elevations" ): return - #print "___________________________" - #print nom - #print valeur - if valeur == None : print nom + print "___________________________" + print nom + print valeur if obj.max==1 : + if hasattr(obj.type[0],'ntuple') : + lval=[] + for v in valeur : + try : v=eval(v,{}) + except : pass + lval.append(v) + self.textePy += nom + "=" + str(lval) +"," + return if 'TXM' in obj.type : - if pattern_ContientDouble.match(valeur): - valeur=re.sub("''","\'\'",valeur) - print str(valeur) - print valeur - print tr(valeur) - print poum + if pattern_ContientDouble.match(str(valeur)): + valeur=re.sub("''","\'\'",str(valeur)) + self.textePy += nom + "=" + str(valeur) +"," + return valeur=str(valeur) # ceinture et bretelle si les re sont correctes -) while valeur[-1] == " " or valeur[-1] == '\t' : valeur=valeur[0:-1] while valeur[0] == " " or valeur[0] == '\t' : valeur=valeur[1:] - if pattern_ContientDouble.match(valeur): - valeur=re.sub("''","\'\'",valeur) - print valeur - print tr(valeur) - print poum # Pour les enum @@ -292,11 +296,14 @@ class TELEMACParser(PythonParser): except : pass if nom in DicoEnumCasEn.keys(): #print "est dans le dico des enum, valeur simple" - try : valeur=DicoEnumCasEn[nom][valeur] + try : + valeur=DicoEnumCasEn[nom][valeur] + self.textePy += nom + "= '" + str(valeur) +"'," + return except : pass - if obj.into != [] and obj.into != None : + if obj.into != [] and obj.into != None and not('R' in obj.type) and not('I' in obj.type): for possible in obj.into : if possible.upper() == valeur.upper(): valeur=possible @@ -369,8 +376,8 @@ class TELEMACParser(PythonParser): else : self.dictSimp["Parallel_Computation"]="Parallel" def decoupeListe(self,valeurs,label): - print "decoupeSUPG" - print valeurs + #print "decoupeListe" + #print valeurs i=0 for prefixe in ('_U_And_V','_H'): labelComplet=label+prefixe @@ -406,13 +413,27 @@ class TELEMACParser(PythonParser): self.dictSimp['Convection_De_U_Et_V']=True self.dictSimp['Convection_De_H']=True if len(valeurs)==2 : return - self.dictSimp['Advection_Of_K_And_Epsilon']=True - self.dictSimp['Advection_Of_Tracers']=True + self.dictSimp['Convection_De_K_Et_Epsilon']=True + self.dictSimp['Convection_Des_Traceurs']=True def Discretisations_En_Espace(self): self.decoupeListe( self.dictSimp["Discretisations_En_Espace"],"Discretisations_En_Espace") del self.dictSimp["Discretisations_En_Espace"] + def Date_De_L_Origine_Des_Temps (self): + valeurs=self.dictSimp["Date_De_L_Origine_Des_Temps"] + self.dictSimp['Annee']=valeurs[0] + self.dictSimp['Mois']=valeurs[1] + self.dictSimp['Jour']=valeurs[2] + del self.dictSimp["Date_De_L_Origine_Des_Temps"] + + + def Heure_De_L_Origine_Des_Temps (self): + valeurs=self.dictSimp["Heure_De_L_Origine_Des_Temps"] + self.dictSimp['Heure']=valeurs[0] + self.dictSimp['Minute']=valeurs[1] + self.dictSimp['Seconde']=valeurs[2] + del self.dictSimp["Heure_De_L_Origine_Des_Temps"] def Liquid_Boundaries(self): #print 'Liquid Boundaries' diff --git a/generator/generator_TELEMAC.py b/generator/generator_TELEMAC.py index 5af94683..1a028a64 100644 --- a/generator/generator_TELEMAC.py +++ b/generator/generator_TELEMAC.py @@ -26,11 +26,8 @@ from Extensions.i18n import tr from generator_python import PythonGenerator extensions=('.comm',) -#listeSupprime=() -#DicoAglomere=() -#DicoEficasToCas=() from aideAuxConvertisseurs import listeSupprime, DicoAglomere, DicoEficasToCas -from enumDicoTelemac2 import DicoEnumCasEnInverse +from enumDicoTelemac import DicoEnumCasEnInverse def entryPoint(): @@ -58,7 +55,7 @@ class TELEMACGenerator(PythonGenerator): def gener(self,obj,format='brut',config=None): self.initDico() - print self.texteDico + #print self.texteDico # Cette instruction genere le contenu du fichier de commandes (persistance) self.text=PythonGenerator.gener(self,obj,format) @@ -78,6 +75,7 @@ class TELEMACGenerator(PythonGenerator): self.textFE = 'PRESCRIBED FLOWRATES :' self.textVE = 'PRESCRIBED VELOCITY :' self.texteDico = "" + @@ -100,6 +98,8 @@ class TELEMACGenerator(PythonGenerator): self.texteDico += '/\t\t\t'+obj.nom +'\n' self.texteDico += '/------------------------------------------------------/\n' s=PythonGenerator.generPROC_ETAPE(self,obj) + #print obj + #print obj.nom if obj.nom in TELEMACGenerator.__dict__.keys() : apply(TELEMACGenerator.__dict__[obj.nom],(self,obj)) return s @@ -153,6 +153,7 @@ class TELEMACGenerator(PythonGenerator): if 'Type_Condition' in obj.liste_mc_presents() : objForme=obj.get_child('Type_Condition') valForme=objForme.valeur + if valForme == None : return nomBloc='b_'+valForme.split(" ")[1] if nomBloc in obj.liste_mc_presents() : @@ -172,7 +173,7 @@ class TELEMACGenerator(PythonGenerator): self.VE=True self.textVE += str(valeur) +"; " else : self.textVE += "0.; " - print self.textPE, self.textFE,self.textVE + #print self.textPE, self.textFE,self.textVE def BOUNDARY_CONDITIONS(self,obj): if self.FE : self.texteDico += self.textFE[0:-1]+'\n' @@ -180,5 +181,54 @@ class TELEMACGenerator(PythonGenerator): if self.PE : self.texteDico += self.textPE[0:-1]+'\n' def Validation(self,obj): - self.textDico += "Validation = OUI \n" - + 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 + jour=obj.get_child('Day').valeur + #print an, mois, jour + self.texteDico += "ORIGINAL DATE OF TIME :"+ str(an)+ " ,"+str(mois)+ "," +str(jour)+ "\n" + + def Original_Hour_Of_Time (self,obj): + hh=obj.get_child('Hour').valeur + mm=obj.get_child('Minute').valeur + ss=obj.get_child('Second').valeur + #print hh, mm, ss + self.texteDico += "ORIGINAL HOUR OF TIME :"+str(hh)+" ,"+str(mm)+ ","+str(ss)+"\n" + + def Type_Of_Advection(self,obj): + listeAdvection=[1,5,1,1] + listeSupg=[2,2,2,2] + listeUpwind=[1.,1.,1.,1.] + self.listeMCAdvection=[] + self.chercheChildren(obj) + dicoSuf={ 'U_And_V' : 0, 'H' : 1, 'K_And_Epsilon' : 2, 'Tracers' : 3} + for c in self.listeMCAdvection: + #print c.nom + if c.nom[0:18] == 'Type_Of_Advection_' and c.valeur!=None: + suf=c.nom[18:] + index=dicoSuf[suf] + #print c.valeur + #print DicoEnumCasEnInverse['Type_Of_Advection'] + listeAdvection[index]=DicoEnumCasEnInverse['Type_Of_Advection'][c.valeur] + if c.nom[0:13] == 'Supg_Option_' and c.valeur!=None: + suf=c.nom[13:] + index=dicoSuf[suf] + listeAdvection[index]=DicoEnumCasEnInverse['Supg_Option'][c.valeur] + if c.nom[0:23] == 'Upwind_Coefficients_Of_' and c.valeur!=None: + suf=c.nom[23:] + index=dicoSuf[suf] + listeUpwind[index]=c.valeur + 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) + + +