3 // Copyright : CEA/DEN/DMSS/LGLS
6 This file contains the main IDL definitions of the %MED component in %SALOME application.
11 \defgroup MED SALOME MED component
13 This component is dedicated to the mounting in memory of a .med file. some
14 services of that component store CORBA objects (MED, MESH, FIELD) in the
15 study and/or give a direct access to those objects.
18 #include "SALOME_Exception.idl"
19 #include "SALOME_Component.idl"
20 #include "SALOMEDS.idl"
26 typedef sequence<long> long_array;
30 typedef sequence<double> double_array;
34 typedef sequence<string> string_array;
38 typedef sequence<boolean> boolean_array;
41 This package contains a set of interfaces used for %SALOME %MED component.
52 This enumeration contains a set of elements defining the type of geometrical elements which constitue
55 typedef long medGeometryElement;
56 const medGeometryElement MED_NONE = 0;
57 const medGeometryElement MED_POINT1 = 1;
58 const medGeometryElement MED_SEG2 = 102;
59 const medGeometryElement MED_SEG3 = 103;
60 const medGeometryElement MED_TRIA3 = 203;
61 const medGeometryElement MED_QUAD4 = 204;
62 const medGeometryElement MED_TRIA6 = 206;
63 const medGeometryElement MED_QUAD8 = 208;
64 const medGeometryElement MED_TETRA4 = 304;
65 const medGeometryElement MED_PYRA5 = 305;
66 const medGeometryElement MED_PENTA6 = 306;
67 const medGeometryElement MED_HEXA8 = 308;
68 const medGeometryElement MED_TETRA10 = 310;
69 const medGeometryElement MED_PYRA13 = 313;
70 const medGeometryElement MED_PENTA15 = 315;
71 const medGeometryElement MED_HEXA20 = 320;
72 const medGeometryElement MED_ALL_ELEMENTS = 999;
76 This enumeration contains a set of elements defining the structural elements (entities) which constitue
79 typedef long medEntityMesh;
80 const medEntityMesh MED_CELL = 0;
81 const medEntityMesh MED_FACE = 1;
82 const medEntityMesh MED_EDGE = 2;
83 const medEntityMesh MED_NODE = 3;
84 const medEntityMesh MED_ALL_ENTITIES = 4;
87 This enumeration contains a set of modes to store data in an array.
88 For example an array of coordinates in 3D; tow storage may be considered:
90 - X1,Y1,Z1,X2,Y2,Z2,...,Xn,Yn,Zn if MED_FULL_INTERLACE
91 - X1,X2,...,Xn,Y1,Y2,...,Yn,Z1,Z2,...,Zn if MED_NO_INTERLACE
93 typedef long medModeSwitch;
94 const medModeSwitch MED_FULL_INTERLACE = 0;
95 const medModeSwitch MED_NO_INTERLACE = 1;
98 This enumeration contains a set of elements defining the type of connectivity.
100 typedef long medConnectivity;
101 const medConnectivity MED_NODAL = 0;
102 const medConnectivity MED_DESCENDING = 1;
106 enumeration contains a set of elements defining the type of driver.
108 typedef long medDriverTypes;
109 /*!<This driver is used for reading into memory of the mesh from %MED file.*/
110 const medDriverTypes MED_DRIVER = 0;
111 const medDriverTypes VTK_DRIVER = 1;
112 const medDriverTypes NO_DRIVER = 2;
115 An array of %medGeometryElement
117 typedef sequence<medGeometryElement> medGeometryElement_array;
122 typedef sequence<FAMILY> Family_array;
127 typedef sequence<GROUP> Group_array;
129 // ----------------------
131 // ----------------------
134 // Index range begins from 1
136 // General Informations
137 //---------------------
140 Returns the name of the mesh .
142 string getName() raises (SALOME::SALOME_Exception);
145 Returns space dimension.
147 long getSpaceDimension() raises (SALOME::SALOME_Exception);
150 Returns mesh dimension.
153 - we have only MED_TETRA4 in MED_CELL : MeshDimension = 3D
154 - we have only MED_QUAD4 in MED_CELL : MeshDimension = 2D
155 - we have both MED_SEG2 and MED_TRIA3 in MED_CELL : MeshDimension = 2D
157 long getMeshDimension() raises (SALOME::SALOME_Exception);
162 boolean getIsAGrid() raises (SALOME::SALOME_Exception);
167 boolean existConnectivity (in medConnectivity mode,
168 in medEntityMesh entity)
169 raises (SALOME::SALOME_Exception);
175 Returns coordinate system :
180 string getCoordinatesSystem() raises (SALOME::SALOME_Exception);
183 Returns the number of nodes defined in the mesh.
185 long getNumberOfNodes() raises (SALOME::SALOME_Exception);
188 Returns an array of coordinates stored in any type
190 SALOME_MED::double_array getCoordinates(in medModeSwitch typeSwitch)
191 raises (SALOME::SALOME_Exception);
194 Returns coordinate n° Number on axis n° Axis
196 double getCoordinate(in long Number, in long Axis)
197 raises (SALOME::SALOME_Exception);
201 Returns an array containing the names of coordinates.
210 SALOME_MED::string_array getCoordinatesNames()
211 raises (SALOME::SALOME_Exception);
214 Returns an array containing the units of coordinates (cm, m, mm, ...)
216 It could be empty. By defult IS is used (meter).
218 SALOME_MED::string_array getCoordinatesUnits()
219 raises (SALOME::SALOME_Exception);
222 Returns the %SUPPORT containing the boundary elements
226 SUPPORT getBoundaryElements(in medEntityMesh Entity)
227 raises (SALOME::SALOME_Exception);
230 Returns the %SUPPORT containing the boundary elements
231 of the support mySupport3D.
233 SUPPORT getSkin(in SUPPORT mySupport3D ) raises (SALOME::SALOME_Exception);
235 SALOME_MED::long_array getGlobalNumberingIndex(in medEntityMesh entity) ;
237 struct coordinateInfos
240 SALOME_MED::string_array coordNames;
241 SALOME_MED::string_array coordUnits;
243 coordinateInfos getCoordGlobal() raises (SALOME::SALOME_Exception);
251 Returns the number of defferent %medGeometryElement types existing
252 in the specified entity.
255 Not implemented for MED_ALL_ENTITIES.
257 long getNumberOfTypes(in medEntityMesh entity)
258 raises (SALOME::SALOME_Exception);
261 Returns an array of all %medGeometryElement types existing
265 Not implemented for MED_ALL_ENTITIES.
267 medGeometryElement_array getTypes(in medEntityMesh entity)
268 raises (SALOME::SALOME_Exception);
271 Returns the number of elements of type %medGeometryElement.
274 - Implemented for MED_ALL_ELEMENTS
275 - Not implemented for MED_ALL_ENTITIES
277 long getNumberOfElements(in medEntityMesh entity,
278 in medGeometryElement geomElement)
279 raises (SALOME::SALOME_Exception);
282 Give, in full or no interlace mode (for nodal connectivity),
283 descending or nodal connectivity.
285 You must give a %medEntityMesh (ie:MED_EDGE) and a
286 %medGeometryElement (ie:MED_SEG3).
288 SALOME_MED::long_array getConnectivity(in medModeSwitch typeSwitch,
289 in medConnectivity mode,
290 in medEntityMesh entity,
291 in medGeometryElement geomElement)
292 raises (SALOME::SALOME_Exception);
295 Give morse index array to use with
296 getConnectivity(MED_FULL_INTERLACE,mode,entity,MED_ALL_ELEMENTS).
298 Each value give start index for corresponding entity in
301 Example : i-th element, j-th node of it :
302 - In C mode : Connectivity[ConnectivityIndex[i]-1+j-1]
303 - In fortran mode : Connectivity[ConnectivityIndex[i]+j]
305 SALOME_MED::long_array getConnectivityIndex(in medConnectivity mode,
306 in medEntityMesh entity)
307 raises (SALOME::SALOME_Exception);
310 Gets a global number of the element which have the same connectivity as the
311 connectivity argument.
313 long getElementNumber(in medConnectivity mode,
314 in medEntityMesh entity,
315 in medGeometryElement type,
316 in SALOME_MED::long_array connectivity)
317 raises (SALOME::SALOME_Exception);
319 medGeometryElement getElementType (in medEntityMesh entity,
321 raises (SALOME::SALOME_Exception);
324 Returns a reverse connectivity to MED_CELL.
326 If mode=MED_NODAL, the array contains, for each node, all cells
329 If mode=MED_DESCENDING, the array contains, for each face (or edge),
330 the 2 cells of each side. First is cell which face normal is outgoing.
332 SALOME_MED::long_array getReverseConnectivity(in medConnectivity mode)
333 raises (SALOME::SALOME_Exception);
336 Give index array to use with getReverseConnectivity(MED_NODAL).
338 This method is not used with MED_DESCENDING mode,
339 because we have allways two cells.
341 See getConnectivityIndex for details.
343 SALOME_MED::long_array getReverseConnectivityIndex(in medConnectivity mode)
344 raises (SALOME::SALOME_Exception);
346 struct connectivityInfos
349 medGeometryElement_array meshTypes;
350 SALOME_MED::long_array numberOfElements;
352 connectivityInfos getConnectGlobal(in medEntityMesh entity)
353 raises (SALOME::SALOME_Exception);
355 // Families and Groups
356 // -------------------
359 Returns the number of all families.
361 long getNumberOfFamilies(in medEntityMesh entity)
362 raises (SALOME::SALOME_Exception);
365 Returns the number of all groups.
367 long getNumberOfGroups(in medEntityMesh entity)
368 raises (SALOME::SALOME_Exception);
371 Returns an array of all families.
373 Family_array getFamilies(in medEntityMesh entity)
374 raises (SALOME::SALOME_Exception);
377 Returns the reference to i-th family.
380 i is bounded by 1 and NumberOfFamilies.
382 FAMILY getFamily(in medEntityMesh entity,in long familyNumber)
383 raises (SALOME::SALOME_Exception);
386 Returns an array of all groups.
388 Group_array getGroups(in medEntityMesh entity)
389 raises (SALOME::SALOME_Exception);
392 Returns the reference to i-th group.
395 i is bounded by 1 and NumberOfGroups.
397 GROUP getGroup(in medEntityMesh entity,in long groupNumber)
398 raises (SALOME::SALOME_Exception);
404 Returns a field on mySupport containing volume.
407 mySupport must be on MED_CELL entity and MeshDimension must be 3D.
409 FIELD getVolume(in SUPPORT mySupport)
410 raises (SALOME::SALOME_Exception);
413 Returns a field on mySupport containing area.
416 mySupport must be on MED_FACE entity.
418 FIELD getArea(in SUPPORT mySupport)
419 raises (SALOME::SALOME_Exception);
422 Returns a field on mySupport containing length.
425 mySupport must be on MED_EDGE entity.
427 FIELD getLength(in SUPPORT mySupport)
428 raises (SALOME::SALOME_Exception);
431 Returns a field on mySupport containing normal.
434 mySupport must be on MED_FACE entity if MeshDimension and
435 SpaceDimension=3D and on MED_EDGE if MeshDimension and SpaceDimension=2D.
437 FIELD getNormal(in SUPPORT mySupport)
438 raises (SALOME::SALOME_Exception);
441 Returns a field on mySupport containing barycenter.
443 FIELD getBarycenter(in SUPPORT mySupport)
444 raises (SALOME::SALOME_Exception);
447 Returns a field on mySupport containing neighbourhood.
449 // FIELD getNeighbourhood(in SUPPORT mySupport)
450 // raises (SALOME::SALOME_Exception);
456 Adds the Mesh in the StudyManager.
458 void addInStudy(in SALOMEDS::Study myStudy, in MESH myIor )
459 raises (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
461 // Add a MED/VTK/... driver
462 // Multiple drivers can be added whatever the type
463 long addDriver (in medDriverTypes driverType, in string fileName, in string meshName)
464 raises (SALOME::SALOME_Exception);
466 void rmDriver (in long i) raises (SALOME::SALOME_Exception);
469 void read (in long i) raises (SALOME::SALOME_Exception);
470 void write (in long i, in string driverMeshName)
471 raises (SALOME::SALOME_Exception);
474 Internal Corba method.
476 long getCorbaIndex() raises (SALOME::SALOME_Exception);
480 long spaceDimension ;
484 Family_array famNode;
485 Family_array famEdge;
486 Family_array famFace;
487 Family_array famCell;
488 Group_array groupNode;
489 Group_array groupEdge;
490 Group_array groupFace;
491 Group_array groupCell;
493 meshInfos getMeshGlobal() raises (SALOME::SALOME_Exception);
497 // ----------------------
499 // ----------------------
504 Returns the name of the support.
506 string getName() raises (SALOME::SALOME_Exception);
509 Returns the description of the support.
511 string getDescription() raises (SALOME::SALOME_Exception);
514 Returns a reference to the mesh.
516 MESH getMesh() raises (SALOME::SALOME_Exception);
519 Returns the type of %medEntityMesh used by the support.
522 A support deals only with one entity's type
523 (for example : MED_FACE or MED_NODE)
525 medEntityMesh getEntity() raises (SALOME::SALOME_Exception);
528 Returns True if all elements of this entity are
529 engaged, False otherwise.
531 If True, you must use mesh reference (getMesh) to get more information.
533 boolean isOnAllElements() raises (SALOME::SALOME_Exception);
536 If the method %isOnAllElements() returns False, this method
537 returns the number of elements in the support.
539 Example : number of MED_TRIA3 or MED_ALL_ELEMETNS elements
540 in entity of support.
543 If %SUPPORT is defined on MED_NODE, use MED_NONE %medGeometryElement
546 long getNumberOfElements(in medGeometryElement geomElement)
547 raises (SALOME::SALOME_Exception);
549 long getNumberOfTypes() raises (SALOME::SALOME_Exception);
551 If isOnAllElements is False, returns an array of %medGeometryElement
552 types used by the support.
554 %medEntityMesh is given by getEntity.
556 medGeometryElement_array getTypes() raises (SALOME::SALOME_Exception);
560 If the method %isOnAllElements() returns False, this method returns an array which
561 contains all numbers of given %medGeometryElement.
563 Numbering is global, ie numbers are bounded by 1 and
564 MESH::getNumberOfElement(entity,MED_ALL_ELEMENTS) and not by 1 and
565 MESH::getNumberOfElement(entity,geomElement).
568 If %SUPPORT is defined on MED_NODE, use MED_NONE %medGeometryElement type.
570 SALOME_MED::long_array getNumber(in medGeometryElement geomElement)
571 raises (SALOME::SALOME_Exception);
574 If the method %isOnAllElements() returns False, this method returns the index
577 Use it with getNumber(MED_ALL_ELEMENTS).
580 See the method %getConnectivityIndex for more details.
582 SALOME_MED::long_array getNumberIndex()
583 raises (SALOME::SALOME_Exception);
585 Returns the number of Gauss points for this %medGeometryElement.
588 - Not defined if %SUPPORT is on MED_NODE.
589 - Not defined for MED_ALL_ELEMENTS %medGeometryElement type.
591 long getNumberOfGaussPoint(in medGeometryElement geomElement)
592 raises (SALOME::SALOME_Exception);
594 SALOME_MED::long_array getNumbersOfGaussPoint()
595 raises (SALOME::SALOME_Exception);
597 void getBoundaryElements()
598 raises (SALOME::SALOME_Exception);
600 Internal Corba method.
602 long getCorbaIndex() raises (SALOME::SALOME_Exception);
607 boolean isOnAllElements;
608 medEntityMesh entity;
609 long numberOfGeometricType;
610 medGeometryElement_array types;
611 SALOME_MED::long_array nbEltTypes;
613 supportInfos getSupportGlobal() raises (SALOME::SALOME_Exception);
622 interface FAMILY : SUPPORT
626 Returns Family identifier (Identifier
627 of the family in the mesh).
630 There is precisely only one indentifier for each family.
632 long getIdentifier() raises (SALOME::SALOME_Exception);
635 Returns number of attributes.
637 long getNumberOfAttributes() raises (SALOME::SALOME_Exception);
640 Returns an array of all attributes' identifiers.
641 There is one for each attribute.
643 SALOME_MED::long_array getAttributesIdentifiers()
644 raises (SALOME::SALOME_Exception);
647 Returns identifier of i-th attribute.
650 i is bounded by 1 and NumberOfAttributes.
652 long getAttributeIdentifier(in long i) raises (SALOME::SALOME_Exception);
655 Returns an array of all values of the attributes .
656 There is one value for each attribute.
658 SALOME_MED::long_array getAttributesValues()
659 raises (SALOME::SALOME_Exception);
662 Returns the value of i-th attribute.
665 i is bounded by 1 and NumberOfAttributes.
667 long getAttributeValue(in long i) raises (SALOME::SALOME_Exception);
670 Returns an array of all descriptions of the attributes .
671 There is one description for each attribute.
673 SALOME_MED::string_array getAttributesDescriptions()
674 raises (SALOME::SALOME_Exception);
677 Returns the description of i-th attribute.
680 i is bounded by 1 and NumberOfAttributes.
682 string getAttributeDescription(in long i)
683 raises (SALOME::SALOME_Exception);
686 Returns the number of groups the family belongs to.
688 long getNumberOfGroups()
689 raises (SALOME::SALOME_Exception);
692 Returns an array of names of groups the family belongs to .
693 There is one name for each group.
695 SALOME_MED::string_array getGroupsNames()
696 raises (SALOME::SALOME_Exception);
699 Returns the name of i-th group.
702 i is bounded by 1 and NumberOfAttributes.
704 string getGroupName(in long i)
705 raises (SALOME::SALOME_Exception);
714 interface GROUP : SUPPORT
718 Returns the number of families in this group.
720 long getNumberOfFamilies() raises (SALOME::SALOME_Exception);
723 Returns an array of all families.
725 Family_array getFamilies() raises (SALOME::SALOME_Exception);
728 Returns a reference to the i-th family.
731 i is bounded by 1 and NumberOfFamilies.
733 FAMILY getFamily(in long i) raises (SALOME::SALOME_Exception);
746 Returns the field name.
748 string getName() raises (SALOME::SALOME_Exception);
751 Returns the field description.
753 string getDescription() raises (SALOME::SALOME_Exception);
756 Returns a reference to the support
757 on which the field is defined.
759 SUPPORT getSupport() raises (SALOME::SALOME_Exception);
762 Returns the number of field's components.
764 long getNumberOfComponents() raises (SALOME::SALOME_Exception);
767 Returns an array containing components names.
769 SALOME_MED::string_array getComponentsNames()
770 raises (SALOME::SALOME_Exception);
773 Returns the name of i-th component.
776 - i is bounded by 1 and NumberOfComponents.
777 - Name is mandatory for each field's component.
779 string getComponentName(in long i) raises (SALOME::SALOME_Exception);
782 Returns an array containing components units.
784 SALOME_MED::string_array getComponentsUnits()
785 raises (SALOME::SALOME_Exception);
788 Returns the unit of i-th component.
791 i is bounded by 1 and NumberOfComponents.
793 string getComponentUnit(in long i) raises (SALOME::SALOME_Exception);
796 Returns the iteration number.
798 long getIterationNumber() raises (SALOME::SALOME_Exception);
801 Returns time for this iteration.
803 double getTime() raises (SALOME::SALOME_Exception);
806 Returns order number use for
807 internal step in this iteration.
809 long getOrderNumber() raises (SALOME::SALOME_Exception);
814 long addDriver (in medDriverTypes driverType, in string fileName, in string fieldName)
815 raises (SALOME::SALOME_Exception);
820 void rmDriver (in long i)
821 raises (SALOME::SALOME_Exception);
824 void read (in long i)
825 raises (SALOME::SALOME_Exception);
830 void write (in long i, in string driverFieldName)
831 raises (SALOME::SALOME_Exception);
834 Adds the Field in the StudyManager.
836 void addInStudy(in SALOMEDS::Study myStudy, in FIELD myIor )
837 raises (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
840 Internal Corba method.
843 raises (SALOME::SALOME_Exception);
848 interface FIELDDOUBLE : FIELD {
851 Returns an array of values of the field
853 SALOME_MED::double_array getValue(in medModeSwitch mode)
854 raises (SALOME::SALOME_Exception);
857 interface FIELDINT : FIELD {
860 Returns an array of values of the field
862 SALOME_MED::long_array getValue(in medModeSwitch mode)
863 raises (SALOME::SALOME_Exception);
871 returns the number of meshes in the %MED object.
873 long getNumberOfMeshes () raises (SALOME::SALOME_Exception);
875 returns the number of fields in the %MED object.
877 long getNumberOfFields () raises (SALOME::SALOME_Exception);
879 returns an array which contains the name of each meshes in the %MED object.
881 SALOME_MED::string_array getMeshNames () raises (SALOME::SALOME_Exception);
883 returns an array which contains the name of each fields in the %MED object.
885 SALOME_MED::string_array getFieldNames () raises (SALOME::SALOME_Exception);
887 giving a mesh name, it returns the corresponding %MESH pointer.
889 MESH getMeshByName ( in string meshName) raises (SALOME::SALOME_Exception);
891 giving a %FIELD pointer, it returns the corresponding %MESH pointer of the mesh
892 on which the field lies.
894 MESH getMesh ( in FIELD fieldPtr) raises (SALOME::SALOME_Exception);
896 giving a field name, it returns the number of iteration in the corresponding %FIELD object.
898 long getFieldNumberOfIteration(in string fieldName) raises (SALOME::SALOME_Exception);
900 giving a field name and an integer %i, it returns a couple of integers: the time iteration and
901 the order number of the %i^th iteration of the corresponding %FIELD object.
903 SALOME_MED::long_array getFieldIteration(in string fieldName, in long i) raises (SALOME::SALOME_Exception);
905 giving a field name, a time iteration and an order number, it returns the corresponding %FIELD oject.
907 FIELD getField ( in string fieldName,
909 in long numOrdre ) raises (SALOME::SALOME_Exception);
912 // Add a MED/VTK/... driver to a MED'GEN' object to
913 // be able to read/write files preserving meshes<-->fields association
914 // Multiple drivers can be added whatever the type.
915 // The access point in the <long> returned
916 long addDriver (in medDriverTypes driverType, in string fileName)
917 raises (SALOME::SALOME_Exception);
921 void rmDriver (in long i) raises (SALOME::SALOME_Exception);
923 Reads the structure of the %MED file
925 void readFileStruct(in long i) raises (SALOME::SALOME_Exception);
926 void writeFrom (in long i) raises (SALOME::SALOME_Exception);
927 void write (in long i) raises (SALOME::SALOME_Exception);
929 void addMesh (in MESH ptrMesh ) raises (SALOME::SALOME_Exception);
930 void addField (in FIELD ptrField ) raises (SALOME::SALOME_Exception);
932 void addInStudy (in SALOMEDS::Study myStudy, in MED medPtr) raises (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);