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
20 // Partitioning/decimation module for the SALOME v3.2 platform
22 // Interface CORBA for the MULTIPR module
23 // Author: Olivier LE ROUX - CS, Virtual Reality Dpt
26 #ifndef __MULTIPR_INTERFACE_CORBA__
27 #define __MULTIPR_INTERFACE_CORBA__
29 #include "SALOME_Exception.idl"
30 #include "SALOME_Component.idl"
31 #include "SALOME_GenericObj.idl"
32 #include "SALOMEDS.idl" // to access study
37 * This package contains the interface MULTIPR_ORB used for %MULTIPR component.
43 typedef sequence<string> string_array;
46 //*************************************************************************
47 // Interface of the %MULTIPR component used to manage partition/decimation
48 //*************************************************************************
50 interface MULTIPR_Obj : SALOME::GenericObj
53 //---------------------------------------------------------------------
54 // Basic accessors/mutators
55 //--------------------------------------------------------------------
63 * Return true iff this obj represents a valid sequential MED file.
65 boolean isValidSequentialMEDFile();
68 * Return true iff this obj represents a valid distributed MED file.
70 boolean isValidDistributedMEDFile();
73 * Return the name of the associated MED file.
76 raises (SALOME::SALOME_Exception);
79 * Return the name of the associated sequential MED file (for a distributed MED file).
81 string getSeqFilename()
82 raises (SALOME::SALOME_Exception);
85 * Set the mesh to be partitionned/decimated.
86 * Assume sequential MED file.
88 void setMesh(in string meshName)
89 raises (SALOME::SALOME_Exception);
92 * Set the boxing parameter used for decimation (100 by default).
94 void setBoxing(in long boxing)
95 raises (SALOME::SALOME_Exception);
98 * Return the list of meshes contained in the associated MED file.
100 string_array getMeshes()
101 raises (SALOME::SALOME_Exception);
104 * Return the list of fields contained in the current mesh of the associated MED file.
106 string_array getFields(in string pPartList)
107 raises (SALOME::SALOME_Exception);
110 * Return the number of iterations for a given field.
112 long getTimeStamps(in string pPartList, in string fieldName)
113 raises (SALOME::SALOME_Exception);
116 * Get the minimum and maximum value of a part's field.
118 void getFieldMinMax(in string pPartName, in string pFieldName, inout float pMin, inout float pMax)
119 raises (SALOME::SALOME_Exception);
122 * Return the name of all partitions.
123 * Assume this object encapsulates a distributed MED file.
125 string_array getParts()
126 raises (SALOME::SALOME_Exception);
129 * Return all information about a part.
130 * Assume this object encapsulates a distributed MED file.
132 string getPartInfo(in string partName)
133 raises (SALOME::SALOME_Exception);
135 //---------------------------------------------------------------------
137 //--------------------------------------------------------------------
140 * Create a distributed MED file (v2.3) by extracting all the groups from the
141 * current mesh of the current MED sequential MED file.
143 * - the file is in MED format and can be read using MED file v2.3.
144 * - the file is sequential (not a distributed MED).
145 * - the file only contains TETRA10 elements (dimension of space and mesh is 3).
146 * - the file have no profil.
147 * \return the name of each part.
149 string_array partitionneDomaine()
150 raises (SALOME::SALOME_Exception);
153 * Create a distributed MED file (V2.3) by splitting a group of a MED file
154 * previously created by partitionneDomaine.
156 * - the file is a distributed MED file, previously created by partitionneDomaine()
157 * (=> each part only contain 1 mesh, TETRA10 elements only)
159 * - partitionner METIS=0 or SCOTCH=1
160 * \return the name of each part.
162 string_array partitionneGroupe(
165 in long partitionner)
166 raises (SALOME::SALOME_Exception);
169 * Create 3 resolutions of the given part of a distributed MED file (V2.3).
171 * - the file is a distributed MED file, previously created by
172 * partitionneDomaine() or partitionneGrain()
173 * (=> each part only contain 1 mesh, TETRA10 elements only)
175 string_array decimePartition(
179 in string filterName,
180 in string filterParams)
181 raises (SALOME::SALOME_Exception);
184 * Return useful information to configure decimation parameters.
185 * Depends on part, field and filter: generic operation.
187 string evalDecimationParams(
191 in string filterName,
192 in string filterParams)
193 raises (SALOME::SALOME_Exception);
196 * Remove all the parts starting with the given prefix from the distributed MED file.
197 * Example: if prefixPartName="PART_4" => remove "PART_4" and all sub-parts "PART_4_*",
199 * Assume this object encapsulates a distributed MED file.
201 void removeParts(in string prefixPartName)
202 raises (SALOME::SALOME_Exception);
205 * Get mesh statistics.
209 raises (SALOME::SALOME_Exception);
211 //---------------------------------------------------------------------
213 //--------------------------------------------------------------------
216 * Save the current distributed MED file to disk.
218 void save(in string path)
219 raises (SALOME::SALOME_Exception);
222 * Check save progress.
223 * \return current save progress in percents.
225 long getSaveProgress();
228 * Reset save progress to zero.
230 void resetSaveProgress();
232 }; // interface MULTIPR_Obj
235 //*************************************************************************
236 // Interface of the %MULTIPR component; used to create MULTIPR_Obj object
237 // and to define high level API.
238 //*************************************************************************
239 interface MULTIPR_Gen : Engines::Component, SALOMEDS::Driver
242 * Return the version of the MULTIPR library.
245 raises (SALOME::SALOME_Exception);
247 //------------------------------------------------------------------------
249 // Directly apply one of the 3 main operations of the MULTIPR module on a MED file
250 //------------------------------------------------------------------------
253 * Create a distributed MED file (v2.3) by extracting all the groups from the
254 * mesh of a sequential MED file.
255 * High level function.
257 void partitionneDomaine(
258 in string medFilename,
260 raises (SALOME::SALOME_Exception);
263 * Create a distributed MED file (V2.3) by splitting a group of a MED file
264 * previously created by partitionneDomaine().
265 * High level function.
267 void partitionneGroupe(
268 in string medFilename,
271 in long partitionner) // 0=METIS 1=SCOTCH
272 raises (SALOME::SALOME_Exception);
275 * Creates 3 resolutions of the given part of a distributed MED file (V2.3).
276 * High level function.
278 void decimePartition(
279 in string medFilename,
283 in string filterName,
284 in string filterParams)
285 raises (SALOME::SALOME_Exception);
287 //------------------------------------------------------------------------
289 // Create an object to encapsulate a MED file.
290 //------------------------------------------------------------------------
293 * Create a MULTIPR_Obj object which encapsulate a MED file.
295 MULTIPR_Obj getObject(in string medFilename)
296 raises (SALOME::SALOME_Exception);
298 //------------------------------------------------------------------------
300 // Methods to correctly serve Persistence and Dump Python.
301 //------------------------------------------------------------------------
304 * Set the current study
306 void SetCurrentStudy (in SALOMEDS::Study theStudy);
309 * Get the current study
311 SALOMEDS::Study GetCurrentStudy();
314 }; // interface MULTIPR_Gen
317 }; // module MULTIPR_ORB
319 #endif // __MULTIPR_INTERFACE_CORBA__