Version: 6.3.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends

MEDMEM.GMESH Class Reference

Base class of structured and unstructured meshes. More...

#include <MEDMEM_GMesh.hxx>

Inheritance diagram for MEDMEM.GMESH:
Inheritance graph

Public Member Functions

 GMESH ()
 GMESH (GMESH &m)
virtual ~GMESH ()
 Destructor.
virtual void init ()
 Initialization of fields.
GMESHoperator= (const GMESH &m)
 Copy operator.
virtual bool operator== (const GMESH &other) const
 Comparison.
virtual bool deepCompare (const GMESH &other) const =0
virtual void printMySelf (std::ostream &os) const =0
int addDriver (driverTypes driverType, const std::string &fileName="Default File Name.med", const std::string &driverName="Default Mesh Name", MED_EN::med_mode_acces access=MED_EN::RDWR)
 Add a MESH driver of type driverTypes (MED_DRIVER, ....) associated with file fileName. The meshname used in the file is driverName. addDriver returns an integer handler.
int addDriver (GENDRIVER &driver)
void rmDriver (int index=0)
virtual void read (int index=0)
 Read mesh from the file using given driver.
virtual void read (const GENDRIVER &genDriver)
virtual void read (driverTypes driverType, const std::string &filename, const std::string &meshname)
 Reads the GMESH.
virtual void write (int index=0) const
virtual void write (const GENDRIVER &genDriver, MED_EN::med_mode_acces medMode=MED_EN::WRONLY) const
virtual void write (driverTypes driverType, const std::string &filename, const std::string &meshname="", MED_EN::med_mode_acces medMode=MED_EN::WRONLY) const
 Writes all the content of the GMESH.
void setName (std::string name)
std::string getName () const
void setDescription (std::string description)
std::string getDescription () const
int getSpaceDimension () const
virtual int getMeshDimension () const =0
virtual bool getIsAGrid () const =0
virtual std::string getCoordinatesSystem () const =0
virtual const std::string * getCoordinatesNames () const =0
virtual const std::string * getCoordinatesUnits () const =0
virtual int getNumberOfNodes () const =0
virtual int getNumberOfTypes (MED_EN::medEntityMesh Entity) const =0
virtual int getNumberOfElements (MED_EN::medEntityMesh Entity, MED_EN::medGeometryElement Type) const =0
virtual const
MED_EN::medGeometryElement
getTypes (MED_EN::medEntityMesh Entity) const =0
virtual MED_EN::medGeometryElement getElementType (MED_EN::medEntityMesh Entity, int Number) const =0
virtual int getNumberOfFamilies (MED_EN::medEntityMesh Entity) const
virtual const std::vector
< FAMILY * > 
getFamilies (MED_EN::medEntityMesh Entity) const
virtual const FAMILYgetFamily (MED_EN::medEntityMesh Entity, int i) const
 Return a family.
virtual int getNumberOfGroups (MED_EN::medEntityMesh Entity) const
virtual const std::vector
< GROUP * > 
getGroups (MED_EN::medEntityMesh Entity) const
virtual const GROUPgetGroup (MED_EN::medEntityMesh Entity, int i) const
 Return a group.
virtual const GROUPgetGroup (const std::string &name) const throw (MEDEXCEPTION)
virtual const MESHconvertInMESH () const =0
 Return unstructured mesh. Call removeReference() after having finished using it!!!
virtual SUPPORTgetBoundaryElements (MED_EN::medEntityMesh Entity) const =0 throw (MEDEXCEPTION)
virtual SUPPORTgetSkin (const SUPPORT *Support3D)=0 throw (MEDEXCEPTION)
virtual const SUPPORTgetSupportOnAll (MED_EN::medEntityMesh Entity) const throw (MEDEXCEPTION)
virtual SUPPORTbuildSupportOnNodeFromElementList (const std::list< int > &listOfElt, MED_EN::medEntityMesh entity) const =0 throw (MEDEXCEPTION)
virtual void fillSupportOnNodeFromElementList (const std::list< int > &listOfElt, SUPPORT *supportToFill) const =0 throw (MEDEXCEPTION)
virtual SUPPORTbuildSupportOnElementsFromElementList (const std::list< int > &listOfElt, MED_EN::medEntityMesh entity) const throw (MEDEXCEPTION)
virtual FIELD< double > * getVolume (const SUPPORT *Support, bool isAbs=true) const =0 throw (MEDEXCEPTION)
virtual FIELD< double > * getArea (const SUPPORT *Support) const =0 throw (MEDEXCEPTION)
virtual FIELD< double > * getLength (const SUPPORT *Support) const =0 throw (MEDEXCEPTION)
virtual FIELD< double > * getNormal (const SUPPORT *Support) const =0 throw (MEDEXCEPTION)
virtual FIELD< double > * getBarycenter (const SUPPORT *Support) const =0 throw (MEDEXCEPTION)
virtual vector< vector< double > > getBoundingBox () const =0
void createFamilies ()
void createGroups ()

