Salome HOME
388c5b1b7b75eaee7c89ad558399c6249cff2c2a
[modules/hydrosolver.git] / src / salome_hydro / telemac2d / eficas / telemac2d_V6_cata.py
1 # -*- coding: utf-8 -*-
2 #
3 #  Copyright (C) 2012-2013 EDF
4 #
5 #  This file is part of SALOME HYDRO module.
6 #
7 #  SALOME HYDRO module is free software: you can redistribute it and/or modify
8 #  it under the terms of the GNU General Public License as published by
9 #  the Free Software Foundation, either version 3 of the License, or
10 #  (at your option) any later version.
11 #
12 #  SALOME HYDRO module is distributed in the hope that it will be useful,
13 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #  GNU General Public License for more details.
16 #
17 #  You should have received a copy of the GNU General Public License
18 #  along with SALOME HYDRO module.  If not, see <http://www.gnu.org/licenses/>.
19
20 import types
21 from Accas import *
22
23 class Tuple:
24   def __init__(self,ntuple):
25     self.ntuple=ntuple
26
27   def __convert__(self,valeur):
28     if type(valeur) == types.StringType:
29       return None
30     if len(valeur) != self.ntuple:
31       return None
32     return valeur
33
34   def info(self):
35     return "Tuple de %s elements" % self.ntuple
36
37   __repr__=info
38   __str__=info
39
40 JdC = JDC_CATA(regles = (UN_PARMI('TELEMAC2D',)),
41                         )
42
43 TELEMAC2D = PROC(
44     nom = "TELEMAC2D", op = None,
45     fr = u"Définition d'un cas d'étude Telemac2D",
46     ang = u"Definition of a Telemac2D study case",
47     STEERING_FILE = SIMP(statut = "o", typ = 'Fichier',
48                        fr = u"Fichier de description du cas",
49                        ang = u"Case description file"),
50     USER_FORTRAN = SIMP(statut = "f", typ = 'Fichier',
51                                        fr = "Fichier Fortran utilisateur",
52                                        ang = u"Fortran user file"),
53     OUTPUT_VARIABLE = FACT(statut = 'f', max = '**',
54                            fr = u"Variable de sortie du calcul",
55                            ang = u"Computation output variable",
56         NAME = SIMP(statut = "o", typ = 'TXM',
57                    fr = u"Nom de la variable",
58                    ang = u"Variable name"),
59         VAR_INFO = FACT(statut = "o",
60                                    fr = u'Variable du modèle Telemac2D',
61                                    ang = u'Telemac2D model variable',
62             VAR_NAME = SIMP(statut = "o", typ = 'TXM',
63                                        fr = u'Nom de la variable du modèle (ex: "MODEL.DEBIT")',
64                                        ang = u'Model variable name (ex: "MODEL.DEBIT")'),
65             ZONE_DEF = FACT(statut = "o",
66                                       ang = u'Variable definition area',
67                                       fr = u'Zone de définition de la variable',
68                                       regles = (UN_PARMI('INDEX', 'POLYGON')),
69                 INDEX = SIMP(statut = "f", typ = Tuple(3),
70                               defaut = (0,0,0),
71                               ang = "Index of the point / border",
72                               fr = u"Indice du point ou de la frontière",
73                               validators = VerifTypeTuple(('I', 'I', 'I')),
74                 ),
75                 POLYGON = SIMP(statut = "f",
76                                 typ = Tuple(2),
77                                 max = '**',
78                                 fr = u"Liste des sommets (coordonnées X,Y) du "
79                                      u"polygone définissant le contour de la zone",
80                                 ang = "List of points (X,Y coordinates) of the "
81                                       "polygon defining the border of the area",
82                                 validators = VerifTypeTuple(('R', 'R')),
83                 ),
84             ),
85         ),
86     ),
87     INPUT_VARIABLE = FACT(statut = 'f', max = '**',
88                            fr = u"Variable d'entrée du calcul",
89                            ang = u"Computation input variable",
90         NAME = SIMP(statut = "o", typ = 'TXM',
91                    fr = u"Nom de la variable (format Python)",
92                    ang = u"Variable name (Python format)"),
93         VAR_INFO = FACT(statut = "o",
94                                    fr = u'Variable du modèle Telemac2D',
95                                    ang = u'Telemac2D model variable',
96             VAR_NAME = SIMP(statut = "o", typ = 'TXM',
97                                        fr = u'Nom de la variable du modèle (ex: "MODEL.DEBIT")',
98                                        ang = u'Model variable name (ex: "MODEL.DEBIT")'),
99             DEFAULT_VALUE = SIMP(statut = "o", typ = 'TXM',
100                             fr = u'Valeur par défaut',
101                             ang = u'Default value'),
102             ZONE_DEF = FACT(statut = "o",
103                                       ang = u'Variable definition area',
104                                       fr = u'Zone de définition de la variable',
105                                       regles = (UN_PARMI('INDEX', 'POLYGON')),
106                 INDEX = SIMP(statut = "f", typ = Tuple(3),
107                               defaut = (0,0,0),
108                               ang = "Index of the variable",
109                               fr = u"Indice de la variabme",
110                               validators = VerifTypeTuple(('I', 'I', 'I')),
111                 ),
112                 POLYGON = SIMP(statut = "f",
113                                 typ = Tuple(2),
114                                 max = '**',
115                                 fr = u"Liste des sommets (coordonnées X,Y) du "
116                                      u"polygone définissant le contour de la zone",
117                                 ang = "List of points (X,Y coordinates) of the "
118                                       "polygon defining the border of the area",
119                                 validators = VerifTypeTuple(('R', 'R')),
120                 ),
121             ),
122         ),
123     ),
124 )
125
126 TEXTE_NEW_JDC="TELEMAC2D()"