Version: 6.5.0
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
MEDMEM::GRID Class Reference
Inheritance diagram for MEDMEM::GRID:
Inheritance graph
[legend]
Collaboration diagram for MEDMEM::GRID:
Collaboration graph
[legend]

Public Member Functions

 GRID ()
 GRID (const MED_EN::med_grid_type type)
 GRID (const GRID &m)
 GRID (driverTypes driverType, const string &fileName, const string &meshName)
 GRID (const std::vector< std::vector< double > > &xyz_array, const std::vector< std::string > &coord_name, const std::vector< std::string > &coord_unit, const MED_EN::med_grid_type type=MED_EN::MED_CARTESIAN)
GRIDoperator= (const GRID &m)
virtual ~GRID ()
virtual void init ()
virtual bool deepCompare (const GMESH &other) const
virtual void printMySelf (std::ostream &os) const
virtual const MESHconvertInMESH () const
virtual int getMeshDimension () const
virtual bool getIsAGrid () const
virtual int getNumberOfNodes () const
virtual std::string getCoordinatesSystem () const
virtual const std::string * getCoordinatesNames () const
virtual const std::string * getCoordinatesUnits () const
virtual int getNumberOfTypes (MED_EN::medEntityMesh Entity) const
virtual int getNumberOfElements (MED_EN::medEntityMesh Entity, MED_EN::medGeometryElement Type) const
virtual const
MED_EN::medGeometryElement * 
getTypes (MED_EN::medEntityMesh Entity) const
virtual MED_EN::medGeometryElement getElementType (MED_EN::medEntityMesh Entity, int Number) const
virtual SUPPORTgetBoundaryElements (MED_EN::medEntityMesh Entity) const throw (MEDEXCEPTION)
virtual SUPPORTgetSkin (const SUPPORT *Support3D) throw (MEDEXCEPTION)
virtual SUPPORTbuildSupportOnNodeFromElementList (const std::list< int > &listOfElt, MED_EN::medEntityMesh entity) const throw (MEDEXCEPTION)
virtual void fillSupportOnNodeFromElementList (const std::list< int > &listOfElt, SUPPORT *supportToFill) const throw (MEDEXCEPTION)
virtual FIELD< double > * getVolume (const SUPPORT *Support, bool isAbs=true) const throw (MEDEXCEPTION)
virtual FIELD< double > * getArea (const SUPPORT *Support) const throw (MEDEXCEPTION)
virtual FIELD< double > * getLength (const SUPPORT *Support) const throw (MEDEXCEPTION)
virtual FIELD< double > * getNormal (const SUPPORT *Support) const throw (MEDEXCEPTION)
virtual FIELD< double > * getBarycenter (const SUPPORT *Support) const throw (MEDEXCEPTION)
virtual vector< vector< double > > getBoundingBox () const
int getNodeNumber (const int i, const int j=0, const int k=0) const
int getCellNumber (const int i, const int j=0, const int k=0) const
MED_EN::med_grid_type getGridType () const
int getArrayLength (const int Axis) const throw (MEDEXCEPTION)
const double getArrayValue (const int Axis, const int i) const throw (MEDEXCEPTION)
void setGridType (MED_EN::med_grid_type gridType)
Position to number conversion methods

getXXXNumber methods enable the user to convert an $ (i,j,k)$ position into a global number in the array.

Axis [1,2,3] means one of directions: along i, j or k. For cell constituents (FACE or EDGE), Axis selects one of those having same $ (i, j, k )$ :

  • a FACE which is normal to direction along given Axis;
  • an EDGE going along given Axis. i, j and k counts from zero.

Exception for Axis out of range. For 2D grids, k is a dummy argument.

int getEdgeNumber (const int Axis, const int i, const int j=0, const int k=0) const throw (MEDEXCEPTION)
int getFaceNumber (const int Axis, const int i, const int j=0, const int k=0) const throw (MEDEXCEPTION)
Number to position conversion methods

getXXXPosition functions enable the user to convert a number into a $ (i,j,k) $ position. Axis [1,2,3] means one of directions: along i, j or k For Cell constituents (FACE or EDGE), Axis selects one of those having same (i,j,k):

  • a FACE which is normal to direction along given Axis;
  • an EDGE going along given Axis.

Exception for Number out of range.

void getNodePosition (const int Number, int &i, int &j, int &k) const throw (MEDEXCEPTION)
void getCellPosition (const int Number, int &i, int &j, int &k) const throw (MEDEXCEPTION)
void getEdgePosition (const int Number, int &Axis, int &i, int &j, int &k) const throw (MEDEXCEPTION)
void getFacePosition (const int Number, int &Axis, int &i, int &j, int &k) const throw (MEDEXCEPTION)
- Public Member Functions inherited from MEDMEM::GMESH
 GMESH ()
 GMESH (GMESH &m)
