Salome HOME
Modifs apportées dans le build_configure et le configure.in.base du module MED.
[modules/med.git] / idl / MED.idl
1 // File: MED.idl
2 // Project: SALOME
3 // Copyright : CEA/DEN/DMSS/LGLS
4 // $Header$
5
6 #ifndef MED_IDL
7 #define MED_IDL
8
9 #include "SALOME_Exception.idl"
10 #include "SALOME_Component.idl"
11 #include "SALOMEDS.idl"
12
13 module Engines {
14   /*!
15     An array of long
16   */
17   typedef sequence<long> long_array;
18   /*!
19     An array of double
20   */
21   typedef sequence<double> double_array;
22   /*!
23     An array of string
24   */
25   typedef sequence<string> string_array;
26   /*!
27     An array of boolean
28   */
29   typedef sequence<boolean> boolean_array;
30
31 };
32
33 module SALOME_MED {
34
35   //  interface FIELD;
36   interface FIELD;
37   interface FAMILY;
38   interface GROUP;
39   interface MESH;
40   interface SUPPORT;
41
42   enum medGeometryElement {
43     MED_NONE,
44     MED_POINT1,
45     MED_SEG2,
46     MED_SEG3,
47     MED_TRIA3,
48     MED_QUAD4,
49     MED_TRIA6,
50     MED_QUAD8,
51     MED_TETRA4,
52     MED_PYRA5,
53     MED_PENTA6,
54     MED_HEXA8,
55     MED_TETRA10,
56     MED_PYRA13,
57     MED_PENTA15,
58     MED_HEXA20,
59     MED_ALL_ELEMENTS
60   };
61
62   enum medEntityMesh {
63     MED_CELL,
64     MED_FACE,
65     MED_EDGE,
66     MED_NODE,
67     MED_ALL_ENTITIES
68   };
69
70   enum medModeSwitch {
71     MED_FULL_INTERLACE,
72     MED_NO_INTERLACE
73   };
74
75   enum medConnectivity {
76     MED_NODAL,
77     MED_DESCENDING
78   };
79
80   enum medDriverTypes {
81     MED_DRIVER , 
82     VTK_DRIVER , 
83     NO_DRIVER  
84   };
85
86   /*!
87     An array of medGeometryElement
88   */
89   typedef sequence<medGeometryElement> medGeometryElement_array;
90   /*!
91     An array of FAMILY
92   */
93   typedef sequence<FAMILY> Family_array;
94   /*!
95     An array of GROUP
96   */
97   typedef sequence<GROUP> Group_array;
98   
99   // ----------------------
100   // mesh interface
101   // ----------------------
102
103   interface MESH {
104     // Index range begins at 1
105
106     // General Informations
107     //---------------------
108
109     /*!
110       Returns mesh name.
111     */
112     string getName() raises (SALOME::SALOME_Exception);
113     
114     /*!
115       Returns space dimension.
116     */
117     long getSpaceDimension() raises (SALOME::SALOME_Exception);
118
119     /*!
120       Returns mesh dimension.
121       
122       Example :
123       - we have only MED_TETRA4 in MED_CELL : MeshDimension = 3
124       - we have only MED_QUAD4 in MED_CELL : MeshDimension = 2
125       - we have both MED_SEG2 and MED_TRIA3 in MED_CELL : MeshDimension = 2
126     */
127     long getMeshDimension() raises (SALOME::SALOME_Exception);
128
129     // Coordinates
130     //------------
131
132     /*!
133       Returns coordinate's system :
134       - "CARTESIAN"
135       - "CYLINDRICAL"
136       - "SPHERICAL"
137     */
138     string getCoordinateSystem() raises (SALOME::SALOME_Exception); 
139
140     /*!
141       Returns the number of nodes defined in mesh.
142     */
143     long getNumberOfNodes() raises (SALOME::SALOME_Exception);
144
145     /*!
146       Returns coordinates array :
147       - X1,Y1,Z1,X2,Y2,...,Zn if MED_FULL_INTERLACE
148       - X1,X2,...Xn,Y1,Y2,...Zn if MED_NO_INTERLACE
149     */
150     Engines::double_array getCoordinates(in medModeSwitch typeSwitch)
151       raises (SALOME::SALOME_Exception);
152
153     /*!
154       Returns an array with names of coordinates.
155       
156       Example :
157       - x,y,z
158       - r,teta,phi
159       - ...
160       
161       It could be empty.
162     */
163     Engines::string_array getCoordinatesNames()
164       raises (SALOME::SALOME_Exception);
165
166     /*!
167       Returns an array with units of coordinates (cm, m, mm, ...)
168
169       It could be empty. We suppose we are IS (meter).
170     */
171     Engines::string_array getCoordinatesUnits()
172       raises (SALOME::SALOME_Exception);
173
174     // Connectivity
175     // ------------
176
177     /*!
178       Returns the number of different <medGeometryElement> types existing 
179       in the specified entity.
180
181       Note : Not implemented for MED_ALL_ENTITIES.
182     */
183     long getNumberOfTypes(in medEntityMesh entity)
184       raises (SALOME::SALOME_Exception);
185
186     /*!
187       Returns an array of all <med geometry elements> types existing 
188       in the mesh.
189
190       Note : Not implemented for MED_ALL_ENTITIES.
191     */
192     medGeometryElement_array getTypes(in medEntityMesh entity)
193       raises (SALOME::SALOME_Exception);
194
195     /*!
196       Returns the number of elements of type <med geometrie element>.
197
198       Note : 
199       - Implemented for MED_ALL_ELEMENTS
200       - Not implemented for MED_ALL_ENTITIES
201     */
202     long getNumberOfElements(in medEntityMesh entity,
203                              in medGeometryElement geomElement)
204       raises (SALOME::SALOME_Exception);
205
206     /*!
207       Give, in full or no interlace mode (for nodal connectivity),
208       descending or nodal connectivity.
209
210       You must give a <medEntityMesh> (ie:MED_EDGE) and a 
211       <medGeometryElement> (ie:MED_SEG3).
212     */
213     Engines::long_array getConnectivity(in medModeSwitch typeSwitch,
214                                         in medConnectivity mode,
215                                         in medEntityMesh entity,
216                                         in medGeometryElement geomElement)
217       raises (SALOME::SALOME_Exception);
218
219     /*!
220       Give morse index array to use with 
221       getConnectivity(MED_FULL_INTERLACE,mode,entity,MED_ALL_ELEMENTS).
222
223       Each value give start index for corresponding entity in 
224       connectivity array.
225
226       Example : i-th element, j-th node of it :
227       - In C mode : Connectivity[ConnectivityIndex[i]-1+j-1]
228       - In fortran mode : Connectivity[ConnectivityIndex[i]+j]
229     */
230     Engines::long_array getConnectivityIndex(in medConnectivity mode,
231                                              in medEntityMesh entity)
232       raises (SALOME::SALOME_Exception);
233
234     /*!
235       Get global number of element which have same connectivity than 
236       connectivity argument.
237     */
238     long getElementNumber(in medConnectivity mode, 
239                           in medEntityMesh entity, 
240                           in medGeometryElement type, 
241                           in Engines::long_array connectivity) 
242       raises (SALOME::SALOME_Exception);
243
244     /*!
245       Return a reverse connectivity to MED_CELL.
246
247       If mode=MED_NODAL, the array contains, for each node, all cells 
248       arround it.
249
250       If mode=MED_DESCENDING, the array contains, for each face (or edge), 
251       the 2 cells of each side. First is cell which face normal is outgoing.
252     */
253     Engines::long_array getReverseConnectivity(in medConnectivity mode)
254       raises (SALOME::SALOME_Exception);
255
256     /*!
257       Give index array to use with getReverseConnectivity(MED_NODAL).
258
259       It is unusefull with MED_DESCENDING mode, 
260       because we have allways two cells.
261
262       See getConnectivityIndex for details.
263     */
264     Engines::long_array getReverseConnectivityIndex(in medConnectivity mode)
265       raises (SALOME::SALOME_Exception);
266
267     // Families and Groups
268     // -------------------
269
270     /*!
271       Returns the number of all families.
272     */
273     long getNumberOfFamilies(in medEntityMesh entity)
274       raises (SALOME::SALOME_Exception);
275
276     /*!
277       Returns the number of all groups.
278     */
279     long getNumberOfGroups(in medEntityMesh entity)
280       raises (SALOME::SALOME_Exception);
281
282     /*!
283       Returns an array of all families.
284     */
285     Family_array getFamilies(in medEntityMesh entity)
286       raises (SALOME::SALOME_Exception);
287
288     /*!
289       Returns a reference to i-th to family.
290
291       Note : i is bounded by 1 and NumberOfFamilies.
292     */
293     FAMILY getFamily(in medEntityMesh entity,in long familyNumber)
294       raises (SALOME::SALOME_Exception);
295
296     /*!
297       Returns an array of all groups.
298     */
299     Group_array getGroups(in medEntityMesh entity)
300       raises (SALOME::SALOME_Exception);
301
302     /*!
303       Returns a reference to i-th group.
304
305       Note : i is bounded by 1 and NumberOfGroups.
306     */
307     GROUP getGroup(in medEntityMesh entity,in long groupNumber)
308       raises (SALOME::SALOME_Exception);
309
310     // Others
311     // ------
312
313     /*!
314       Returns a field on mySupport containing volume.
315
316       Note : mySupport must be on MED_CELL entity and MeshDimension must be 3.
317     */
318     FIELD getVolume(in SUPPORT mySupport)
319       raises (SALOME::SALOME_Exception);
320
321     /*!
322       Returns a field on mySupport containing area.
323
324       Note : mySupport must be on MED_FACE entity.
325     */
326     FIELD getArea(in SUPPORT mySupport)
327       raises (SALOME::SALOME_Exception);
328
329     /*!
330       Returns a field on mySupport containing length.
331
332       Note : mySupport must be on MED_EDGE entity.
333     */
334     FIELD getLength(in SUPPORT mySupport)
335       raises (SALOME::SALOME_Exception);
336
337     /*!
338       Returns a field on mySupport containing normal.
339
340       Note : mySupport must be on MED_FACE entity if MeshDimension and 
341       SpaceDimension=3 and on MED_EDGE if MeshDimension and SpaceDimension=2.
342     */
343     FIELD getNormal(in SUPPORT mySupport)
344       raises (SALOME::SALOME_Exception);
345
346     /*!
347       Returns a field on mySupport containing barycenter.
348     */
349     FIELD getBarycenter(in SUPPORT mySupport)
350       raises (SALOME::SALOME_Exception);
351
352     /*
353       Returns a field on mySupport containing neighbourhood.
354     */
355     // FIELD getNeighbourhood(in SUPPORT mySupport)
356     // raises (SALOME::SALOME_Exception);
357
358     // Read & Write
359     // -----------
360
361     /*!
362       Add the Mesh in the StudyManager.
363     */
364     void addInStudy(in SALOMEDS::Study myStudy, in MESH myIor )
365       raises (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
366
367     //                          Add a MED/VTK/... driver
368     //                          Multiple drivers can be added whatever the type
369     long addDriver     (in medDriverTypes driverType, in string  fileName, in string meshName) 
370                                         raises (SALOME::SALOME_Exception);
371     //                          Remove a driver
372     void rmDriver      (in long i)  raises (SALOME::SALOME_Exception);
373
374    //
375     void read          (in long i)  raises (SALOME::SALOME_Exception);
376     void write         (in long i, in string driverMeshName)  
377                                     raises (SALOME::SALOME_Exception);
378   
379   //                            Cuisine Interne/Internal Kitchen
380     long getCorbaIndex()        raises (SALOME::SALOME_Exception);
381   };
382
383   
384   // ----------------------
385   // Support interface
386   // ----------------------
387   
388   interface SUPPORT {
389     
390     /*!
391       Returns the name of the support.
392     */
393     string getName() raises (SALOME::SALOME_Exception);
394
395     /*!
396       Returns the description of the support.
397     */
398     string getDescription() raises (SALOME::SALOME_Exception);
399
400     /*!
401       Returns a reference to the mesh.
402     */
403     MESH getMesh() raises (SALOME::SALOME_Exception);
404
405     /*!
406       Returns the medEntityMesh's type used by the support. 
407
408       Note : A support deals only with one entity's type 
409       (for example : MED_FACE or MED_NODE)
410     */
411     medEntityMesh getEntity() raises (SALOME::SALOME_Exception);
412
413     /*!
414       Returns true if all elements of this entity are
415       concerned, false otherwise.
416
417       If true, you must use mesh reference (getMesh) to get more information.
418     */
419     boolean isOnAllElements() raises (SALOME::SALOME_Exception);
420
421     /*!
422       If isOnAllElements is false, returns number of elements in the
423       support.
424
425       Example : number of MED_TRIA3 or MED_ALL_ELEMETNS elements 
426       in entity of support.
427
428       Note : If SUPPORT is defined on MED_NODE, use MED_NONE 
429       medGeometryElement type.
430     */
431     long getNumberOfElements(in medGeometryElement geomElement)
432       raises (SALOME::SALOME_Exception);
433
434     /*!
435       If isOnAllElements is false, returns an array of <medGeometryElement>
436       types used by the support.
437
438       <medEntityMesh> is given by getEntity.
439     */
440     medGeometryElement_array getTypes() raises (SALOME::SALOME_Exception);
441
442     /*!
443       If isOnAllElements is false, returns an array which contains
444       all number of given medGeometryElement.
445
446       Numbering is global, ie numbers are bounded by 1 and 
447       MESH::getNumberOfElement(entity,MED_ALL_ELEMENTS) and not by 1 and 
448       MESH::getNumberOfElement(entity,geomElement).
449
450       Note : If SUPPORT is defined on MED_NODE, use MED_NONE 
451       medGeometryElement type.
452     */
453     Engines::long_array getNumber(in medGeometryElement geomElement)
454       raises (SALOME::SALOME_Exception);
455
456     /*!
457       If isOnAllElements is false, returns index of element number.
458       
459       Use it with getNumber(MED_ALL_ELEMENTS). 
460       
461       Note : See getConnectivityIndex for details.
462     */
463     Engines::long_array getNumberIndex()
464       raises (SALOME::SALOME_Exception);
465     /*!
466       Returns number of Gauss points for this medGeometryElement.
467
468       Note : 
469       - Not defined if SUPPORT is on MED_NODE.
470       - Not defined for MED_ALL_ELEMENTS medGeometryElement type.
471      */
472     long getNumberOfGaussPoints(in medGeometryElement geomElement)
473                                         raises (SALOME::SALOME_Exception);
474
475     //                                  Cuisine Interne
476     long getCorbaIndex()                raises (SALOME::SALOME_Exception);
477   };
478
479
480   //-----------------
481   // Family interface
482   //-----------------
483
484   interface FAMILY : SUPPORT 
485     {
486
487       /*!
488         Returns Family identifier (Identifier
489         of the family in the mesh). 
490
491         Note : There is precisely one for each family.
492       */
493       long getIdentifier() raises (SALOME::SALOME_Exception);
494
495       /*!
496         Returns number of attributes.
497       */
498       long getNumberOfAttributes() raises (SALOME::SALOME_Exception);
499
500       /*!
501         Returns an array of all attributes' identifiers.
502         There is one for each attribute.
503       */
504       Engines::long_array getAttributesIdentifiers() 
505         raises (SALOME::SALOME_Exception);
506
507       /*!
508         Returns identifier of i-th attribute.
509
510         Note : i is bounded by 1 and NumberOfAttributes.
511       */
512       long getAttributeIdentifier(in long i) raises (SALOME::SALOME_Exception);
513
514       /*!
515         Returns an array of all attributes values.
516         There is one for each attribute.
517       */
518       Engines::long_array getAttributesValues() 
519         raises (SALOME::SALOME_Exception);
520
521       /*!
522         Returns value of i-th attribute.
523
524         Note : i is bounded by 1 and NumberOfAttributes.
525       */
526       long getAttributeValue(in long i) raises (SALOME::SALOME_Exception);
527
528       /*!
529         Returns an array of all attributes descriptions.
530         There is one for each attribute.
531       */
532       Engines::string_array getAttributesDescriptions() 
533         raises (SALOME::SALOME_Exception);
534
535       /*!
536         Returns description of i-th attribute.
537
538         Note : i is bounded by 1 and NumberOfAttributes.
539       */
540       string getAttributeDescription(in long i) 
541         raises (SALOME::SALOME_Exception);
542     };
543
544
545   //----------------
546   // Group interface
547   //----------------
548   interface GROUP : SUPPORT 
549     {
550
551       /*!
552         Returns number of families in this group.
553       */
554       long getNumberOfFamilies() raises (SALOME::SALOME_Exception);
555
556       /*!
557         Returns array of all families.
558       */
559       Family_array getFamilies() raises (SALOME::SALOME_Exception);
560
561       /*!
562         Returns a reference for the i-th family.
563
564         Note : i is bounded by 1 and NumberOfFamilies.
565       */
566       FAMILY getFamily(in long i) raises (SALOME::SALOME_Exception);
567
568     };
569
570
571   //----------------
572   // Field interface
573   //----------------
574
575   interface FIELD 
576     {
577
578       /*!
579         Returns the field name.
580       */
581       string getName() raises (SALOME::SALOME_Exception);
582
583       /*!
584         Returns the field description.
585       */
586       string getDescription() raises (SALOME::SALOME_Exception);
587
588       /*!
589         Returns a reference to the support
590         on which the field is defined.
591       */
592       SUPPORT getSupport() raises (SALOME::SALOME_Exception);
593
594       /*!
595         Returns the number of field's components.
596       */
597       long getNumberOfComponents() raises (SALOME::SALOME_Exception);
598
599       /*!
600         Returns an array containing components names.
601       */
602       Engines::string_array getComponentsNames() 
603         raises (SALOME::SALOME_Exception);
604
605       /*!
606         Returns the name of i-th component.
607
608         Note : 
609         - i is bounded by 1 and NumberOfComponents.
610         - Name is mandatory foreach field's component.
611       */
612       string getComponentName(in long i) raises (SALOME::SALOME_Exception);
613
614       /*!
615         Returns an array containing components units.
616       */
617       Engines::string_array getComponentsUnits()
618         raises (SALOME::SALOME_Exception);
619
620       /*!
621         Returns the unit of i-th component.
622
623         Note : i is bounded by 1 and NumberOfComponents.
624       */
625       string getComponentUnit(in long i) raises (SALOME::SALOME_Exception);
626
627
628       long getIterationNumber() raises (SALOME::SALOME_Exception);
629
630       /*!
631         Returns time for this iteration.
632       */
633       double getTime() raises (SALOME::SALOME_Exception);
634
635       /*!
636         Returns order number use for 
637         internal step in this iteration.
638       */
639       long getOrderNumber() raises (SALOME::SALOME_Exception);
640
641       // Read & Write
642       // -----------
643       
644       long addDriver (in medDriverTypes driverType, in string  fileName, in string fieldName) 
645         raises (SALOME::SALOME_Exception);
646       
647       //                          Remove a driver
648       void rmDriver (in long i)
649         raises (SALOME::SALOME_Exception);
650       
651       //
652       void read (in long i)
653         raises (SALOME::SALOME_Exception);
654
655       /*!
656         Write field.
657       */
658       void write (in long i, in string driverFieldName)  
659         raises (SALOME::SALOME_Exception);
660       
661       /*!
662         Add the Field in the StudyManager.
663       */
664       void addInStudy(in SALOMEDS::Study myStudy, in FIELD myIor )
665         raises (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
666
667       //                                        Cuisine Interne
668       long getCorbaIndex()
669         raises (SALOME::SALOME_Exception);
670
671     };
672
673
674   interface FIELDDOUBLE : FIELD {
675
676     /*!
677       Returns the field values array
678     */
679     Engines::double_array getValue(in medModeSwitch mode)
680       raises (SALOME::SALOME_Exception);
681   };
682
683   interface FIELDINT : FIELD {
684
685     /*!
686       Returns the field values array
687     */
688     Engines::long_array getValue(in medModeSwitch mode)
689       raises (SALOME::SALOME_Exception);
690
691   };
692
693   // MED interface
694
695   interface MED {
696
697
698     long                   getNumberOfMeshes () raises (SALOME::SALOME_Exception);       
699     long                   getNumberOfFields () raises (SALOME::SALOME_Exception);
700     Engines::string_array  getMeshNames      () raises (SALOME::SALOME_Exception);
701     Engines::string_array  getFieldNames     () raises (SALOME::SALOME_Exception);
702     MESH                   getMeshByName     ( in string  meshName)  raises (SALOME::SALOME_Exception);
703     MESH                   getMesh           ( in FIELD  fieldPtr)   raises (SALOME::SALOME_Exception);
704     FIELD                  getField          ( in string fieldName, 
705                                                in long pasTemps,
706                                                in long numOrdre )    raises (SALOME::SALOME_Exception);
707
708
709     // Add a MED/VTK/... driver to a MED'GEN' object to 
710     // be able to read/write files preserving  meshes<-->fields association
711     // Multiple drivers can be added whatever the type.
712     // The access point in the <long> returned
713     long addDriver     (in medDriverTypes driverType, in string  fileName) 
714                                         raises (SALOME::SALOME_Exception);
715     // Remove the driver
716     void rmDriver      (in long i)  raises (SALOME::SALOME_Exception);
717     
718     void readFileStruct(in long i)  raises (SALOME::SALOME_Exception);
719     void writeFrom     (in long i)  raises (SALOME::SALOME_Exception);
720     void write         (in long i)  raises (SALOME::SALOME_Exception);
721
722     void addMesh  (in MESH   ptrMesh   ) raises (SALOME::SALOME_Exception);
723     void addField (in FIELD  ptrField  ) raises (SALOME::SALOME_Exception);
724     
725     void addInStudy (in SALOMEDS::Study myStudy, in MED medPtr) raises (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
726   };
727 };
728
729 #endif /* MED_IDL */