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;
159 friend class MED_MED_DRIVER;
161 friend class MED_MED_RDONLY_DRIVER;
162 friend class MED_MED_WRONLY_DRIVER;
163 friend class MED_MED_RDWR_DRIVER;
165 friend class GIBI_MESH_RDONLY_DRIVER;
166 friend class GIBI_MESH_WRONLY_DRIVER;
167 friend class GIBI_MESH_RDWR_DRIVER;
172 MESH & operator=(const MESH &m);
173 MESH( driverTypes driverType, const string & fileName="",
174 const string & meshName="");
176 friend ostream & operator<<(ostream &os, MESH &my) ;
178 int addDriver(driverTypes driverType,
179 const string & fileName ="Default File Name.med",
180 const string & driverName="Default Mesh Name");
181 int addDriver(GENDRIVER & driver);
182 void rmDriver(int index=0);
184 void read(int index=0);
185 inline void read(const MED_MED_DRIVER & genDriver);
186 inline void write(int index=0, const string & driverName = "");
187 inline void write(const MED_MED_DRIVER & genDriver);
189 // void calculateReverseConnectivity();
190 // void createFaces(); //Faces creation => full constituent informations
191 // void buildConstituent() ; // calculate descendent connectivity + face-cell connectivity
194 inline void setName(string name);
196 inline string getName() const;
197 inline int getSpaceDimension() const ;
198 inline int getMeshDimension() const ;
199 inline bool getIsAGrid();
201 inline int getNumberOfNodes() const ;
202 inline const COORDINATE * getCoordinateptr() const ;
203 inline string getCoordinatesSystem() const ;
204 inline const double * getCoordinates(medModeSwitch Mode) const ;
205 inline const double getCoordinate(int Number,int Axis) const ;
206 inline const string * getCoordinatesNames() const ;
207 inline const string * getCoordinatesUnits() const ;
208 // inline int * getNodesNumbers();
210 inline int getNumberOfTypes(medEntityMesh Entity) const ;
211 inline const medGeometryElement * getTypes(medEntityMesh Entity) const ;
212 inline const CELLMODEL * getCellsTypes(medEntityMesh Entity) const ;
213 inline const int * getGlobalNumberingIndex(medEntityMesh Entity) const ;
214 inline int getNumberOfElements(medEntityMesh Entity,medGeometryElement Type) const ;
215 inline bool existConnectivity(medConnectivity ConnectivityType,medEntityMesh Entity) const ;
216 inline medGeometryElement getElementType(medEntityMesh Entity,int Number) const ;
217 inline void calculateConnectivity(medModeSwitch Mode,medConnectivity ConnectivityType,medEntityMesh Entity) ;
218 inline const int * getConnectivity(medModeSwitch Mode,medConnectivity ConnectivityType,medEntityMesh Entity, medGeometryElement Type) const ;
219 inline const int * getConnectivityIndex(medConnectivity ConnectivityType,medEntityMesh Entity) const ;
220 int getElementNumber(medConnectivity ConnectivityType, medEntityMesh Entity, medGeometryElement Type, int * connectivity) const ;
221 inline const int * getReverseConnectivity(medConnectivity ConnectivityType,medEntityMesh Entity=MED_CELL) const ;
222 inline const int * getReverseConnectivityIndex(medConnectivity ConnectivityType,medEntityMesh Entity=MED_CELL) const ;
224 inline int getNumberOfFamilies(medEntityMesh Entity) const ;
225 inline const vector<FAMILY*> getFamilies(medEntityMesh Entity) const ;
226 inline const FAMILY* getFamily(medEntityMesh Entity,int i) const ;
227 inline int getNumberOfGroups(medEntityMesh Entity) const ;
228 inline const vector<GROUP*> getGroups(medEntityMesh Entity) const ;
229 inline const GROUP* getGroup(medEntityMesh Entity,int i) const ;
230 inline const CONNECTIVITY* getConnectivityptr() const ;
231 SUPPORT * getBoundaryElements(medEntityMesh Entity) throw (MEDEXCEPTION) ;
232 //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
234 SUPPORT * getSkin(const SUPPORT * Support3D) throw (MEDEXCEPTION) ;
236 // Node DonneBarycentre(const Cell &m) const;
237 FIELD<double>* getVolume(const SUPPORT * Support) const throw (MEDEXCEPTION) ; // Support must be on 3D elements
238 FIELD<double>* getArea(const SUPPORT * Support) const throw (MEDEXCEPTION) ; // Support must be on 2D elements
239 FIELD<double>* getLength(const SUPPORT * Support) const throw (MEDEXCEPTION) ; // Support must be on 1D elements
240 FIELD<double>* getNormal(const SUPPORT * Support) const throw (MEDEXCEPTION) ; // Support must be on 2D elements
241 FIELD<double>* getBarycenter(const SUPPORT * Support) const throw (MEDEXCEPTION) ;
242 // FIELD<int>* getNeighbourhood(SUPPORT * Support) const throw (MEDEXCEPTION) ; // Il faut preciser !
245 // ---------------------------------------
247 // ---------------------------------------
249 inline const CONNECTIVITY* MESH::getConnectivityptr() const
251 return _connectivity;
254 // inline void MESH::read(int index/*=0*/)
256 // const char * LOC = "MESH::read(int index=0) : ";
259 // if (_drivers[index]) {
260 // _drivers[index]->open();
261 // _drivers[index]->read();
262 // _drivers[index]->close();
265 // throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
266 // << "The index given is invalid, index must be between 0 and |"
267 // << _drivers.size()
273 /*! Write all the content of the MESH using driver referenced by the handler <index>*/
274 inline void MESH::write(int index/*=0*/, const string & driverName/* = ""*/)
276 const char * LOC = "MESH::write(int index=0, const string & driverName = \"\") : ";
279 if ( _drivers[index] ) {
280 _drivers[index]->open();
281 if (driverName != "") _drivers[index]->setMeshName(driverName);
282 _drivers[index]->write();
283 _drivers[index]->close();
286 throw MED_EXCEPTION ( LOCALIZED( STRING(LOC)
287 << "The index given is invalid, index must be between 0 and |"
294 // This method is MED specific : don't use it
296 inline void MESH::write(const MED_MED_DRIVER & genDriver)
298 const char * LOC = "MESH::write(const MED_MED_DRIVER & genDriver): ";
301 for (int index=0; index < _drivers.size(); index++ )
302 if ( *_drivers[index] == genDriver ) {
303 _drivers[index]->open();
304 _drivers[index]->write();
305 _drivers[index]->close();
306 // ? FINALEMENT PAS BESOIN DE L'EXCEPTION ?
313 // This method is MED specific : don't use it
315 inline void MESH::read(const MED_MED_DRIVER & genDriver)
317 const char * LOC = "MESH::read(const MED_MED_DRIVER & genDriver): ";
320 for (int index=0; index < _drivers.size(); index++ )
321 if ( *_drivers[index] == genDriver ) {
322 _drivers[index]->open();
323 _drivers[index]->read();
324 _drivers[index]->close();
325 // ? FINALEMENT PAS BESOIN DE L'EXCEPTION ?
332 // This method is MED specific : don't use it
334 inline void MESH::read(const MED_MED_DRIVER & genDriver)
336 const char * LOC = "MESH::read(const MED_MED_DRIVER & genDriver): ";
339 for (int index=0; index < _drivers.size(); index++ )
340 if ( *_drivers[index] == genDriver ) {
341 _drivers[index]->open();
342 _drivers[index]->read();
343 _drivers[index]->close();
344 // ? FINALEMENT PAS BESOIN DE L'EXCEPTION ?
351 /*! Set the MESH name */
352 inline void MESH::setName(string name)
354 _name=name ; //NOM interne à la classe
357 /*! Get the MESH name */
358 inline string MESH::getName() const
363 /*! Get the dimension of the space */
364 inline int MESH::getSpaceDimension() const
366 return _spaceDimension;
369 /*! Get the dimension of the MESH */
370 inline int MESH::getMeshDimension() const
372 return _meshDimension;
375 /*! Get the number of nodes used in the MESH */
376 inline int MESH::getNumberOfNodes() const
378 return _numberOfNodes;
381 /*! Get the COORDINATES object. Use it only if you need COORDINATES informations not provided by the MESH class.*/
382 inline const COORDINATE * MESH::getCoordinateptr() const
384 checkGridFillCoords();
388 /*! Get the system in which coordinates are given (CARTESIAN,CYLINDRICAL,SPHERICAL) __??MED_CART??__. */
389 inline string MESH::getCoordinatesSystem() const
391 return _coordinate->getCoordinatesSystem();
394 /*! Get the whole coordinates array in a given interlacing mode. The interlacing mode are :
395 - MED_NO_INTERLACE : X1 X2 Y1 Y2 Z1 Z2
396 - MED_FULL_INTERLACE : X1 Y1 Z1 X2 Y2 Z2
398 inline const double * MESH::getCoordinates(medModeSwitch Mode) const
400 checkGridFillCoords();
401 return _coordinate->getCoordinates(Mode);
404 /*! Get the coordinate n° number on axis n°axis*/
405 inline const double MESH::getCoordinate(int number, int axis) const
407 checkGridFillCoords();
408 return _coordinate->getCoordinate(number,axis);
411 /*! Get the coordinate names array ("x ","y ","z ")
412 of size n*MED_TAILLE_PNOM
414 inline const string * MESH::getCoordinatesNames() const
416 return _coordinate->getCoordinatesNames();
419 /*! Get the coordinate unit names array ("cm ","cm ","cm ")
420 of size n*MED_TAILLE_PNOM
422 inline const string * MESH::getCoordinatesUnits() const
424 return _coordinate->getCoordinatesUnits();
426 // int * MESH::getNodesNumbers() const
428 // return nodesNumbers;
431 /*! Get the number of different geometric types for a given entity type.
433 For exemple getNumberOfTypes(MED_CELL) would return 3 is the MESH
434 have some MED_TETRA4, MED_PYRA5 and MED_HEXA6 in it.
436 medEntityMesh entity : MED_CELL, MED_FACE, MED_EDGE, MED_NODE, MED_ALL_ENTITIES
438 If entity is not defined, return 0.
440 If there is no connectivity, return an exception.
442 inline int MESH::getNumberOfTypes(medEntityMesh entity) const
444 MESSAGE("MESH::getNumberOfTypes(medEntityMesh entity) : "<<entity);
445 if (entity == MED_NODE)
447 checkGridFillConnectivity();
448 if (_connectivity != NULL)
449 return _connectivity->getNumberOfTypes(entity) ;
450 throw MEDEXCEPTION(LOCALIZED("MESH::getNumberOfTypes( medEntityMesh ) : Connectivity not defined !"));
454 Get the list of geometric types used by a given entity.
455 medEntityMesh entity : MED_CELL, MED_FACE, MED_EDGE, MED_ALL_ENTITIES
457 REM : Don't use MED_NODE
459 If entity is not defined, return an exception.
461 inline const medGeometryElement * MESH::getTypes(medEntityMesh entity) const
463 if (entity == MED_NODE)
464 throw MEDEXCEPTION(LOCALIZED("MESH::getTypes( medEntityMesh ) : No medGeometryElement with MED_NODE entity !"));
465 // return un tableau de taille 1 contenant MED_NONE, comme les supports pour etre coherent avec getNumberOfTypes ???? PG
467 checkGridFillConnectivity();
468 if (_connectivity != NULL)
469 return _connectivity->getGeometricTypes(entity) ;
470 throw MEDEXCEPTION(LOCALIZED("MESH::getTypes( medEntityMesh ) : Connectivity not defined !"));
474 Get the whole list of CELLMODEL used by cells of given type (medEntityMesh).
476 REMARK : Don't use MED_NODE as medEntityMesh
478 inline const CELLMODEL * MESH::getCellsTypes(medEntityMesh Entity) const
480 checkGridFillConnectivity();
481 if (_connectivity != NULL)
482 return _connectivity->getCellsTypes(Entity) ;
483 throw MEDEXCEPTION(LOCALIZED("MESH::getCellsTypes( medEntityMesh ) : Connectivity not defined !"));
486 /*! Return an array of size NumbreOfTypes+1 which contains, for each
487 geometric type of the given entity, the first global element number
490 For exemple, if we have a mesh with 5 triangles and 4 quadrangle :
491 - size of GlobalNumberingIndex is 3
492 - GlobalNumberingIndex[0]=1 (the first type)
493 - GlobalNumberingIndex[1]=6 (the second type)
494 - GlobalNumberingIndex[2]=10
496 inline const int * MESH::getGlobalNumberingIndex(medEntityMesh entity) const
498 checkGridFillConnectivity();
499 if (_connectivity != NULL)
500 return _connectivity->getGlobalNumberingIndex(entity);
501 throw MEDEXCEPTION(LOCALIZED("MESH::getNumberOfTypes( medEntityMesh ) : Connectivity not defined !"));
504 Return the number of element of given geometric type of given entity. Return 0 if query is not defined.
507 - getNumberOfElements(MED_NODE,MED_NONE) : number of node
508 - getNumberOfElements(MED_NODE,MED_TRIA3) : return 0 (not defined)
509 - getNumberOfElements(MED_FACE,MED_TRIA3) : return number of triangles
510 elements defined in face entity (0 if not defined)
511 - getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS) : return total number
512 of elements defined in cell entity
514 inline int MESH::getNumberOfElements(medEntityMesh entity, medGeometryElement Type) const
516 const char * LOC = "MESH::getNumberOfElements(medEntityMesh,medGeometryElement) : " ;
517 if (entity==MED_NODE)
518 if ((Type==MED_NONE)|(Type==MED_ALL_ELEMENTS))
519 return _numberOfNodes ;
522 //throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"wrong medGeometryElement with MED_NODE"));
525 checkGridFillConnectivity();
526 if (_connectivity != (CONNECTIVITY*)NULL)
527 return _connectivity->getNumberOf(entity,Type) ;
530 //throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"connectivity not defined !"));
534 Return true if the wanted connectivity exist, else return false
535 (to use before a getSomething method).
537 inline bool MESH::existConnectivity(medConnectivity connectivityType, medEntityMesh entity) const
539 checkGridFillConnectivity();
540 if (_connectivity==(CONNECTIVITY*)NULL)
541 throw MEDEXCEPTION("MESH::existConnectivity(medConnectivity,medEntityMesh) : no connectivity defined !");
542 return _connectivity->existConnectivity(connectivityType,entity) ;
545 Return the geometric type of global element Number of entity Entity.
547 Throw an exception if Entity is not defined or Number are wrong (too big).
549 inline medGeometryElement MESH::getElementType(medEntityMesh Entity,int Number) const
551 checkGridFillConnectivity();
552 if (_connectivity==(CONNECTIVITY*)NULL)
553 throw MEDEXCEPTION("MESH::getElementType(medEntityMesh,int) : no connectivity defined !");
554 return _connectivity->getElementType(Entity,Number) ;
557 Calculate the ask connectivity. Return an exception if this could not be
558 done. Do nothing if connectivity already exist.
561 inline void MESH::calculateConnectivity(medModeSwitch Mode,medConnectivity ConnectivityType,medEntityMesh entity)
563 checkGridFillConnectivity();
564 if (Mode==MED_FULL_INTERLACE)
565 _connectivity->calculateConnectivity(ConnectivityType,entity) ;
567 throw MEDEXCEPTION(LOCALIZED("MESH::calculateConnectivity : only for MED_FULL_INTERLACE mode"));
570 Return the required connectivity in the right mode for the given
571 geometric type of the given entity.
573 To get connectivity for all geometric type, use Mode=MED_FULL_INTERLACE
574 and Type=MED_ALL_ELEMENTS.
575 You must also get the corresponding index array.
577 inline const int * MESH::getConnectivity(medModeSwitch Mode,medConnectivity ConnectivityType,medEntityMesh entity, medGeometryElement Type) const
579 checkGridFillConnectivity();
580 if (Mode==MED_FULL_INTERLACE)
581 return _connectivity->getConnectivity(ConnectivityType,entity,Type) ;
582 throw MEDEXCEPTION(LOCALIZED("MESH::getConnectivity : only for MED_FULL_INTERLACE mode"));
585 Return the required index array for a connectivity received in
586 MED_FULL_ENTERLACE mode and MED_ALL_ELEMENTS type.
588 This array allow to find connectivity of each elements.
590 Example : Connectivity of i^{th} elements (1<=i<=NumberOfElement) begin
591 at index ConnectivityIndex[i-1] and end at index ConnectivityIndex[i]-1
592 in Connectivity array (Connectivity[ConnectivityIndex[i-1]-1] is the
595 inline const int * MESH::getConnectivityIndex(medConnectivity ConnectivityType,medEntityMesh entity) const
597 checkGridFillConnectivity();
598 return _connectivity->getConnectivityIndex(ConnectivityType, entity) ;
601 Return the reverse connectivity required by ConnectivityType :
602 - If ConnectivityType=MED_NODAL : return connectivity node-cell
603 - If ConnectivityType=MED_DESCENDING : return connectivity face-cell
605 You must get ReverseConnectivityIndex array to use it.
607 inline const int * MESH::getReverseConnectivity(medConnectivity ConnectivityType,medEntityMesh Entity/*=MED_CELL*/) const
609 checkGridFillConnectivity();
610 if (NULL==_connectivity)
611 throw MEDEXCEPTION("MESH::getReverseConnectivity : no connectivity defined in MESH !");
613 return _connectivity->getReverseConnectivity(ConnectivityType,Entity) ;
616 Return the index array required by ConnectivityType.
618 This array allow to find reverse connectivity of each elements.
620 Example : Reverse connectivity of i^{th} elements (1<=i<=NumberOfElement)
621 begin at index ReverseConnectivityIndex[i-1] and end at index
622 ReverseConnectivityIndex[i]-1
623 in ReverseConnectivity array (
624 ReverseConnectivity[ReverseConnectivityIndex[i-1]-1]
627 inline const int * MESH::getReverseConnectivityIndex(medConnectivity ConnectivityType,medEntityMesh Entity/*=MED_CELL*/) const
629 checkGridFillConnectivity();
630 if (NULL==_connectivity)
631 throw MEDEXCEPTION("MESH::getReverseConnectivityIndex : no connectivity defined in MESH !");
633 return _connectivity->getReverseConnectivityIndex(ConnectivityType,Entity) ;
637 inline int MESH::getNumberOfFamilies (medEntityMesh entity) const
641 return _numberOfNodesFamilies ;
643 return _numberOfCellsFamilies ;
645 return _numberOfFacesFamilies ;
647 return _numberOfEdgesFamilies ;
649 throw MEDEXCEPTION("MESH::getNumberOfFamilies : Unknown entity");
652 inline int MESH::getNumberOfGroups (medEntityMesh entity) const
656 return _numberOfNodesGroups ;
658 return _numberOfCellsGroups ;
660 return _numberOfFacesGroups ;
662 return _numberOfEdgesGroups ;
664 throw MEDEXCEPTION("MESH::getNumberOfGroups : Unknown entity");
667 const vector<FAMILY*> MESH::getFamilies(medEntityMesh entity) const
679 throw MEDEXCEPTION("MESH::getFamilies : Unknown entity");
683 const vector<GROUP*> MESH::getGroups(medEntityMesh entity) const
695 throw MEDEXCEPTION("MESH::getGroups : Unknown entity");
699 const FAMILY* MESH::getFamily(medEntityMesh entity, int i) const
702 throw MEDEXCEPTION("MESH::getFamily(i) : argument i must be > 0");
703 int NumberOfFamilies = 0 ;
704 vector<FAMILY*> Family ;
707 NumberOfFamilies = _numberOfNodesFamilies ;
708 Family = _familyNode ;
712 NumberOfFamilies = _numberOfCellsFamilies ;
713 Family = _familyCell ;
717 NumberOfFamilies = _numberOfFacesFamilies ;
718 Family = _familyFace ;
722 NumberOfFamilies = _numberOfEdgesFamilies ;
723 Family = _familyEdge ;
727 throw MEDEXCEPTION("MESH::getFamilies : Unknown entity");
729 if (i>NumberOfFamilies)
730 throw MEDEXCEPTION("MESH::getFamily(entity,i) : argument i must be <= _numberOfFamilies");
734 const GROUP* MESH::getGroup(medEntityMesh entity, int i) const
736 const char * LOC = "MESH::getGroup(medEntityMesh entity, int i) : " ;
738 throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"argument i must be > 0"));
739 int NumberOfGroups = 0 ;
740 vector<GROUP*> Group ;
743 NumberOfGroups = _numberOfNodesGroups ;
748 NumberOfGroups = _numberOfCellsGroups ;
753 NumberOfGroups = _numberOfFacesGroups ;
758 NumberOfGroups = _numberOfEdgesGroups ;
763 throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"Unknown entity"));
765 if (i>NumberOfGroups)
766 throw MEDEXCEPTION(LOCALIZED(STRING(LOC)<<"argument i="<<i<<" must be <= _numberOfGroups="<<NumberOfGroups));
775 //inline void MESH::write(const string & driverName) {
776 // write(0,driverName);
779 inline bool MESH::getIsAGrid()
784 #endif /* MESH_HXX */