Salome HOME
svn merge -r31:HEAD svn://nepal.der.edf.fr/OPENTURNS/GENERICSOLVER_SRC/branches/YACS_...
[samples/genericsolver.git] / idl / GENERICSOLVER_Gen.idl
1 //  Copyright (C) 2009-2010 EDF R&D
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 //  $Id$
20 //
21
22 #ifndef __GENERICSOLVER_GEN__
23 #define __GENERICSOLVER_GEN__
24
25 #include "SALOME_Component.idl"
26 #include "SALOMEDS.idl"
27 #include "SALOME_Exception.idl"
28
29 module GENERICSOLVER_ORB
30 {
31
32   typedef sequence<double> Point;
33   typedef SALOMEDS::ID ID;
34   typedef sequence<string> VarList;
35   typedef Engines::fileBlock pyobj;
36
37   interface GENERICSOLVER_Gen : Engines::Component, SALOMEDS::Driver
38   {
39
40     /**
41      * @brief Prepare module for later computation.
42      *
43      * The Init method prepares the module for a series of computation
44      * based on a study case. The study case is a set of parameters that
45      * globally defines _ALL_ information needed to make a computation.
46      * When Init exits, the module is ready to run if a call to an hypothetical
47      * method Exec() (without any more argument) occurs.
48      *
49      * @return                   0 if success, non zero if failure
50      * @param studyID            the identifier of the study containing the study case
51      * @param entry              the identifier of the study case within the study
52      * @param wrapperDescription a string containing the XML wrapper description
53      */
54     long Init(in long studyID, in ID entry, in string wrapperDescription)
55       raises (SALOME::SALOME_Exception);
56
57     /**
58      * @brief Run the module with modified parameters
59      *
60      * The Run method realizes the computation with some parameters (within inPoint)
61      * altered compared to what Init set before. The result is put in outPoint.
62      *
63      * @return          0 if success, non zero if failure
64      * @param inPoint   a vector of floating point values to be modified
65      * @param outPoint  the result of the computation as a vector of floating point values
66      */
67     long Exec(in Point inPoint, out Point outPoint)
68       raises (SALOME::SALOME_Exception);
69
70     /**
71      * @brief Cleanup everything that was previously set
72      *
73      * The Finalize method is in charge of cleaning everything that what set hitherto.
74      * It may be empty.
75      *
76      * @return          0 if success, non zero if failure
77      */
78     long Finalize()
79       raises (SALOME::SALOME_Exception);
80
81
82     /**
83      * @brief Initialize the component with the deterministic variables and the lists of
84      *        probabilistic variables.
85      *
86      * The InitWithVarList method prepares the component for a series of computation
87      * with the method ExecWithVarList. It stores the deterministic variables and the
88      * lists of input and output variables to identify them in future calls to
89      * ExecWithVarList.
90      *
91      * @param inputVarList      a list of strings containing the names of the input
92      *                          variables in the same order as in subsequent calls to
93      *                          ExecWithVarList.
94      * @param outputVarList     a list of strings containing the names of the output
95      *                          variables in the same order as they should be returned
96      *                          in subsequent calls to ExecWithVarList.
97      * @param deterministicVars a python dictionary containing the deterministic
98      *                          variables (mapping variable names to variable values)
99      */
100     void InitWithVarList(in VarList inputVarList, in VarList outputVarList, in pyobj deterministicVars)
101       raises (SALOME::SALOME_Exception);
102
103     /**
104      * @brief Execute a computation with a given sample of variables.
105      *
106      * The ExecWithVarList method realizes the computation with some parameters (within
107      * inPoint) corresponding to the variables set previously with the method
108      * InitWithVarList. The result is put in outPoint in the order specified by
109      * outputVarList of InitWithVarList method.
110      *
111      * @param inPoint   a vector of floating point values to be evaluated
112      * @param outPoint  the result of the computation as a vector of floating point values
113      */
114     void ExecWithVarList(in Point inPoint, out Point outPoint)
115       raises (SALOME::SALOME_Exception);
116
117   };
118 };
119
120 #endif