Salome HOME
Rename Engines::Component to Engines::EngineComponent
[modules/multipr.git] / idl / MULTIPR.idl
1 //  Copyright (C) 2007-2010  CEA/DEN, 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 //  Partitioning/decimation module for the SALOME v3.2 platform
20 //  File: MULTIPR.idl
21 //  Interface CORBA for the MULTIPR module
22 //  Author: Olivier LE ROUX - CS, Virtual Reality Dpt
23 //  Date: 01/2007
24
25 #ifndef __MULTIPR_INTERFACE_CORBA__
26 #define __MULTIPR_INTERFACE_CORBA__
27
28 #include "SALOME_Exception.idl"
29 #include "SALOME_Component.idl"
30 #include "SALOME_GenericObj.idl"
31 #include "SALOMEDS.idl" // to access study
32
33
34 /*!  \ingroup MULTIPR
35  *
36  * This package contains the interface MULTIPR_ORB used for %MULTIPR component.
37  */
38 module MULTIPR_ORB
39 {
40
41
42 typedef sequence<string> string_array;
43
44
45 //*************************************************************************
46 // Interface of the %MULTIPR component used to manage partition/decimation
47 //*************************************************************************
48
49 interface MULTIPR_Obj : SALOME::GenericObj
50 {
51
52   //---------------------------------------------------------------------
53   // Basic accessors/mutators
54   //--------------------------------------------------------------------
55
56   /*!
57    * Reset the object.
58    */
59   void    reset();
60
61   /*!
62    * Return true iff this obj represents a valid sequential MED file.
63    */
64   boolean isValidSequentialMEDFile();
65
66   /*!
67    * Return true iff this obj represents a valid distributed MED file.
68    */
69   boolean isValidDistributedMEDFile();
70
71   /*!
72    * Return the name of the associated MED file.
73    */
74   string getFilename()
75     raises (SALOME::SALOME_Exception);
76
77   /*!
78    * Return the name of the associated sequential MED file (for a distributed MED file).
79    */
80   string getSeqFilename()
81     raises (SALOME::SALOME_Exception);
82
83   /*!
84    * Set the mesh to be partitionned/decimated.
85    * Assume sequential MED file.
86    */
87   void setMesh(in string meshName)
88     raises (SALOME::SALOME_Exception);
89
90         /*!
91          * Set the boxing parameter used for decimation (100 by default).
92          */
93         void setBoxing(in long boxing)
94                 raises (SALOME::SALOME_Exception);
95
96         /*!
97          * Return the list of meshes contained in the associated MED file.
98          */
99         string_array getMeshes()
100                 raises (SALOME::SALOME_Exception);
101
102         /*!
103          * Return the list of fields contained in the current mesh of the associated MED file.
104          */
105         string_array getFields(in string pPartList)
106                 raises (SALOME::SALOME_Exception);
107
108         /*!
109          * Return the number of iterations for a given field.
110          */
111         long getTimeStamps(in string pPartList, in string fieldName)
112                 raises (SALOME::SALOME_Exception);
113
114     /*!
115      * Get the minimum and maximum value of a part's field.
116      */
117     void getFieldMinMax(in string pPartName, in string pFieldName, inout float pMin, inout float pMax)
118         raises (SALOME::SALOME_Exception);
119
120         /*!
121          * Return the name of all partitions.
122          * Assume this object encapsulates a distributed MED file.
123          */
124         string_array getParts()
125                 raises (SALOME::SALOME_Exception);
126
127         /*!
128          * Return all information about a part.
129          * Assume this object encapsulates a distributed MED file.
130          */
131         string getPartInfo(in string partName)
132                 raises (SALOME::SALOME_Exception);
133
134         //---------------------------------------------------------------------
135         // Algorithms
136         //--------------------------------------------------------------------
137
138         /*!
139          * Create a distributed MED file (v2.3) by extracting all the groups from the
140          * current mesh of the current MED sequential MED file.
141          * Assume:
142          * - the file is in MED format and can be read using MED file v2.3.
143          * - the file is sequential (not a distributed MED).
144          * - the file only contains TETRA10 elements (dimension of space and mesh is 3).
145          * - the file have no profil.
146          * \return the name of each part.
147          */
148         string_array partitionneDomaine()
149                 raises (SALOME::SALOME_Exception);
150
151         /*!
152          * Create a distributed MED file (V2.3) by splitting a group of a MED file
153          * previously created by partitionneDomaine.
154          * Assume:
155          * - the file is a distributed MED file, previously created by partitionneDomaine()
156          *   (=> each part only contain 1 mesh, TETRA10 elements only)
157          * - nbPart > 1
158          * - partitionner METIS=0 or SCOTCH=1
159          * \return the name of each part.
160          */
161         string_array partitionneGroupe(
162                 in string partName,
163                 in long   nbParts,
164                 in long   partitionner)
165                 raises (SALOME::SALOME_Exception);
166
167         /*!
168          * Create 3 resolutions of the given part of a distributed MED file (V2.3).
169          * Assume:
170          * - the file is a distributed MED file, previously created by
171          *   partitionneDomaine() or partitionneGrain()
172          *   (=> each part only contain 1 mesh, TETRA10 elements only)
173          */
174         string_array decimePartition(
175                 in string partName,
176                 in string fieldName,
177                 in long   fieldIt,
178                 in string filterName,
179                 in string filterParams)
180                 raises (SALOME::SALOME_Exception);
181
182         /*!
183          * Return useful information to configure decimation parameters.
184          * Depends on part, field and filter: generic operation.
185          */
186         string evalDecimationParams(
187                 in string partName,
188                 in string fieldName,
189                 in long   fieldIt,
190                 in string filterName,
191                 in string filterParams)
192                 raises (SALOME::SALOME_Exception);
193
194         /*!
195          * Remove all the parts starting with the given prefix from the distributed MED file.
196          * Example: if prefixPartName="PART_4" => remove "PART_4" and all sub-parts "PART_4_*",
197          * but not "PART41".
198          * Assume this object encapsulates a distributed MED file.
199          */
200         void removeParts(in string prefixPartName)
201                 raises (SALOME::SALOME_Exception);
202
203         /*!
204          * Get mesh statistics.
205          */
206         string getMEDInfo(
207                 in string partName)
208                 raises (SALOME::SALOME_Exception);
209
210         //---------------------------------------------------------------------
211         // i/o
212         //--------------------------------------------------------------------
213
214         /*!
215          * Save the current distributed MED file to disk.
216          */
217         void save(in string path)
218                 raises (SALOME::SALOME_Exception);
219
220     /*!
221      * Check save progress.
222      * \return current save progress in percents.
223      */
224     long getSaveProgress();
225
226     /*!
227      * Reset save progress to zero.
228      */
229     void resetSaveProgress();
230
231 }; // interface MULTIPR_Obj
232
233
234 //*************************************************************************
235 // Interface of the %MULTIPR component; used to create MULTIPR_Obj object
236 // and to define high level API.
237 //*************************************************************************
238 interface MULTIPR_Gen : Engines::EngineComponent, SALOMEDS::Driver
239 {
240         /*!
241          * Return the version of the MULTIPR library.
242          */
243         string getVersion()
244                 raises (SALOME::SALOME_Exception);
245
246         //------------------------------------------------------------------------
247         // High level API
248         // Directly apply one of the 3 main operations of the MULTIPR module on a MED file
249         //------------------------------------------------------------------------
250
251         /*!
252          * Create a distributed MED file (v2.3) by extracting all the groups from the
253          * mesh of a sequential MED file.
254          * High level function.
255          */
256         void partitionneDomaine(
257                 in string medFilename,
258                 in string meshName)
259                 raises (SALOME::SALOME_Exception);
260
261         /*!
262          * Create a distributed MED file (V2.3) by splitting a group of a MED file
263          * previously created by partitionneDomaine().
264          * High level function.
265          */
266         void partitionneGroupe(
267                 in string medFilename,
268                 in string partName,
269                 in long   nbParts,
270                 in long   partitionner) // 0=METIS 1=SCOTCH
271                 raises (SALOME::SALOME_Exception);
272
273         /*!
274          * Creates 3 resolutions of the given part of a distributed MED file (V2.3).
275          * High level function.
276          */
277         void decimePartition(
278                 in string medFilename,
279                 in string partName,
280                 in string fieldName,
281                 in long   fieldIt,
282                 in string filterName,
283                 in string filterParams)
284                 raises (SALOME::SALOME_Exception);
285
286         //------------------------------------------------------------------------
287         // Low level API
288         // Create an object to encapsulate a MED file.
289         //------------------------------------------------------------------------
290
291         /*!
292          * Create a MULTIPR_Obj object which encapsulate a MED file.
293          */
294         MULTIPR_Obj getObject(in string medFilename)
295                 raises (SALOME::SALOME_Exception);
296
297     //------------------------------------------------------------------------
298     // Engine API
299     // Methods to correctly serve Persistence and Dump Python.
300     //------------------------------------------------------------------------
301
302     /*!
303      * Set the current study
304      */
305     void SetCurrentStudy (in SALOMEDS::Study theStudy);
306
307     /*!
308      * Get the current study
309      */
310     SALOMEDS::Study GetCurrentStudy();
311
312
313 }; // interface MULTIPR_Gen
314
315
316 }; // module MULTIPR_ORB
317
318 #endif // __MULTIPR_INTERFACE_CORBA__