Static Public Member Functions

static SUPPORTmergeSupports (const std::vector< SUPPORT * > Supports) throw (MEDEXCEPTION)
static SUPPORTintersectSupports (const std::vector< SUPPORT * > Supports) throw (MEDEXCEPTION)
template<class T >
static FIELD< T > * mergeFields (const std::vector< FIELD< T > * > &others, bool meshCompare=false)

Protected Member Functions

virtual bool isEmpty () const =0

Protected Attributes

std::string _name
std::string _description
int _spaceDimension
std::vector< FAMILY * > _familyNode
std::vector< FAMILY * > _familyCell
std::vector< FAMILY * > _familyFace
std::vector< FAMILY * > _familyEdge
std::vector< GROUP * > _groupNode
std::vector< GROUP * > _groupCell
std::vector< GROUP * > _groupFace
std::vector< GROUP * > _groupEdge
std::vector< GENDRIVER * > _drivers
std::map
< MED_EN::medEntityMesh,
SUPPORT * > 
_entitySupport

Friends

class MED_MESH_RDONLY_DRIVER
class MED_MESH_WRONLY_DRIVER
class GIBI_MESH_RDONLY_DRIVER
class GIBI_MESH_WRONLY_DRIVER
class GIBI_MESH_RDWR_DRIVER
class PORFLOW_MESH_RDONLY_DRIVER
class PORFLOW_MESH_WRONLY_DRIVER
class PORFLOW_MESH_RDWR_DRIVER
class VTK_MESH_DRIVER
class ENSIGHT_MESH_RDONLY_DRIVER
std::ostream & operator<< (std::ostream &os, const GMESH &me)

Detailed Description

Base class of structured and unstructured meshes.


Constructor & Destructor Documentation

GMESH::GMESH ( )

Create an empty GMESH.

References init.

GMESH::GMESH ( GMESH m)
GMESH::~GMESH ( ) [virtual]

Destructor.

References medClient_test.index, and Med_Gen_test.it.


Member Function Documentation

virtual bool MEDMEM.GMESH.isEmpty ( ) const [protected, pure virtual]
void GMESH::init ( ) [virtual]

Initialization of fields.

Reimplemented in MEDMEM.GRID, and MEDMEM.MESH.

References BEGIN_OF_MED, END_OF_MED, and MED_EN.MED_INVALID.

GMESH & GMESH::operator= ( const GMESH m)

Copy operator.

References BEGIN_OF_MED, END_OF_MED, and MESSAGE_MED.

bool GMESH::operator== ( const GMESH other) const [virtual]

Comparison.

Reimplemented in MEDMEM.GMESHClient.

virtual bool MEDMEM.GMESH.deepCompare ( const GMESH other) const [pure virtual]
virtual void MEDMEM.GMESH.printMySelf ( std::ostream &  os) const [pure virtual]

Implemented in MEDMEM.GRID, and MEDMEM.MESH.

int GMESH::addDriver ( driverTypes  driverType,
const std::string &  fileName = "Default File Name.med",
const std::string &  driverName = "Default Mesh Name",
MED_EN::med_mode_acces  access = MED_EN::RDWR 
)

Add a MESH driver of type driverTypes (MED_DRIVER, ....) associated with file fileName. The meshname used in the file is driverName. addDriver returns an integer handler.

References BEGIN_OF_MED, MEDMEM.DRIVERFACTORY.buildDriverForMesh(), medMeshing_test.driver, END_OF_MED, and SCRUTE_MED.