virtual ~GMESH ()
GMESHoperator= (const GMESH &m)
virtual bool operator== (const GMESH &other) const
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)
int addDriver (GENDRIVER &driver)
void rmDriver (int index=0)
virtual void read (int index=0)
virtual void read (const GENDRIVER &genDriver)
virtual void read (driverTypes driverType, const std::string &filename, const std::string &meshname)
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
void setName (std::string name)
std::string getName () const
void setDescription (std::string description)
std::string getDescription () const
int getSpaceDimension () const
virtual int getNumberOfFamilies (MED_EN::medEntityMesh Entity) const
virtual const std::vector
< FAMILY * > 
getFamilies (MED_EN::medEntityMesh Entity) const
virtual const FAMILY * getFamily (MED_EN::medEntityMesh Entity, int i) const
virtual int getNumberOfGroups (MED_EN::medEntityMesh Entity) const
virtual const std::vector
< GROUP * > 
getGroups (MED_EN::medEntityMesh Entity) const
virtual const GROUP * getGroup (MED_EN::medEntityMesh Entity, int i) const
virtual const GROUP * getGroup (const std::string &name) const throw (MEDEXCEPTION)
virtual const SUPPORTgetSupportOnAll (MED_EN::medEntityMesh Entity) const throw (MEDEXCEPTION)
virtual SUPPORTbuildSupportOnElementsFromElementList (const std::list< int > &listOfElt, MED_EN::medEntityMesh entity) const throw (MEDEXCEPTION)
void createFamilies ()
void createGroups ()

Protected Member Functions

virtual bool isEmpty () const

Protected Attributes

MED_EN::med_grid_type _gridType
COORDINATE * _coordinate
int _iArrayLength
double * _iArray
int _jArrayLength
double * _jArray
int _kArrayLength
double * _kArray
bool _is_default_gridType
- Protected Attributes inherited from MEDMEM::GMESH
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 ENSIGHT_MESH_RDONLY_DRIVER

Additional Inherited Members

- Static Public Member Functions inherited from MEDMEM::GMESH
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)

Constructor & Destructor Documentation

GRID::GRID ( )
GRID::GRID ( const MED_EN::med_grid_type  type)
GRID::GRID ( const GRID m)
GRID::~GRID ( )
virtual

References _coordinate, _iArray, _jArray, and _kArray.

Member Function Documentation

bool GRID::isEmpty ( ) const
protectedvirtual

Return true if contains no elements.

Implements MEDMEM::GMESH.

References _coordinate, and _iArrayLength.

GRID & GRID::operator= ( const GRID m)
void GRID::init ( )
virtual

Initialization of fields.

Reimplemented from MEDMEM::GMESH.

References _coordinate, _gridType, _iArray, _iArrayLength, _is_default_gridType, _jArray, _jArrayLength, _kArray, and _kArrayLength.

Referenced by GRID().

bool GRID::deepCompare ( const GMESH gother) const
virtual

Returns true if mesh other has same coordinates (to 1E-15 precision ) and same connectivity as the calling object. Information like name or description is not taken into account for the comparison.

Implements MEDMEM::GMESH.

References _coordinate, _gridType, _iArray, _iArrayLength, _jArray, _jArrayLength, _kArray, _kArrayLength, getIsAGrid(), MEDMEM::GMESH::getIsAGrid(), and MEDMEM::GMESH::getSpaceDimension().

void GRID::printMySelf ( std::ostream &  os) const
virtual

print my contents

Implements MEDMEM::GMESH.

const MESH * GRID::convertInMESH ( ) const
virtual
int GRID::getMeshDimension ( ) const
virtual

Return mesh dimension.

Implements MEDMEM::GMESH.

References MEDMEM::GMESH::getSpaceDimension().

Referenced by getNumberOfElements().

bool GRID::getIsAGrid ( ) const
virtual

It is a grid.

Implements MEDMEM::GMESH.

Referenced by deepCompare().

int GRID::getNumberOfNodes ( ) const
virtual
std::string GRID::getCoordinatesSystem ( ) const
virtual

Returns "CARTESIAN", "CYLINDRICAL" or "SPHERICAL"

Implements MEDMEM::GMESH.

References _coordinate.

Referenced by convertInMESH().

const std::string * GRID::getCoordinatesNames ( ) const
virtual

Returns an array with names of coordinates.
Example :

  • x,y,z
  • r,teta,phi
  • ...

Implements MEDMEM::GMESH.

References _coordinate.

Referenced by convertInMESH().

const std::string * GRID::getCoordinatesUnits ( ) const
virtual

Returns an array with units of coordinates (cm, m, mm, ...) It could be empty. We suppose we are IS (meter).

Implements MEDMEM::GMESH.

References _coordinate.

Referenced by convertInMESH().

int GRID::getNumberOfTypes ( MED_EN::medEntityMesh  entity) const
virtual

Get the number of different geometric types for a given entity type.

