Salome HOME
9bb47965f3944da8b64f3a6971f203781390b0ca
[modules/hydrosolver.git] / src / salome_hydro / boundary_conditions / eficas / boundary_conditions_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 from Accas import *
21
22 class grma(GEOM):
23   """
24   Class used to define the group on which the boundary condition is defined.
25   Method __convert__ is redefined to skip the test on the string length.
26   """
27   def __convert__(cls, valeur):
28     if isinstance(valeur, (str, unicode)):
29       return valeur.strip()
30     raise ValueError(_('A string is expected'))
31
32   __convert__ = classmethod(__convert__)
33
34
35 JdC = JDC_CATA(regles = (AU_MOINS_UN('BOUNDARY_CONDITION',)),
36                         )
37
38 BOUNDARY_CONDITION = PROC(
39     nom = "BOUNDARY_CONDITION", op = None,
40     fr = u"Définition d'une condition limite pour Telemac2D",
41     ang = u"Definition of a boundary condition for Telemac2D",
42
43     GROUP = SIMP(statut = "o", typ = grma,
44                  fr = u"Groupe sur lequel la condition limite est définie",
45                  ang = u"Group on which the boundary condition is defined",
46                 ),
47     LIHBOR = SIMP(statut = "o", typ = "I",
48                   fr = u"Type de condition limite pour la hauteur d'eau",
49                   ang = u"Boundary condition type for the water height",
50                  ),
51     LIUBOR = SIMP(statut = "o", typ = "I",
52                   fr = u"Type de condition limite pour la composante U de la vitesse",
53                   ang = u"Boundary condition type for the U component of the water velocity",
54                  ),
55     LIVBOR = SIMP(statut = "o", typ = "I",
56                   fr = u"Type de condition limite pour la composante V de la vitesse",
57                   ang = u"Boundary condition type for the V component of the water velocity",
58                  ),
59 )