Salome HOME
legere difference ds VARIABLES_TO_BE...
[tools/eficas.git] / Openturns_Wrapper / OpenTURNS_Cata_Wrapper_V4.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2013   EDF R&D
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20
21 # --------------------------------------------------
22 # debut entete
23 # --------------------------------------------------
24
25 import Accas
26 from Accas import *
27
28 class variable(ASSD ) : pass
29
30
31 #CONTEXT.debug = 1
32 JdC = JDC_CATA ( code = 'OPENTURNS_WRAPPER',
33                  execmodul = None,
34                  regles = ( AU_MOINS_UN ( 'WRAPPER' ), ),
35                  ) # Fin JDC_CATA
36
37 # --------------------------------------------------
38 # fin entete
39 # --------------------------------------------------
40
41
42 #================================
43 # 2. Definition des variables
44 #================================
45
46
47                        
48 VARIABLE = OPER ( nom = "VARIABLE",
49                       sd_prod = variable,
50                       op = None,
51                       fr = "Definitions des lois marginales utilisees par les variables d'entree",
52               
53
54                      Type = SIMP ( statut = "o",
55                                    typ = "TXM",
56                                    max = 1,
57                                    into = ( "in", "out", ),
58                                    defaut = "in",
59                                    fr = "variable d'entree ou de sortie du solver",
60                                    ang = "Input or Output variable",
61                                    ),
62
63                      Unit = SIMP ( statut = "f",
64                                    typ = "TXM",
65                                    max = 1,
66                                    fr = "Unite",
67                                    ang = "Unit",
68                                    ),
69
70                      Comment = SIMP ( statut = "f",
71                                       typ = "TXM",
72                                       max = 1,
73                                       fr = "Commentaire",
74                                       ang = "Comment",
75                                       ),
76
77                      Regexp = SIMP ( statut = "f",
78                                      typ = "TXM",
79                                      max = 1,
80                                      fr = "Expression reguliere",
81                                      ang = "Regular expression",
82                                      ),
83
84                      Format = SIMP ( statut = "f",
85                                      typ = "TXM",
86                                      max = 1,
87                                      fr = "Format d'ecriture",
88                                      ang = "Format",
89                                      ),
90
91
92              ) # Fin FACT Variables
93 #
94
95
96 #================================
97 # Definition des parametres du wrapper
98 #================================
99
100 # Nota : les variables de type PROC doivent etre en majuscules !
101 WRAPPER = PROC ( nom = "WRAPPER",
102                  op = None,
103                  docu = "",
104                  fr = "Mise en donnee pour le fichier de configuration de OPENTURNS.",
105                  ang = "Writes the configuration file for OPENTURNS.",
106
107     Framework = SIMP ( statut = "o",
108                        typ = "TXM",
109                        into = ( "Salome", "Stand-alone", ),
110                        max = 1,
111                        fr = "Dans quel environnement le wrapper doit-il etre utilise ?",
112                        ang = "Which framework is this wrapper designed for ?",
113                        ),
114
115     StandAlone = BLOC ( condition = " Framework in ( 'Stand-alone', ) ",
116     
117     
118         WrapperPath = SIMP ( statut = "o",
119                              typ = "TXM",
120                              max = 1,
121                              fr = "Chemin d acces au wrapper",
122                              ang = "Wrapper library path",
123                              ),
124     
125         FunctionName = SIMP ( statut = "o",
126                               typ = "TXM",
127                               max = 1,
128                               fr = "Nom de la fonction dans le wrapper",
129                               ang = "Function's name in wrapper",
130                               ),
131     
132         GradientName = SIMP ( statut = "f",
133                               typ = "TXM",
134                               max = 1,
135                               fr = "Nom du gradient dans le wrapper",
136                               ang = "Gradient's name in wrapper",
137                               ),
138     
139         HessianName = SIMP ( statut = "f",
140                              typ = "TXM",
141                              max = 1,
142                              fr = "Nom du hessian dans le wrapper",
143                              ang = "Hessian's name in wrapper",
144                              ),
145     
146         WrapCouplingMode = SIMP ( statut = "o",
147                                   typ = "TXM",
148                                   max = 1,
149                                   into = ( "static-link", "dynamic-link", "fork", ),
150                                   defaut = "fork",
151                                   fr = "Mode de couplage du solver",
152                                   ang = "Solver coupling mode",
153                                   ),
154     
155         Fork = BLOC ( condition = " WrapCouplingMode in ( 'fork', ) ",
156                         
157                       Command = SIMP ( statut = "o",
158                                        max = 1,
159                                        typ = "TXM",
160                                        fr = "Chemin du solver",
161                                        ang = "Solver path",
162                                        ),
163                         
164                       UserPrefix = SIMP ( statut = "f",
165                                        max = 1,
166                                        typ = "TXM",
167                                        fr = "Prefixe pour retrouver les repertories temporaires de calcul",
168                                        ang = "Prefix to help finding compute directories",
169                                        ),
170                       ), # Fin BLOC Fork
171     
172         State = SIMP ( statut = "f",
173                        typ = "TXM",
174                        max = 1,
175                        into = ( "shared", "specific" ),
176                        fr = "Partage de l'etat interne entre les fonctions",
177                        ang = "Internal state sharing",
178                        ),
179     
180         InDataTransfer = SIMP ( statut = "o",
181                                 typ = "TXM",
182                                 max = 1,
183                                 into = ( "files", "arguments", "corba" ),
184                                 fr = "Mode de transfert des donnees d'entree",
185                                 ang = "Input transfering mode",
186                                 ),
187     
188         OutDataTransfer = SIMP ( statut = "o",
189                                  typ = "TXM",
190                                  max = 1,
191                                  into = ( "files", "arguments", "corba" ),
192                                  fr = "Mode de transfert des donnees de sortie",
193                                  ang = "Output transfering mode",
194                                  ),
195   
196     ), # Fin BLOC StandAlone
197
198
199     Salome = BLOC ( condition = " Framework in ( 'Salome', ) ",
200
201         SolverComponentName  = SIMP ( statut = "f",
202                                       typ = "TXM",
203                                       max = 1,
204                                       defaut = "UNDEFINED",
205                                       fr = "Nom du composant solver",
206                                       ang = "Solver component name",
207                                       ),
208     
209     
210         WrapperPath = SIMP ( statut = "o",
211                              typ = "TXM",
212                              into = ( "GenericWrapper4Salome.so", ),
213                              defaut = "GenericWrapper4Salome.so",
214                              max = 1,
215                              fr = "Chemin d acces au wrapper",
216                              ang = "Wrapper library path",
217                              ),
218     
219         FunctionName = SIMP ( statut = "o",
220                               typ = "TXM",
221                               into = ( "GENERICSOLVER", ),
222                               defaut = "GENERICSOLVER",
223                               max = 1,
224                               fr = "Nom de la fonction dans le wrapper",
225                               ang = "Function's name in wrapper",
226                               ),
227     
228         GradientName = SIMP ( statut = "f",
229                               typ = "TXM",
230                               into = ( "GENERICSOLVER", ),
231                               defaut = "GENERICSOLVER",
232                               max = 1,
233                               fr = "Nom du gradient dans le wrapper",
234                               ang = "Gradient's name in wrapper",
235                               ),
236     
237         HessianName = SIMP ( statut = "f",
238                              typ = "TXM",
239                              into = ( "GENERICSOLVER", ),
240                              defaut = "GENERICSOLVER",
241                              max = 1,
242                              fr = "Nom du hessian dans le wrapper",
243                              ang = "Hessian's name in wrapper",
244                              ),
245     
246         WrapCouplingMode = SIMP ( statut = "o",
247                                   typ = "TXM",
248                                   max = 1,
249                                   into = ( "static-link", ),
250                                   defaut = "static-link",
251                                   fr = "Mode de couplage du solver",
252                                   ang = "Solver coupling mode",
253                                   ),
254     
255         State = SIMP ( statut = "f",
256                        typ = "TXM",
257                        max = 1,
258                        into = ( "shared", "specific" ),
259                        fr = "Partage de l'etat interne entre les fonctions",
260                        ang = "Internal state sharing",
261                        ),
262     
263         InDataTransfer = SIMP ( statut = "o",
264                                 typ = "TXM",
265                                 max = 1,
266                                 into = ( "files", "arguments", "corba", ),
267                                 defaut = "corba",
268                                 fr = "Mode de transfert des donnees d'entree",
269                                 ang = "Input transfering mode",
270                                 ),
271     
272         OutDataTransfer = SIMP ( statut = "o",
273                                  typ = "TXM",
274                                  max = 1,
275                                  into = ( "files", "arguments", "corba", ),
276                                  defaut = "corba",
277                                  fr = "Mode de transfert des donnees de sortie",
278                                  ang = "Output transfering mode",
279                                  ),
280   
281     ), # Fin BLOC Salome
282
283
284   Files = FACT ( statut = "f",
285                  min = 1,
286                  max = "**",
287
288                  Id = SIMP ( statut = "o",
289                              typ = "TXM",
290                              max = 1,
291                              fr = "Identificateur du  fichier",
292                              ang = "File id",
293                              ),
294
295                  Type = SIMP ( statut = "o",
296                                typ = "TXM",
297                                max = 1,
298                                into = ( "in", "out", ),
299                                fr = "Fichier d entree ou de sortie du solveur ?",
300                                ang = "Input or Output file ?",
301                                ),
302
303                  Name = SIMP ( statut = "f",
304                                typ = "TXM",
305                                max = 1,
306                                fr = "Nom du fichier",
307                                ang = "File name",
308                                ),
309
310                  Path = SIMP ( statut = "o",
311                                typ = "TXM",
312                                max = 1,
313                                fr = "Chemin du fichier",
314                                ang = "Path file ",
315                                ),
316
317                  Subst = SIMP ( statut = "f",
318                                 typ = "TXM",
319                                 max = "**",
320                                 fr = "Liste de variables",
321                                 ang = "List",
322                                 ),
323
324                  ), # Fin FACT Files
325
326 ) # Fin PROC WRAPPER