medEntityMesh entity : MED_CELL, MED_FACE, MED_EDGE, MED_NODE, MED_ALL_ENTITIES

Implements MEDMEM::GMESH.

Referenced by convertInMESH().

int GRID::getNumberOfElements ( MED_EN::medEntityMesh  entity,
MED_EN::medGeometryElement  Type 
) const
virtual

Return the number of element of given geometric type of given entity. Return 0 if query is not defined.

Implements MEDMEM::GMESH.

References _iArrayLength, _jArrayLength, _kArrayLength, MEDMEM::GMESH::_spaceDimension, getMeshDimension(), and getNumberOfNodes().

Referenced by convertInMESH().

const medGeometryElement * GRID::getTypes ( MED_EN::medEntityMesh  entity) const
virtual

return the GRID Geometric type, without computing all connectivity

Implements MEDMEM::GMESH.

References MEDMEM::GMESH::_spaceDimension.

Referenced by convertInMESH(), and getElementType().

MED_EN::medGeometryElement GRID::getElementType ( MED_EN::medEntityMesh  Entity,
int  Number 
) const
virtual

Return the geometric type of global element Number of entity Entity.

Implements MEDMEM::GMESH.

References getTypes().

SUPPORT * GRID::getBoundaryElements ( MED_EN::medEntityMesh  Entity) const throw (MEDEXCEPTION)
virtual

Returns a support which reference all elements on the boundary of mesh. For a d-dimensional mesh, a boundary element is defined as a d-1 dimension element that is referenced by only one element in the full descending connectivity.

This method can also return the list of nodes that belong to the boundary elements.

WARNING: This method can recalculate descending connectivity from partial to full form, so that partial SUPPORT on d-1 dimension elements becomes invalid.

Parameters
Entityentity on which the boundary is desired. It has to be either MED_NODE or the d-1 dimension entity type (MED_FACE in 3D, MED_EDGE in 2D).

Implements MEDMEM::GMESH.

SUPPORT * GRID::getSkin ( const SUPPORT Support3D) throw (MEDEXCEPTION)
virtual

Implements MEDMEM::GMESH.

SUPPORT * GRID::buildSupportOnNodeFromElementList ( const std::list< int > &  listOfElt,
MED_EN::medEntityMesh  entity 
) const throw (MEDEXCEPTION)
virtual

Implements MEDMEM::GMESH.

void GRID::fillSupportOnNodeFromElementList ( const std::list< int > &  listOfElt,
SUPPORT supportToFill 
) const throw (MEDEXCEPTION)
virtual

Implements MEDMEM::GMESH.

FIELD< double > * GRID::getVolume ( const SUPPORT Support,
bool  isAbs = true 
) const throw (MEDEXCEPTION)
virtual

Implements MEDMEM::GMESH.

FIELD< double > * GRID::getArea ( const SUPPORT Support) const throw (MEDEXCEPTION)
virtual

Implements MEDMEM::GMESH.

FIELD< double > * GRID::getLength ( const SUPPORT Support) const throw (MEDEXCEPTION)
virtual

Implements MEDMEM::GMESH.

FIELD< double > * GRID::getNormal ( const SUPPORT Support) const throw (MEDEXCEPTION)
virtual

Implements MEDMEM::GMESH.

FIELD< double > * GRID::getBarycenter ( const SUPPORT Support) const throw (MEDEXCEPTION)
virtual

Implements MEDMEM::GMESH.

vector< vector< double > > GRID::getBoundingBox ( ) const
virtual

Implements MEDMEM::GMESH.

int MEDMEM::GRID::getNodeNumber ( const int  i,
const int  j = 0,
const int  k = 0 
) const

Referenced by convertInMESH().

int MEDMEM::GRID::getCellNumber ( const int  i,
const int  j = 0,
const int  k = 0 
) const
MED_EN::med_grid_type MEDMEM::GRID::getGridType ( ) const
void MEDMEM::GRID::setGridType ( MED_EN::med_grid_type  gridType)

Friends And Related Function Documentation

friend class MED_MESH_RDONLY_DRIVER
friend
friend class MED_MESH_WRONLY_DRIVER
friend
friend class ENSIGHT_MESH_RDONLY_DRIVER
friend

Member Data Documentation

MED_EN::med_grid_type MEDMEM::GRID::_gridType
protected
COORDINATE* MEDMEM::GRID::_coordinate
protected
int MEDMEM::GRID::_iArrayLength
protected
double* MEDMEM::GRID::_iArray
protected
int MEDMEM::GRID::_jArrayLength
protected
double* MEDMEM::GRID::_jArray
protected
int MEDMEM::GRID::_kArrayLength
protected
double* MEDMEM::GRID::_kArray
protected
bool MEDMEM::GRID::_is_default_gridType
protected

Referenced by GRID(), and init().

Copyright © 2007-2012 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