1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
26 This file contains the main IDL difinitions of the %MED component in %SALOME application.
31 \defgroup MED SALOME MED component
34 #include "SALOME_Exception.idl"
35 #include "SALOME_Component.idl"
36 #include "SALOMEDS.idl"
42 typedef sequence<long> long_array;
46 typedef sequence<double> double_array;
50 typedef sequence<string> string_array;
54 typedef sequence<boolean> boolean_array;
58 This package contains a set of interfaces used for %SALOME %MED component.
71 This enumeration conatains a set of elements difining the type of geometrical elements which constitue
74 enum medGeometryElement {
94 This enumeration conatains a set of elements difining the structural elements (entities) which constitue
111 enum medConnectivity {
116 This enumeration conatains a set of elements difining the type of driver.
119 enum medDriverTypes {
120 MED_DRIVER , /*!<This driver is used for reading into memory of the mesh from %MED file.*/
121 VTK_DRIVER , /*!<This driver is used for visualization of the mesh imported from %MED file.*/
126 An array of <VAR>medGeometryElement</VAR>
128 typedef sequence<medGeometryElement> medGeometryElement_array;
132 typedef sequence<FAMILY> Family_array;
136 typedef sequence<GROUP> Group_array;
138 // ----------------------
140 // ----------------------
143 // Index range begins from 1
145 // General Informations
146 //---------------------
149 Returns the name of the mesh .
151 string getName() raises (SALOME::SALOME_Exception);
154 Returns space dimension.
156 long getSpaceDimension() raises (SALOME::SALOME_Exception);
159 Returns mesh dimension.
162 - we have only MED_TETRA4 in MED_CELL : MeshDimension = 3D
163 - we have only MED_QUAD4 in MED_CELL : MeshDimension = 2D
164 - we have both MED_SEG2 and MED_TRIA3 in MED_CELL : MeshDimension = 2D
166 long getMeshDimension() raises (SALOME::SALOME_Exception);
172 Returns coordinate system :
177 string getCoordinateSystem() raises (SALOME::SALOME_Exception);
180 Returns the number of nodes defined in the mesh.
182 long getNumberOfNodes() raises (SALOME::SALOME_Exception);
185 Returns an array of coordinates :
186 - X1,Y1,Z1,X2,Y2,...,Zn if MED_FULL_INTERLACE
187 - X1,X2,...Xn,Y1,Y2,...Zn if MED_NO_INTERLACE
189 Engines::double_array getCoordinates(in medModeSwitch typeSwitch)
190 raises (SALOME::SALOME_Exception);
193 Returns an array containing the names of coordinates.
202 Engines::string_array getCoordinatesNames()
203 raises (SALOME::SALOME_Exception);
206 Returns an array containing the units of coordinates (cm, m, mm, ...)
208 It could be empty. By defult IS is used (meter).
210 Engines::string_array getCoordinatesUnits()
211 raises (SALOME::SALOME_Exception);
217 Returns the number of different <VAR>medGeometryElement</VAR> types existing
218 in the specified entity.
221 Not implemented for MED_ALL_ENTITIES.
223 long getNumberOfTypes(in medEntityMesh entity)
224 raises (SALOME::SALOME_Exception);
227 Returns an array of all <VAR>medGeometryElement</VAR> types existing
231 Not implemented for MED_ALL_ENTITIES.
233 medGeometryElement_array getTypes(in medEntityMesh entity)
234 raises (SALOME::SALOME_Exception);
237 Returns the number of elements of type <VAR>medGeometryElement</VAR>.
240 - Implemented for MED_ALL_ELEMENTS
241 - Not implemented for MED_ALL_ENTITIES
243 long getNumberOfElements(in medEntityMesh entity,
244 in medGeometryElement geomElement)
245 raises (SALOME::SALOME_Exception);
248 Give, in full or no interlace mode (for nodal connectivity),
249 descending or nodal connectivity.
251 You must give a <VAR>medEntityMesh</VAR> (ie:MED_EDGE) and a
252 <VAR>medGeometryElement</VAR> (ie:MED_SEG3).
254 Engines::long_array getConnectivity(in medModeSwitch typeSwitch,
255 in medConnectivity mode,
256 in medEntityMesh entity,
257 in medGeometryElement geomElement)
258 raises (SALOME::SALOME_Exception);
261 Give morse index array to use with
262 getConnectivity(MED_FULL_INTERLACE,mode,entity,MED_ALL_ELEMENTS).
264 Each value give start index for corresponding entity in
267 Example : i-th element, j-th node of it :
268 - In C mode : Connectivity[ConnectivityIndex[i]-1+j-1]
269 - In fortran mode : Connectivity[ConnectivityIndex[i]+j]
271 Engines::long_array getConnectivityIndex(in medConnectivity mode,
272 in medEntityMesh entity)
273 raises (SALOME::SALOME_Exception);
276 Gets a global number of the element which have the same connectivity as the
277 connectivity argument.
279 long getElementNumber(in medConnectivity mode,
280 in medEntityMesh entity,
281 in medGeometryElement type,
282 in Engines::long_array connectivity)
283 raises (SALOME::SALOME_Exception);
286 Returns a reverse connectivity to MED_CELL.
288 If mode=MED_NODAL, the array contains, for each node, all cells
291 If mode=MED_DESCENDING, the array contains, for each face (or edge),
292 the 2 cells of each side. First is cell which face normal is outgoing.
294 Engines::long_array getReverseConnectivity(in medConnectivity mode)
295 raises (SALOME::SALOME_Exception);
298 Give index array to use with getReverseConnectivity(MED_NODAL).
300 This method is not used with MED_DESCENDING mode,
301 because we have allways two cells.
303 See getConnectivityIndex for details.
305 Engines::long_array getReverseConnectivityIndex(in medConnectivity mode)
306 raises (SALOME::SALOME_Exception);
308 // Families and Groups
309 // -------------------
312 Returns the number of all families.
314 long getNumberOfFamilies(in medEntityMesh entity)
315 raises (SALOME::SALOME_Exception);
318 Returns the number of all groups.
320 long getNumberOfGroups(in medEntityMesh entity)
321 raises (SALOME::SALOME_Exception);
324 Returns an array of all families.
326 Family_array getFamilies(in medEntityMesh entity)
327 raises (SALOME::SALOME_Exception);
330 Returns the reference to i-th family.
333 i is bounded by 1 and NumberOfFamilies.
335 FAMILY getFamily(in medEntityMesh entity,in long familyNumber)
336 raises (SALOME::SALOME_Exception);
339 Returns an array of all groups.
341 Group_array getGroups(in medEntityMesh entity)
342 raises (SALOME::SALOME_Exception);
345 Returns the reference to i-th group.
348 i is bounded by 1 and NumberOfGroups.
350 GROUP getGroup(in medEntityMesh entity,in long groupNumber)
351 raises (SALOME::SALOME_Exception);
357 Returns a field on mySupport containing volume.
360 mySupport must be on MED_CELL entity and MeshDimension must be 3D.
362 FIELD getVolume(in SUPPORT mySupport)
363 raises (SALOME::SALOME_Exception);
366 Returns a field on mySupport containing area.
369 mySupport must be on MED_FACE entity.
371 FIELD getArea(in SUPPORT mySupport)
372 raises (SALOME::SALOME_Exception);
375 Returns a field on mySupport containing length.
378 mySupport must be on MED_EDGE entity.
380 FIELD getLength(in SUPPORT mySupport)
381 raises (SALOME::SALOME_Exception);
384 Returns a field on mySupport containing normal.
387 mySupport must be on MED_FACE entity if MeshDimension and
388 SpaceDimension=3D and on MED_EDGE if MeshDimension and SpaceDimension=2D.
390 FIELD getNormal(in SUPPORT mySupport)
391 raises (SALOME::SALOME_Exception);
394 Returns a field on mySupport containing barycenter.
396 FIELD getBarycenter(in SUPPORT mySupport)
397 raises (SALOME::SALOME_Exception);
400 Returns a field on mySupport containing neighbourhood.
402 // FIELD getNeighbourhood(in SUPPORT mySupport)
403 // raises (SALOME::SALOME_Exception);
409 Adds the Mesh in the StudyManager.
411 void addInStudy(in SALOMEDS::Study myStudy, in MESH myIor )
412 raises (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
414 // Add a MED/VTK/... driver
415 // Multiple drivers can be added whatever the type
416 long addDriver (in medDriverTypes driverType, in string fileName, in string meshName)
417 raises (SALOME::SALOME_Exception);
419 void rmDriver (in long i) raises (SALOME::SALOME_Exception);
422 void read (in long i) raises (SALOME::SALOME_Exception);
423 void write (in long i, in string driverMeshName)
424 raises (SALOME::SALOME_Exception);
427 Internal Corba method.
429 long getCorbaIndex() raises (SALOME::SALOME_Exception);
433 // ----------------------
435 // ----------------------
440 Returns the name of the support.
442 string getName() raises (SALOME::SALOME_Exception);
445 Returns the description of the support.
447 string getDescription() raises (SALOME::SALOME_Exception);
450 Returns a reference to the mesh.
452 MESH getMesh() raises (SALOME::SALOME_Exception);
455 Returns the type of <VAR>medEntityMesh</VAR> used by the support.
458 A support deals only with one entity's type
459 (for example : MED_FACE or MED_NODE)
461 medEntityMesh getEntity() raises (SALOME::SALOME_Exception);
464 Returns True if all elements of this entity are
465 engaged, False otherwise.
467 If True, you must use mesh reference (getMesh) to get more information.
469 boolean isOnAllElements() raises (SALOME::SALOME_Exception);
472 If the method <VAR>isOnAllElements</VAR> returns False, this method
473 returns the number of elements in the support.
475 Example : number of MED_TRIA3 or MED_ALL_ELEMETNS elements
476 in entity of support.
479 If %SUPPORT is defined on MED_NODE, use MED_NONE <VAR>medGeometryElement</VAR> type.
481 long getNumberOfElements(in medGeometryElement geomElement)
482 raises (SALOME::SALOME_Exception);
485 If isOnAllElements is False, returns an array of <VAR>medGeometryElement</VAR>
486 types used by the support.
488 <VAR>medEntityMesh</VAR> is given by getEntity.
490 medGeometryElement_array getTypes() raises (SALOME::SALOME_Exception);
493 If the method <VAR>isOnAllElements</VAR> returns False, this method returns an array which
494 contains all numbers of given <VAR>medGeometryElement</VAR>.
496 Numbering is global, ie numbers are bounded by 1 and
497 MESH::getNumberOfElement(entity,MED_ALL_ELEMENTS) and not by 1 and
498 MESH::getNumberOfElement(entity,geomElement).
501 If %SUPPORT is defined on MED_NODE, use MED_NONE <VAR>medGeometryElement</VAR> type.
503 Engines::long_array getNumber(in medGeometryElement geomElement)
504 raises (SALOME::SALOME_Exception);
507 If the method <VAR>isOnAllElements</VAR> returns False, this method returns the index
510 Use it with getNumber(MED_ALL_ELEMENTS).
513 See the method <VAR>getConnectivityIndex</VAR> for more details.
515 Engines::long_array getNumberIndex()
516 raises (SALOME::SALOME_Exception);
518 Returns the number of Gauss points for this <VAR>medGeometryElement</VAR>.
521 - Not defined if %SUPPORT is on MED_NODE.
522 - Not defined for MED_ALL_ELEMENTS <VAR>medGeometryElement</VAR> type.
524 long getNumberOfGaussPoints(in medGeometryElement geomElement)
525 raises (SALOME::SALOME_Exception);
527 Internal Corba method.
529 long getCorbaIndex() raises (SALOME::SALOME_Exception);
537 interface FAMILY : SUPPORT
541 Returns Family identifier (Identifier
542 of the family in the mesh).
545 There is precisely only one indentifier for each family.
547 long getIdentifier() raises (SALOME::SALOME_Exception);
550 Returns number of attributes.
552 long getNumberOfAttributes() raises (SALOME::SALOME_Exception);
555 Returns an array of all attributes' identifiers.
556 There is one for each attribute.
558 Engines::long_array getAttributesIdentifiers()
559 raises (SALOME::SALOME_Exception);
562 Returns identifier of i-th attribute.
565 i is bounded by 1 and NumberOfAttributes.
567 long getAttributeIdentifier(in long i) raises (SALOME::SALOME_Exception);
570 Returns an array of all values of the attributes .
571 There is one value for each attribute.
573 Engines::long_array getAttributesValues()
574 raises (SALOME::SALOME_Exception);
577 Returns the value of i-th attribute.
580 i is bounded by 1 and NumberOfAttributes.
582 long getAttributeValue(in long i) raises (SALOME::SALOME_Exception);
585 Returns an array of all descriptions of the attributes .
586 There is one description for each attribute.
588 Engines::string_array getAttributesDescriptions()
589 raises (SALOME::SALOME_Exception);
592 Returns the description of i-th attribute.
595 i is bounded by 1 and NumberOfAttributes.
597 string getAttributeDescription(in long i)
598 raises (SALOME::SALOME_Exception);
605 interface GROUP : SUPPORT
609 Returns the number of families in this group.
611 long getNumberOfFamilies() raises (SALOME::SALOME_Exception);
614 Returns an array of all families.
616 Family_array getFamilies() raises (SALOME::SALOME_Exception);
619 Returns a reference to the i-th family.
622 i is bounded by 1 and NumberOfFamilies.
624 FAMILY getFamily(in long i) raises (SALOME::SALOME_Exception);
637 Returns the field name.
639 string getName() raises (SALOME::SALOME_Exception);
642 Returns the field description.
644 string getDescription() raises (SALOME::SALOME_Exception);
647 Returns a reference to the support
648 on which the field is defined.
650 SUPPORT getSupport() raises (SALOME::SALOME_Exception);
653 Returns the number of field's components.
655 long getNumberOfComponents() raises (SALOME::SALOME_Exception);
658 Returns an array containing components names.
660 Engines::string_array getComponentsNames()
661 raises (SALOME::SALOME_Exception);
664 Returns the name of i-th component.
667 - i is bounded by 1 and NumberOfComponents.
668 - Name is mandatory for each field's component.
670 string getComponentName(in long i) raises (SALOME::SALOME_Exception);
673 Returns an array containing components units.
675 Engines::string_array getComponentsUnits()
676 raises (SALOME::SALOME_Exception);
679 Returns the unit of i-th component.
682 i is bounded by 1 and NumberOfComponents.
684 string getComponentUnit(in long i) raises (SALOME::SALOME_Exception);
687 long getIterationNumber() raises (SALOME::SALOME_Exception);
690 Returns time for this iteration.
692 double getTime() raises (SALOME::SALOME_Exception);
695 Returns order number use for
696 internal step in this iteration.
698 long getOrderNumber() raises (SALOME::SALOME_Exception);
703 long addDriver (in medDriverTypes driverType, in string fileName, in string fieldName)
704 raises (SALOME::SALOME_Exception);
709 void rmDriver (in long i)
710 raises (SALOME::SALOME_Exception);
713 void read (in long i)
714 raises (SALOME::SALOME_Exception);
719 void write (in long i, in string driverFieldName)
720 raises (SALOME::SALOME_Exception);
723 Adds the Field in the StudyManager.
725 void addInStudy(in SALOMEDS::Study myStudy, in FIELD myIor )
726 raises (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
729 Internal Corba method.
732 raises (SALOME::SALOME_Exception);
737 interface FIELDDOUBLE : FIELD {
740 Returns an array of values of the field
742 Engines::double_array getValue(in medModeSwitch mode)
743 raises (SALOME::SALOME_Exception);
746 interface FIELDINT : FIELD {
749 Returns an array of values of the field
751 Engines::long_array getValue(in medModeSwitch mode)
752 raises (SALOME::SALOME_Exception);
761 long getNumberOfMeshes () raises (SALOME::SALOME_Exception);
762 long getNumberOfFields () raises (SALOME::SALOME_Exception);
763 Engines::string_array getMeshNames () raises (SALOME::SALOME_Exception);
764 Engines::string_array getFieldNames () raises (SALOME::SALOME_Exception);
765 MESH getMeshByName ( in string meshName) raises (SALOME::SALOME_Exception);
766 MESH getMesh ( in FIELD fieldPtr) raises (SALOME::SALOME_Exception);
767 FIELD getField ( in string fieldName,
769 in long numOrdre ) raises (SALOME::SALOME_Exception);
772 // Add a MED/VTK/... driver to a MED'GEN' object to
773 // be able to read/write files preserving meshes<-->fields association
774 // Multiple drivers can be added whatever the type.
775 // The access point in the <long> returned
776 long addDriver (in medDriverTypes driverType, in string fileName)
777 raises (SALOME::SALOME_Exception);
781 void rmDriver (in long i) raises (SALOME::SALOME_Exception);
783 Reads the structure of the %MED file
785 void readFileStruct(in long i) raises (SALOME::SALOME_Exception);
786 void writeFrom (in long i) raises (SALOME::SALOME_Exception);
787 void write (in long i) raises (SALOME::SALOME_Exception);
789 void addMesh (in MESH ptrMesh ) raises (SALOME::SALOME_Exception);
790 void addField (in FIELD ptrField ) raises (SALOME::SALOME_Exception);
792 void addInStudy (in SALOMEDS::Study myStudy, in MED medPtr) raises (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);