1 // MED MEDMEM : MED files in memory
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : MEDMEM_Mesh.hxx
33 #include "utilities.h"
34 #include "MEDMEM_STRING.hxx"
35 #include "MEDMEM_Exception.hxx"
36 #include "MEDMEM_define.hxx"
38 //#include "MEDMEM_Support.hxx"
39 #include "MEDMEM_Coordinate.hxx"
40 #include "MEDMEM_Connectivity.hxx"
42 // Add your own driver header (step 2)
43 #include "MEDMEM_MedMeshDriver.hxx"
44 #include "MEDMEM_MedMedDriver.hxx"
45 #include "MEDMEM_GibiMeshDriver.hxx"
52 template <class T> class FIELD;
55 //class MED_MESH_RDONLY_DRIVER ;
56 //class MED_MESH_WRONLY_DRIVER ;
58 using namespace MED_EN;
60 /*! This class contains all the informations related with a MESH :
68 NOTE: A Family is only on one type of entity (MED_CELL, MED_FACE, MED_EDGE, MED_NODE).
69 You can't have a family on MED_CELL and MED_FACE
79 // ------- Drivers Management Part
82 //-----------------------//
84 //-----------------------//
87 virtual GENDRIVER * run(const string & fileName, MESH * ptrMesh) const = 0 ;
90 //-------------------------------------------------------//
91 template <class T> class INSTANCE_DE : public INSTANCE
92 //-------------------------------------------------------//
95 GENDRIVER * run(const string & fileName, MESH * ptrMesh) const
96 { return new T(fileName,ptrMesh) ; }
99 // Add a similar line for your personnal driver (step 3)
100 static INSTANCE_DE<MED_MESH_RDWR_DRIVER> inst_med ;
101 static INSTANCE_DE<GIBI_MESH_RDWR_DRIVER> inst_gibi ;
102 //static INSTANCE_DE<VTK_DRIVER> inst_vtk ;
103 static const INSTANCE * const instances[] ;
105 // ------ End of Drivers Management Part
108 //-----------------------//
110 //-----------------------//
114 string _name; // A POSITIONNER EN FCT DES IOS ?
116 COORDINATE * _coordinate;
117 CONNECTIVITY * _connectivity;
123 int _numberOfNodesFamilies; //INUTILE ? -> _familyNode.size()
124 vector<FAMILY*> _familyNode ; // array of size _numberOfNodesFamilies;
125 int _numberOfCellsFamilies;
126 vector<FAMILY*> _familyCell ; // array of size _numberOfCellsFamilies;
127 int _numberOfFacesFamilies;
128 vector<FAMILY*> _familyFace ; // array of size _numberOfFacesFamilies;
129 int _numberOfEdgesFamilies;
130 vector<FAMILY*> _familyEdge ; // array of size _numberOfEdgesFamilies;
132 int _numberOfNodesGroups; //INUTILE ?
133 vector<GROUP*> _groupNode; // array of size _numberOfNodesGroups;
134 int _numberOfCellsGroups; //INUTILE ?
135 vector<GROUP*> _groupCell; // array of size _numberOfCellsGroups;
136 int _numberOfFacesGroups; //INUTILE ?
137 vector<GROUP*> _groupFace; // array of size _numberOfFacesGroups;
138 int _numberOfEdgesGroups; //INUTILE ?
139 vector<GROUP*> _groupEdge; // array of size _numberOfEdgesGroups;
142 vector<GENDRIVER *> _drivers; // Storage of the drivers currently in use
144 bool _isAGrid; // am I a GRID or not
146 //-----------------------//
148 //-----------------------//
150 inline void checkGridFillCoords() const;
151 inline void checkGridFillConnectivity() const;
152 // if this->_isAGrid, assure that _coordinate and _connectivity are filled
156 // Add your personnal driver line (step 2)
157 friend class MED_MESH_RDONLY_DRIVER;
158 friend class MED_MESH_WRONLY_DRIVER;
160 friend class MED_MED_RDONLY_DRIVER;
161 friend class MED_MED_WRONLY_DRIVER;
162 friend class MED_MED_RDWR_DRIVER;
164 friend class GIBI_MESH_RDONLY_DRIVER;
165 friend class GIBI_MESH_WRONLY_DRIVER;
166 friend class GIBI_MESH_RDWR_DRIVER;
171 MESH & operator=(const MESH &m);
172 MESH( driverTypes driverType, const string & fileName="",
173 const string & meshName="");
175 friend ostream & operator<<(ostream &os, MESH &my) ;
177 int addDriver(driverTypes driverType,
178 const string & fileName ="Default File Name.med",
179 const string & driverName="Default Mesh Name");
180 int addDriver(GENDRIVER & driver);
181 void rmDriver(int index=0);
183 void read(int index=0);
184 inline void read(const MED_MED_DRIVER & genDriver);
185 inline void write(int index=0, const string & driverName = "");
186 inline void write(const MED_MED_DRIVER & genDriver);
188 // void calculateReverseConnectivity();
189 // void createFaces(); //Faces creation => full constituent informations
190 // void buildConstituent() ; // calculate descendent connectivity + face-cell connectivity
193 inline void setName(string name);
195 inline string getName() const;
196 inline int getSpaceDimension() const ;
197 inline int getMeshDimension() const ;
198 inline bool getIsAGrid();
200 inline int getNumberOfNodes() const ;
201 inline const COORDINATE * getCoordinateptr() const ;
202 inline string getCoordinatesSystem() const ;
203 inline const double * getCoordinates(medModeSwitch Mode) const ;
204 inline const double getCoordinate(int Number,int Axis) const ;
205 inline const string * getCoordinatesNames() const ;
206 inline const string * getCoordinatesUnits() const ;
207 // inline int * getNodesNumbers();
209 inline int getNumberOfTypes(medEntityMesh Entity) const ;
210 inline const medGeometryElement * getTypes(medEntityMesh Entity) const ;
211 inline const CELLMODEL * getCellsTypes(medEntityMesh Entity) const ;
212 inline const int * getGlobalNumberingIndex(medEntityMesh Entity) const ;
213 inline int getNumberOfElements(medEntityMesh Entity,medGeometryElement Type) const ;
214 inline bool existConnectivity(medConnectivity ConnectivityType,medEntityMesh Entity) const ;
215 inline medGeometryElement getElementType(medEntityMesh Entity,int Number) const ;
216 inline void calculateConnectivity(medModeSwitch Mode,medConnectivity ConnectivityType,medEntityMesh Entity) ;
217 inline const int * getConnectivity(medModeSwitch Mode,medConnectivity ConnectivityType,medEntityMesh Entity, medGeometryElement Type) const ;
218 inline const int * getConnectivityIndex(medConnectivity ConnectivityType,medEntityMesh Entity) const ;
219 int getElementNumber(medConnectivity ConnectivityType, medEntityMesh Entity, medGeometryElement Type, int * connectivity) const ;
220 inline const int * getReverseConnectivity(medConnectivity ConnectivityType,medEntityMesh Entity=MED_CELL) const ;
221 inline const int * getReverseConnectivityIndex(medConnectivity ConnectivityType,medEntityMesh Entity=MED_CELL) const ;
223 inline int getNumberOfFamilies(medEntityMesh Entity) const ;
224 inline const vector<FAMILY*> getFamilies(medEntityMesh Entity) const ;
225 inline const FAMILY* getFamily(medEntityMesh Entity,int i) const ;
226 inline int getNumberOfGroups(medEntityMesh Entity) const ;
227 inline const vector<GROUP*> getGroups(medEntityMesh Entity) const ;
228 inline const GROUP* getGroup(medEntityMesh Entity,int i) const ;
229 inline const CONNECTIVITY* getConnectivityptr() const ;
230 SUPPORT * getBoundaryElements(medEntityMesh Entity) throw (MEDEXCEPTION) ;
231 //SUPPORT * getBoundaryElements(medEntityMesh Entity) const throw (MEDEXCEPTION) ; // problème avec le maillage dans le support : le pointeur n'est pas const, mais sa valeur oui. A voir !!! PG
233 SUPPORT * getSkin(const SUPPORT * Support3D) throw (MEDEXCEPTION) ;
235 // Node DonneBarycentre(const Cell &m) const;
236 FIELD<double>* getVolume(const SUPPORT * Support) const throw (MEDEXCEPTION) ; // Support must be on 3D elements
237 FIELD<double>* getArea(const SUPPORT * Support) const throw (MEDEXCEPTION) ; // Support must be on 2D elements
238 FIELD<double>* getLength(const SUPPORT * Support) const throw (MEDEXCEPTION) ; // Support must be on 1D elements
239 FIELD<double>* getNormal(const SUPPORT * Support) const throw (MEDEXCEPTION) ; // Support must be on 2D elements
240 FIELD<double>* getBarycenter(const SUPPORT * Support) const throw (MEDEXCEPTION) ;
241 // FIELD<int>* getNeighbourhood(SUPPORT * Support) const throw (MEDEXCEPTION) ; // Il faut preciser !
244 // ---------------------------------------
246 // ---------------------------------------
248 inline const CONNECTIVITY* MESH::getConnectivityptr() const
250 return _connectivity;
253 // inline void MESH::read(int index/*=0*/)
255 // const char * LOC = "MESH::read(int index=0) : ";
258 // if (_drivers[index]) {
259 // _drivers[index]->open();
260 // _drivers[index]->read();
261 // _drivers[index]->close();
264 // throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
265 // << "The index given is invalid, index must be between 0 and |"
266 // << _drivers.size()
272 /*! Write all the content of the MESH using driver referenced by the handler <index>*/
273 inline void MESH::write(int index/*=0*/, const string & driverName/* = ""*/)
275 const char * LOC = "MESH::write(int index=0, const string & driverName = \"\") : ";
278 if ( _drivers[index] ) {
279 _drivers[index]->open();
280 if (driverName != "") _drivers[index]->setMeshName(driverName);
281 _drivers[index]->write();
282 _drivers[index]->close();
285 throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
286 << "The index given is invalid, index must be between 0 and |"
293 // This method is MED specific : don't use it
295 inline void MESH::write(const MED_MED_DRIVER & genDriver)
297 const char * LOC = "MESH::write(const MED_MED_DRIVER & genDriver): ";
300 for (int index=0; index < _drivers.size(); index++ )
301 if ( *_drivers[index] == genDriver ) {
302 _drivers[index]->open();
303 _drivers[index]->write();
304 _drivers[index]->close();
305 // ? FINALEMENT PAS BESOIN DE L'EXCEPTION ?
312 // This method is MED specific : don't use it
314 inline void MESH::read(const MED_MED_DRIVER & genDriver)
316 const char * LOC = "MESH::read(const MED_MED_DRIVER & genDriver): ";
319 for (int index=0; index < _drivers.size(); index++ )
320 if ( *_drivers[index] == genDriver ) {
321 _drivers[index]->open();
322 _drivers[index]->read();
323 _drivers[index]->close();
324 // ? FINALEMENT PAS BESOIN DE L'EXCEPTION ?
331 /*! Set the MESH name */
332 inline void MESH::setName(string name)
334 _name=name ; //NOM interne à la classe
337 /*! Get the MESH name */
338 inline string MESH::getName() const
343 /*! Get the dimension of the space */
344 inline int MESH::getSpaceDimension() const
346 return _spaceDimension;
349 /*! Get the dimension of the MESH */
350 inline int MESH::getMeshDimension() const
352 return _meshDimension;
355 /*! Get the number of nodes used in the MESH */
356 inline int MESH::getNumberOfNodes() const
358 return _numberOfNodes;
361 /*! Get the COORDINATES object. Use it only if you need COORDINATES informations not provided by the MESH class.*/
362 inline const COORDINATE * MESH::getCoordinateptr() const
364 checkGridFillCoords();
368 /*! Get the system in which coordinates are given (CARTESIAN,CYLINDRICAL,SPHERICAL) __??MED_CART??__. */
369 inline string MESH::getCoordinatesSystem() const
371 return _coordinate->getCoordinatesSystem();
374 /*! Get the whole coordinates array in a given interlacing mode. The interlacing mode are :
375 - MED_NO_INTERLACE : X1 X2 Y1 Y2 Z1 Z2
376 - MED_FULL_INTERLACE : X1 Y1 Z1 X2 Y2 Z2
378 inline const double * MESH::getCoordinates(medModeSwitch Mode) const
380 checkGridFillCoords();
381 return _coordinate->getCoordinates(Mode);
384 /*! Get the coordinate n° number on axis n°axis*/
385 inline const double MESH::getCoordinate(int number, int axis) const
387 checkGridFillCoords();
388 return _coordinate->getCoordinate(number,axis);
391 /*! Get the coordinate names array ("x ","y ","z ")
392 of size n*MED_TAILLE_PNOM
394 inline const string * MESH::getCoordinatesNames() const
396 return _coordinate->getCoordinatesNames();
399 /*! Get the coordinate unit names array ("cm ","cm ","cm ")
400 of size n*MED_TAILLE_PNOM
402 inline const string * MESH::getCoordinatesUnits() const
404 return _coordinate->getCoordinatesUnits();
406 // int * MESH::getNodesNumbers() const
408 // return nodesNumbers;
411 /*! Get the number of different geometric types for a given entity type.
413 For exemple getNumberOfTypes(MED_CELL) would return 3 is the MESH
414 have some MED_TETRA4, MED_PYRA5 and MED_HEXA6 in it.
416 medEntityMesh entity : MED_CELL, MED_FACE, MED_EDGE, MED_NODE, MED_ALL_ENTITIES
418 If entity is not defined, return 0.
420 If there is no connectivity, return an exception.
422 inline int MESH::getNumberOfTypes(medEntityMesh entity) const
424 MESSAGE("MESH::getNumberOfTypes(medEntityMesh entity) : "<<entity);
425 if (entity == MED_NODE)
427 checkGridFillConnectivity();
428 if (_connectivity != NULL)
429 return _connectivity->getNumberOfTypes(entity) ;
430 throw MEDEXCEPTION(LOCALIZED("MESH::getNumberOfTypes( medEntityMesh ) : Connectivity not defined !"));
434 Get the list of geometric types used by a given entity.
435 medEntityMesh entity : MED_CELL, MED_FACE, MED_EDGE, MED_ALL_ENTITIES
437 REM : Don't use MED_NODE
439 If entity is not defined, return an exception.
441 inline const medGeometryElement * MESH::getTypes(medEntityMesh entity) const
443 if (entity == MED_NODE)
444 throw MEDEXCEPTION(LOCALIZED("MESH::getTypes( medEntityMesh ) : No medGeometryElement with MED_NODE entity !"));
445 // return un tableau de taille 1 contenant MED_NONE, comme les supports pour etre coherent avec getNumberOfTypes ???? PG
447 checkGridFillConnectivity();
448 if (_connectivity != NULL)
449 return _connectivity->getGeometricTypes(entity) ;
450 throw MEDEXCEPTION(LOCALIZED("MESH::getTypes( medEntityMesh ) : Connectivity not defined !"));
454 Get the whole list of CELLMODEL used by cells of given type (medEntityMesh).
456 REMARK : Don't use MED_NODE as medEntityMesh
458 inline const CELLMODEL * MESH::getCellsTypes(medEntityMesh Entity) const
460 checkGridFillConnectivity();
461 if (_connectivity != NULL)
462 return _connectivity->getCellsTypes(Entity) ;
463 throw MEDEXCEPTION(LOCALIZED("MESH::getCellsTypes( medEntityMesh ) : Connectivity not defined !"));
466 /*! Return an array of size NumbreOfTypes+1 which contains, for each
467 geometric type of the given entity, the first global element number
470 For exemple, if we have a mesh with 5 triangles and 4 quadrangle :
471 - size of GlobalNumberingIndex is 3
472 - GlobalNumberingIndex[0]=1 (the first type)
473 - GlobalNumberingIndex[1]=6 (the second type)
474 - GlobalNumberingIndex[2]=10
476 inline const int * MESH::getGlobalNumberingIndex(medEntityMesh entity) const
478 checkGridFillConnectivity();
479 if (_connectivity != NULL)
480 return _connectivity->getGlobalNumberingIndex(entity);
481 throw MEDEXCEPTION(LOCALIZED("MESH::getNumberOfTypes( medEntityMesh ) : Connectivity not defined !"));
484 Return the number of element of given geometric type of given entity. Return 0 if query is not defined.
487 - getNumberOfElements(MED_NODE,MED_NONE) : number of node
488 - getNumberOfElements(MED_NODE,MED_TRIA3) : return 0 (not defined)
489 - getNumberOfElements(MED_FACE,MED_TRIA3) : return number of triangles
490 elements defined in face entity (0 if not defined)
491 - getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS) : return total number
492 of elements defined in cell entity
494 inline int MESH::getNumberOfElements(medEntityMesh entity, medGeometryElement Type) const
496 const char * LOC = "MESH::getNumberOfElements(medEntityMesh,medGeometryElement) : " ;
497 if (entity==MED_NODE)
498 if ((Type==MED_NONE)|(Type==MED_ALL_ELEMENTS))
499 return _numberOfNodes ;
502 //throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"wrong medGeometryElement with MED_NODE"));
505 checkGridFillConnectivity();
506 if (_connectivity != (CONNECTIVITY*)NULL)
507 return _connectivity->getNumberOf(entity,Type) ;
510 //throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"connectivity not defined !"));
514 Return true if the wanted connectivity exist, else return false
515 (to use before a getSomething method).
517 inline bool MESH::existConnectivity(medConnectivity connectivityType, medEntityMesh entity) const
519 checkGridFillConnectivity();
520 if (_connectivity==(CONNECTIVITY*)NULL)
521 throw MEDEXCEPTION("MESH::existConnectivity(medConnectivity,medEntityMesh) : no connectivity defined !");
522 return _connectivity->existConnectivity(connectivityType,entity) ;
525 Return the geometric type of global element Number of entity Entity.
527 Throw an exception if Entity is not defined or Number are wrong (too big).
529 inline medGeometryElement MESH::getElementType(medEntityMesh Entity,int Number) const
531 checkGridFillConnectivity();
532 if (_connectivity==(CONNECTIVITY*)NULL)
533 throw MEDEXCEPTION("MESH::getElementType(medEntityMesh,int) : no connectivity defined !");
534 return _connectivity->getElementType(Entity,Number) ;
537 Calculate the ask connectivity. Return an exception if this could not be
538 done. Do nothing if connectivity already exist.
541 inline void MESH::calculateConnectivity(medModeSwitch Mode,medConnectivity ConnectivityType,medEntityMesh entity)
543 checkGridFillConnectivity();
544 if (Mode==MED_FULL_INTERLACE)
545 _connectivity->calculateConnectivity(ConnectivityType,entity) ;
547 throw MEDEXCEPTION(LOCALIZED("MESH::calculateConnectivity : only for MED_FULL_INTERLACE mode"));
550 Return the required connectivity in the right mode for the given
551 geometric type of the given entity.
553 To get connectivity for all geometric type, use Mode=MED_FULL_INTERLACE
554 and Type=MED_ALL_ELEMENTS.
555 You must also get the corresponding index array.
557 inline const int * MESH::getConnectivity(medModeSwitch Mode,medConnectivity ConnectivityType,medEntityMesh entity, medGeometryElement Type) const
559 checkGridFillConnectivity();
560 if (Mode==MED_FULL_INTERLACE)
561 return _connectivity->getConnectivity(ConnectivityType,entity,Type) ;
562 throw MEDEXCEPTION(LOCALIZED("MESH::getConnectivity : only for MED_FULL_INTERLACE mode"));
565 Return the required index array for a connectivity received in
566 MED_FULL_ENTERLACE mode and MED_ALL_ELEMENTS type.
568 This array allow to find connectivity of each elements.
570 Example : Connectivity of i^{th} elements (1<=i<=NumberOfElement) begin
571 at index ConnectivityIndex[i-1] and end at index ConnectivityIndex[i]-1
572 in Connectivity array (Connectivity[ConnectivityIndex[i-1]-1] is the
575 inline const int * MESH::getConnectivityIndex(medConnectivity ConnectivityType,medEntityMesh entity) const
577 checkGridFillConnectivity();
578 return _connectivity->getConnectivityIndex(ConnectivityType, entity) ;
581 Return the reverse connectivity required by ConnectivityType :
582 - If ConnectivityType=MED_NODAL : return connectivity node-cell
583 - If ConnectivityType=MED_DESCENDING : return connectivity face-cell
585 You must get ReverseConnectivityIndex array to use it.
587 inline const int * MESH::getReverseConnectivity(medConnectivity ConnectivityType,medEntityMesh Entity/*=MED_CELL*/) const
589 checkGridFillConnectivity();
590 if (NULL==_connectivity)
591 throw MEDEXCEPTION("MESH::getReverseConnectivity : no connectivity defined in MESH !");
593 return _connectivity->getReverseConnectivity(ConnectivityType,Entity) ;
596 Return the index array required by ConnectivityType.
598 This array allow to find reverse connectivity of each elements.
600 Example : Reverse connectivity of i^{th} elements (1<=i<=NumberOfElement)
601 begin at index ReverseConnectivityIndex[i-1] and end at index
602 ReverseConnectivityIndex[i]-1
603 in ReverseConnectivity array (
604 ReverseConnectivity[ReverseConnectivityIndex[i-1]-1]
607 inline const int * MESH::getReverseConnectivityIndex(medConnectivity ConnectivityType,medEntityMesh Entity/*=MED_CELL*/) const
609 checkGridFillConnectivity();
610 if (NULL==_connectivity)
611 throw MEDEXCEPTION("MESH::getReverseConnectivityIndex : no connectivity defined in MESH !");
613 return _connectivity->getReverseConnectivityIndex(ConnectivityType,Entity) ;
617 inline int MESH::getNumberOfFamilies (medEntityMesh entity) const
621 return _numberOfNodesFamilies ;
623 return _numberOfCellsFamilies ;
625 return _numberOfFacesFamilies ;
627 return _numberOfEdgesFamilies ;
629 throw MEDEXCEPTION("MESH::getNumberOfFamilies : Unknown entity");
632 inline int MESH::getNumberOfGroups (medEntityMesh entity) const
636 return _numberOfNodesGroups ;
638 return _numberOfCellsGroups ;
640 return _numberOfFacesGroups ;
642 return _numberOfEdgesGroups ;
644 throw MEDEXCEPTION("MESH::getNumberOfGroups : Unknown entity");
647 const vector<FAMILY*> MESH::getFamilies(medEntityMesh entity) const
659 throw MEDEXCEPTION("MESH::getFamilies : Unknown entity");
663 const vector<GROUP*> MESH::getGroups(medEntityMesh entity) const
675 throw MEDEXCEPTION("MESH::getGroups : Unknown entity");
679 const FAMILY* MESH::getFamily(medEntityMesh entity, int i) const
682 throw MEDEXCEPTION("MESH::getFamily(i) : argument i must be > 0");
683 int NumberOfFamilies = 0 ;
684 vector<FAMILY*> Family ;
687 NumberOfFamilies = _numberOfNodesFamilies ;
688 Family = _familyNode ;
692 NumberOfFamilies = _numberOfCellsFamilies ;
693 Family = _familyCell ;
697 NumberOfFamilies = _numberOfFacesFamilies ;
698 Family = _familyFace ;
702 NumberOfFamilies = _numberOfEdgesFamilies ;
703 Family = _familyEdge ;
707 throw MEDEXCEPTION("MESH::getFamilies : Unknown entity");
709 if (i>NumberOfFamilies)
710 throw MEDEXCEPTION("MESH::getFamily(entity,i) : argument i must be <= _numberOfFamilies");
714 const GROUP* MESH::getGroup(medEntityMesh entity, int i) const
716 const char * LOC = "MESH::getGroup(medEntityMesh entity, int i) : " ;
718 throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"argument i must be > 0"));
719 int NumberOfGroups = 0 ;
720 vector<GROUP*> Group ;
723 NumberOfGroups = _numberOfNodesGroups ;
728 NumberOfGroups = _numberOfCellsGroups ;
733 NumberOfGroups = _numberOfFacesGroups ;
738 NumberOfGroups = _numberOfEdgesGroups ;
743 throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Unknown entity"));
745 if (i>NumberOfGroups)
746 throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"argument i="<<i<<" must be <= _numberOfGroups="<<NumberOfGroups));
755 //inline void MESH::write(const string & driverName) {
756 // write(0,driverName);
759 inline bool MESH::getIsAGrid()
764 #endif /* MESH_HXX */