int GMESH::addDriver ( GENDRIVER driver)
void GMESH::rmDriver ( int  index = 0)

Remove an existing MESH driver.

References BEGIN_OF_MED, END_OF_MED, medClient_test.index, LOCALIZED, and MED_EXCEPTION.

void GMESH::read ( int  index = 0) [virtual]

Read mesh from the file using given driver.

Parameters:
index- index of driver to use for reading

References BEGIN_OF_MED, END_OF_MED, medClient_test.index, LOCALIZED, and MED_EXCEPTION.

void GMESH::read ( const GENDRIVER driver) [virtual]
void GMESH::read ( driverTypes  driverType,
const std::string &  filename,
const std::string &  meshname 
) [virtual]

Reads the GMESH.

Parameters:
driverType- type of driver to use for reading
filename- file to read from
meshname- name of a mesh to read

References MEDMEM.DRIVERFACTORY.buildDriverForMesh(), and MED_EN.RDONLY.

void GMESH::write ( int  index = 0) const [virtual]

Writes all the content of the MESH using driver referenced by the integer handle returned by a addDriver call.

Example :

//...
// Attaching the driver to file "output.med", meshname "Mesh"
int driver_handle = mesh.addDriver(MED_DRIVER, "output.med", "Mesh");
// Writing the content of mesh to the file
mesh.write(driver_handle);

Reimplemented in MEDMEM.GMESHClient, and MEDMEM.MESHClient.

References BEGIN_OF_MED, END_OF_MED, medClient_test.index, LOCALIZED, and MED_EXCEPTION.

void GMESH::write ( const GENDRIVER driver,
MED_EN::med_mode_acces  medMode = MED_EN::WRONLY 
) const [virtual]
void GMESH::write ( driverTypes  driverType,
const std::string &  filename,
const std::string &  meshname = "",
MED_EN::med_mode_acces  medMode = MED_EN::WRONLY 
) const [virtual]

Writes all the content of the GMESH.

Parameters:
driverType- type of driver to use for writing
filename- file to write into
meshname- mesh name
medMode- file access mode

Reimplemented in MEDMEM.GMESHClient, and MEDMEM.MESHClient.

References MEDMEM.DRIVERFACTORY.buildDriverForMesh(), test_MEDSPLITTER.meshname, and MED_EN.WRONLY.

void GMESH::setName ( std::string  name)

Sets the MESH name. Name should not exceed MED_TAILLE_NOM length defined in Med (i.e. 32 characters).

References medClient_test.name.

string GMESH::getName ( ) const

Gets the MESH name.

void GMESH::setDescription ( std::string  description)

Set the MESH description

Sets the MESH description. Description should not exceed MED_TAILLE_DESC length defined in Med (i.e. 200 characters).

string GMESH::getDescription ( ) const

Gets the MESH description. The string returned contains a short description of the mesh, which is stored for information purposes only.

int GMESH::getSpaceDimension ( ) const

Gets the dimension of the space in which the mesh is described (2 for planar meshes, 3 for volumes and 3D surfaces) .

virtual int MEDMEM.GMESH.getMeshDimension ( ) const [pure virtual]
virtual bool MEDMEM.GMESH.getIsAGrid ( ) const [pure virtual]
virtual std::string MEDMEM.GMESH.getCoordinatesSystem ( ) const [pure virtual]
virtual const std::string* MEDMEM.GMESH.getCoordinatesNames ( ) const [pure virtual]
virtual const std::string* MEDMEM.GMESH.getCoordinatesUnits ( ) const [pure virtual]
virtual int MEDMEM.GMESH.getNumberOfNodes ( ) const [pure virtual]
virtual int MEDMEM.GMESH.getNumberOfTypes ( MED_EN::medEntityMesh  Entity) const [pure virtual]
virtual int MEDMEM.GMESH.getNumberOfElements ( MED_EN::medEntityMesh  Entity,
MED_EN::medGeometryElement  Type 
) const [pure virtual]
virtual const MED_EN::medGeometryElement* MEDMEM.GMESH.getTypes ( MED_EN::medEntityMesh  Entity) const [pure virtual]
virtual MED_EN::medGeometryElement MEDMEM.GMESH.getElementType ( MED_EN::medEntityMesh  Entity,
int  Number 
) const [pure virtual]
int GMESH::getNumberOfFamilies ( MED_EN::medEntityMesh  entity) const [virtual]

