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