1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Partitioning/decimation module for the SALOME v3.2 platform
21 // Interface CORBA for the MULTIPR module
22 // Author: Olivier LE ROUX - CS, Virtual Reality Dpt
25 #ifndef __MULTIPR_INTERFACE_CORBA__
26 #define __MULTIPR_INTERFACE_CORBA__
28 #include "SALOME_Exception.idl"
29 #include "SALOME_Component.idl"
30 #include "SALOME_GenericObj.idl"
31 #include "SALOMEDS.idl" // to access study
36 * This package contains the interface MULTIPR_ORB used for %MULTIPR component.
42 typedef sequence<string> string_array;
45 //*************************************************************************
46 // Interface of the %MULTIPR component used to manage partition/decimation
47 //*************************************************************************
49 interface MULTIPR_Obj : SALOME::GenericObj
52 //---------------------------------------------------------------------
53 // Basic accessors/mutators
54 //--------------------------------------------------------------------
62 * Return true iff this obj represents a valid sequential MED file.
64 boolean isValidSequentialMEDFile();
67 * Return true iff this obj represents a valid distributed MED file.
69 boolean isValidDistributedMEDFile();
72 * Return the name of the associated MED file.
75 raises (SALOME::SALOME_Exception);
78 * Return the name of the associated sequential MED file (for a distributed MED file).
80 string getSeqFilename()
81 raises (SALOME::SALOME_Exception);
84 * Set the mesh to be partitionned/decimated.
85 * Assume sequential MED file.
87 void setMesh(in string meshName)
88 raises (SALOME::SALOME_Exception);
91 * Set the boxing parameter used for decimation (100 by default).
93 void setBoxing(in long boxing)
94 raises (SALOME::SALOME_Exception);
97 * Return the list of meshes contained in the associated MED file.
99 string_array getMeshes()
100 raises (SALOME::SALOME_Exception);
103 * Return the list of fields contained in the current mesh of the associated MED file.
105 string_array getFields(in string pPartList)
106 raises (SALOME::SALOME_Exception);
109 * Return the number of iterations for a given field.
111 long getTimeStamps(in string pPartList, in string fieldName)
112 raises (SALOME::SALOME_Exception);
115 * Get the minimum and maximum value of a part's field.
117 void getFieldMinMax(in string pPartName, in string pFieldName, inout float pMin, inout float pMax)
118 raises (SALOME::SALOME_Exception);
121 * Return the name of all partitions.
122 * Assume this object encapsulates a distributed MED file.
124 string_array getParts()
125 raises (SALOME::SALOME_Exception);
128 * Return all information about a part.
129 * Assume this object encapsulates a distributed MED file.
131 string getPartInfo(in string partName)
132 raises (SALOME::SALOME_Exception);
134 //---------------------------------------------------------------------
136 //--------------------------------------------------------------------
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.
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.
148 string_array partitionneDomaine()
149 raises (SALOME::SALOME_Exception);
152 * Create a distributed MED file (V2.3) by splitting a group of a MED file
153 * previously created by partitionneDomaine.
155 * - the file is a distributed MED file, previously created by partitionneDomaine()
156 * (=> each part only contain 1 mesh, TETRA10 elements only)
158 * - partitionner METIS=0 or SCOTCH=1
159 * \return the name of each part.
161 string_array partitionneGroupe(
164 in long partitionner)
165 raises (SALOME::SALOME_Exception);
168 * Create 3 resolutions of the given part of a distributed MED file (V2.3).
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)
174 string_array decimePartition(
178 in string filterName,
179 in string filterParams)
180 raises (SALOME::SALOME_Exception);
183 * Return useful information to configure decimation parameters.
184 * Depends on part, field and filter: generic operation.
186 string evalDecimationParams(
190 in string filterName,
191 in string filterParams)
192 raises (SALOME::SALOME_Exception);
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_*",
198 * Assume this object encapsulates a distributed MED file.
200 void removeParts(in string prefixPartName)
201 raises (SALOME::SALOME_Exception);
204 * Get mesh statistics.
208 raises (SALOME::SALOME_Exception);
210 //---------------------------------------------------------------------
212 //--------------------------------------------------------------------
215 * Save the current distributed MED file to disk.
217 void save(in string path)
218 raises (SALOME::SALOME_Exception);
221 * Check save progress.
222 * \return current save progress in percents.
224 long getSaveProgress();
227 * Reset save progress to zero.
229 void resetSaveProgress();
231 }; // interface MULTIPR_Obj
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
241 * Return the version of the MULTIPR library.
244 raises (SALOME::SALOME_Exception);
246 //------------------------------------------------------------------------
248 // Directly apply one of the 3 main operations of the MULTIPR module on a MED file
249 //------------------------------------------------------------------------
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.
256 void partitionneDomaine(
257 in string medFilename,
259 raises (SALOME::SALOME_Exception);
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.
266 void partitionneGroupe(
267 in string medFilename,
270 in long partitionner) // 0=METIS 1=SCOTCH
271 raises (SALOME::SALOME_Exception);
274 * Creates 3 resolutions of the given part of a distributed MED file (V2.3).
275 * High level function.
277 void decimePartition(
278 in string medFilename,
282 in string filterName,
283 in string filterParams)
284 raises (SALOME::SALOME_Exception);
286 //------------------------------------------------------------------------
288 // Create an object to encapsulate a MED file.
289 //------------------------------------------------------------------------
292 * Create a MULTIPR_Obj object which encapsulate a MED file.
294 MULTIPR_Obj getObject(in string medFilename)
295 raises (SALOME::SALOME_Exception);
297 //------------------------------------------------------------------------
299 // Methods to correctly serve Persistence and Dump Python.
300 //------------------------------------------------------------------------
303 * Set the current study
305 void SetCurrentStudy (in SALOMEDS::Study theStudy);
308 * Get the current study
310 SALOMEDS::Study GetCurrentStudy();
313 }; // interface MULTIPR_Gen
316 }; // module MULTIPR_ORB
318 #endif // __MULTIPR_INTERFACE_CORBA__