Retrieves the number of families in the mesh for entity type entity

References MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, and MED_EN.MED_NODE.

const vector< MEDMEM::FAMILY * > GMESH::getFamilies ( MED_EN::medEntityMesh  entity) const [virtual]

Returns the families of type entity present in the mesh as a vector of pointers

References MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, and MED_EN.MED_NODE.

const MEDMEM::FAMILY * GMESH::getFamily ( MED_EN::medEntityMesh  entity,
int  i 
) const [virtual]

Return a family.

Parameters:
entity- entity of the family
i- index of the family
Return values:
constMEDMEM.FAMILY* - pointer to the family

References MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, and MED_EN.MED_NODE.

int GMESH::getNumberOfGroups ( MED_EN::medEntityMesh  entity) const [virtual]

Retrieves the number of groups in the mesh for entity type entity

References MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, and MED_EN.MED_NODE.

const vector< GROUP * > GMESH::getGroups ( MED_EN::medEntityMesh  entity) const [virtual]

Returns the groups of type entity present in the mesh as a vector of pointers. The GROUP class inheriting from the SUPPORT class, the methods that can be used on these groups are explained in the related section.

References MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, and MED_EN.MED_NODE.

const GROUP * GMESH::getGroup ( MED_EN::medEntityMesh  entity,
int  i 
) const [virtual]

Return a group.

Parameters:
entity- entity of the group
i- index of the group
Return values:
constGROUP* - pointer to the group

References LOCALIZED, MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, and MED_EN.MED_NODE.

const GROUP * GMESH::getGroup ( const std::string &  name) const throw (MEDEXCEPTION) [virtual]

Retrieves the group named name. The method browses all the entities in order to find the group. If two groups with the same name coexist, the first one found will be returned. If no group with the correct name is found, the method throws an exception.

References MEDMEM.SUPPORT.getName(), med_test1.group, and medClient_test.name.

virtual const MESH* MEDMEM.GMESH.convertInMESH ( ) const [pure virtual]

Return unstructured mesh. Call removeReference() after having finished using it!!!

Implemented in MEDMEM.GMESHClient, MEDMEM.GRID, and MEDMEM.MESH.

virtual SUPPORT* MEDMEM.GMESH.getBoundaryElements ( MED_EN::medEntityMesh  Entity) const throw (MEDEXCEPTION) [pure virtual]
virtual SUPPORT* MEDMEM.GMESH.getSkin ( const SUPPORT Support3D) throw (MEDEXCEPTION) [pure virtual]
const SUPPORT * GMESH::getSupportOnAll ( MED_EN::medEntityMesh  Entity) const throw (MEDEXCEPTION) [virtual]
SUPPORT * GMESH::mergeSupports ( const std::vector< SUPPORT * >  Supports) throw (MEDEXCEPTION) [static]

Return a SUPPORT pointer on the union of all SUPPORTs in Supports. You should delete this pointer after use to avoid memory leaks.

References BEGIN_OF_MED, MEDMEM.SUPPORT.blending(), END_OF_MED, LOCALIZED, MED_EXCEPTION, MESSAGE_MED, and test_NonCoincidentDEC.size.

SUPPORT * GMESH::intersectSupports ( const std::vector< SUPPORT * >  Supports) throw (MEDEXCEPTION) [static]

return a SUPPORT pointer on the intersection of all SUPPORTs in Supports. The (SUPPORT *) NULL pointer is returned if the intersection is empty. You should delete this pointer after use to avois memory leaks.

References BEGIN_OF_MED, END_OF_MED, MEDMEM.SUPPORT.intersecting(), MESSAGE_MED, and test_NonCoincidentDEC.size.

virtual SUPPORT* MEDMEM.GMESH.buildSupportOnNodeFromElementList ( const std::list< int > &  listOfElt,
MED_EN::medEntityMesh  entity 
) const throw (MEDEXCEPTION) [pure virtual]
virtual void MEDMEM.GMESH.fillSupportOnNodeFromElementList ( const std::list< int > &  listOfElt,
SUPPORT supportToFill 
) const throw (MEDEXCEPTION) [pure virtual]
SUPPORT * GMESH::buildSupportOnElementsFromElementList ( const std::list< int > &  listOfElt,
MED_EN::medEntityMesh  entity 
) const throw (MEDEXCEPTION) [virtual]

