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

MEDMEM.GRID Class Reference

#include <MEDMEM_Grid.hxx>

Inheritance diagram for MEDMEM.GRID:
Inheritance graph

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)
 Reads a GRID form the file.
 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)
 Constructor specifying the axes of the grid.
GRIDoperator= (const GRID &m)
virtual ~GRID ()
virtual void init ()
virtual bool deepCompare (const GMESH &other) const
virtual void printMySelf (std::ostream &os) const
 print my contents
virtual const MESHconvertInMESH () const
 Create an unstructured MESH. Call removeReference() after having finished using it!!!
virtual int getMeshDimension () const
 Return mesh dimension.
virtual bool getIsAGrid () const
 It is a grid.
virtual int getNumberOfNodes () const
 Return number of nodes.
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)

Protected Member Functions

virtual bool isEmpty () const
 Return true if contains no elements.

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

Friends

class MED_MESH_RDONLY_DRIVER
class MED_MESH_WRONLY_DRIVER
class ENSIGHT_MESH_RDONLY_DRIVER

Constructor & Destructor Documentation

GRID::GRID ( )

References init, and MESSAGE_MED.

GRID::GRID ( const MED_EN::med_grid_type  type)
GRID::GRID ( const GRID m)
GRID::GRID ( driverTypes  driverType,
const string &  fileName,
const string &  driverName 
)

Reads a GRID form the file.

Parameters:
driverType- type of driver to read the specified file
fileName- the file name to read
driverName- name of a grid to read

References BEGIN_OF_MED, MEDMEM.DRIVERFACTORY.buildDriverForMesh(), END_OF_MED, MEDMEM.GRID.init(), and MED_EN.RDONLY.

GRID::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 
)

Constructor specifying the axes of the grid.

This constructor describes the grid by specifying the location of the nodes on each of the axis. The dimension of the grid is implicitly defined by the size of vector xyz_array.

Parameters:
xyz_arrayspecifies the node coordinates for each direction
coord_namenames of the different coordinates
coord_unitnames of the different coordinate units
typegrid type (MED_POLAR, MED_CARTESIAN)

References MEDMEM.GRID._coordinate, MEDMEM.GRID._gridType, MEDMEM.GRID._iArray, MEDMEM.GRID._iArrayLength, MEDMEM.GRID._is_default_gridType, MEDMEM.GRID._jArray, MEDMEM.GRID._jArrayLength, MEDMEM.GRID._kArray, MEDMEM.GRID._kArrayLength, MEDMEM.GMESH._spaceDimension, med_test1.begin, med_test1.end, MEDMEM.GRID.init(), MED_EN.MED_CARTESIAN, MED_EN.MED_POLAR, and MEDMEM.COORDINATE.setCoordinatesSystem().

GRID::~GRID ( ) [virtual]

Member Function Documentation

bool GRID::isEmpty ( ) const [protected, virtual]

Return true if contains no elements.

Implements MEDMEM.GMESH.

References MEDMEM.GRID._coordinate, and MEDMEM.GRID._iArrayLength.

GRID & GRID::operator= ( const GRID m)
void GRID::init ( ) [virtual]
bool GRID::deepCompare ( const GMESH gother) const [virtual]
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().

bool GRID::getIsAGrid ( ) const [virtual]

It is a grid.

Implements MEDMEM.GMESH.

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

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

Implements MEDMEM.GMESH.

References MEDMEM.GRID._coordinate, and MEDMEM.COORDINATE.getCoordinatesSystem().

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 MEDMEM.GRID._coordinate, and MEDMEM.COORDINATE.getCoordinatesNames().

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 MEDMEM.GRID._coordinate, and MEDMEM.COORDINATE.getCoordinatesUnits().

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.

References MESSAGE_MED.

int GRID::getNumberOfElements ( MED_EN::medEntityMesh  entity,
MED_EN::medGeometryElement  Type 
) const [virtual]
const medGeometryElement * GRID::getTypes ( MED_EN::medEntityMesh  entity) const [virtual]
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 MEDMEM.GRID.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.

References LOCALIZED, MED_EN.MED_ALL_ELEMENTS, MED_EN.MED_EDGE, MED_EN.MED_FACE, MED_EN.MED_NODE, and MED_EN.MED_POLAR.

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
int MEDMEM.GRID::getCellNumber ( const int  i,
const int  j = 0,
const int  k = 0 
) const
int GRID::getEdgeNumber ( const int  Axis,
const int  i,
const int  j = 0,
const int  k = 0 
) const throw (MEDEXCEPTION)

Edge position to number conversion method

References BEGIN_OF_MED, END_OF_MED, med_test_grid.I, med_test_grid.J, med_test_grid.K, LOCALIZED, and MED_EXCEPTION.

int GRID::getFaceNumber ( const int  Axis,
const int  i,
const int  j = 0,
const int  k = 0 
) const throw (MEDEXCEPTION)

Returns a NODE, EDGE, FACE, CELL number by its position in the grid. Axis [1,2,3] means one of directions: along i, j or k For Cell contituents (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 Axis out of range

References BEGIN_OF_MED, END_OF_MED, med_test_grid.I, med_test_grid.J, med_test_grid.K, LOCALIZED, and MED_EXCEPTION.

void GRID::getNodePosition ( const int  Number,
int i,
int j,
int k 
) const throw (MEDEXCEPTION)

Node number to position conversion method

References BEGIN_OF_MED, END_OF_MED, med_test_grid.I, med_test_grid.J, LOCALIZED, and MED_EXCEPTION.

void GRID::getCellPosition ( const int  Number,
int i,
int j,
int k 
) const throw (MEDEXCEPTION)

Cell number to position conversion method

References BEGIN_OF_MED, END_OF_MED, med_test_grid.I, and med_test_grid.J.

void GRID::getEdgePosition ( const int  Number,
int Axis,
int i,
int j,
int k 
) const throw (MEDEXCEPTION)

Edge number to poistion conversion method

References BEGIN_OF_MED, END_OF_MED, med_test_grid.I, med_test_grid.J, med_test_grid.K, LOCALIZED, and MED_EXCEPTION.

void GRID::getFacePosition ( const int  Number,
int Axis,
int i,
int j,
int k 
) const throw (MEDEXCEPTION)

Face number to position convertion method

References BEGIN_OF_MED, END_OF_MED, med_test_grid.I, med_test_grid.J, med_test_grid.K, LOCALIZED, and MED_EXCEPTION.

MED_EN::med_grid_type MEDMEM.GRID::getGridType ( ) const
int GRID::getArrayLength ( const int  Axis) const throw (MEDEXCEPTION)

Returns the number of nodes on axis number Axis (axis numbering starts at 1).

References LOCALIZED, and MED_EXCEPTION.

const double GRID::getArrayValue ( const int  Axis,
const int  i 
) const throw (MEDEXCEPTION)

Returns the value of node coordinate i on axis Axis.

References LOCALIZED, and MED_EXCEPTION.

void MEDMEM.GRID::setGridType ( MED_EN::med_grid_type  gridType)

Friends And Related Function Documentation

friend class MED_MESH_RDONLY_DRIVER [friend]

Reimplemented from MEDMEM.GMESH.

friend class MED_MESH_WRONLY_DRIVER [friend]

Reimplemented from MEDMEM.GMESH.

friend class ENSIGHT_MESH_RDONLY_DRIVER [friend]

Reimplemented from MEDMEM.GMESH.


Field Documentation

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