Method created to factorize code. This method creates a new support on entity 'entity' (to deallocate) containing all the entities contained in elements 'listOfElt' of entity 'entity'.

References BEGIN_OF_MED, END_OF_MED, med_opsupp_test.entity, MEDMEM.SUPPORT.fillFromElementList(), MEDMEM.SUPPORT.setEntity(), MEDMEM.SUPPORT.setMesh(), and MEDMEM.SUPPORT.setName().

virtual FIELD<double>* MEDMEM.GMESH.getVolume ( const SUPPORT Support,
bool  isAbs = true 
) const throw (MEDEXCEPTION) [pure virtual]
virtual FIELD<double>* MEDMEM.GMESH.getArea ( const SUPPORT Support) const throw (MEDEXCEPTION) [pure virtual]
virtual FIELD<double>* MEDMEM.GMESH.getLength ( const SUPPORT Support) const throw (MEDEXCEPTION) [pure virtual]
virtual FIELD<double>* MEDMEM.GMESH.getNormal ( const SUPPORT Support) const throw (MEDEXCEPTION) [pure virtual]
virtual FIELD<double>* MEDMEM.GMESH.getBarycenter ( const SUPPORT Support) const throw (MEDEXCEPTION) [pure virtual]
virtual vector< vector<double> > MEDMEM.GMESH.getBoundingBox ( ) const [pure virtual]
template<class T >
FIELD< T > * MEDMEM.GMESH::mergeFields ( const std::vector< FIELD< T > * > &  others,
bool  meshCompare = false 
) [static]
void GMESH::createFamilies ( )
void GMESH::createGroups ( )

Create groups from families.

It is used to create groups that have only one family for meshes that come from codes that use families instead of groups to define a subregion.

References med_opsupp_test.entity, med_test1.group, MED_EN.MED_ALL_ENTITIES, MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, and MED_EN.MED_NODE.


Friends And Related Function Documentation

friend class MED_MESH_RDONLY_DRIVER [friend]

Reimplemented in MEDMEM.GRID, and MEDMEM.MESH.

friend class MED_MESH_WRONLY_DRIVER [friend]

Reimplemented in MEDMEM.GRID, and MEDMEM.MESH.

friend class GIBI_MESH_RDONLY_DRIVER [friend]

Reimplemented in MEDMEM.MESH.

friend class GIBI_MESH_WRONLY_DRIVER [friend]

Reimplemented in MEDMEM.MESH.

friend class GIBI_MESH_RDWR_DRIVER [friend]

Reimplemented in MEDMEM.MESH.

friend class PORFLOW_MESH_RDONLY_DRIVER [friend]

Reimplemented in MEDMEM.MESH.

friend class PORFLOW_MESH_WRONLY_DRIVER [friend]

Reimplemented in MEDMEM.MESH.

friend class PORFLOW_MESH_RDWR_DRIVER [friend]

Reimplemented in MEDMEM.MESH.

friend class VTK_MESH_DRIVER [friend]

Reimplemented in MEDMEM.MESH.

friend class ENSIGHT_MESH_RDONLY_DRIVER [friend]

Reimplemented in MEDMEM.GRID, and MEDMEM.MESH.

std::ostream& operator<< ( std::ostream &  os,
const GMESH me 
) [friend]

Field Documentation

std::string MEDMEM.GMESH._name [protected]
std::string MEDMEM.GMESH._description [protected]
std::vector<FAMILY*> MEDMEM.GMESH._familyNode [protected]
std::vector<FAMILY*> MEDMEM.GMESH._familyCell [protected]
std::vector<FAMILY*> MEDMEM.GMESH._familyFace [protected]
std::vector<FAMILY*> MEDMEM.GMESH._familyEdge [protected]
std::vector<GROUP*> MEDMEM.GMESH._groupNode [protected]
std::vector<GROUP*> MEDMEM.GMESH._groupCell [protected]
std::vector<GROUP*> MEDMEM.GMESH._groupFace [protected]
std::vector<GROUP*> MEDMEM.GMESH._groupEdge [protected]
std::vector<GENDRIVER *> MEDMEM.GMESH._drivers [protected]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS