MEDMEM::GRID Class Reference

Inheritance diagram for MEDMEM::GRID:
Inheritance graph
[legend]
Collaboration diagram for MEDMEM::GRID:
Collaboration graph
[legend]

List of all members.

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 ()
void fillCoordinates () const
void fillConnectivity () const
void makeUnstructured ()
void fillMeshAfterRead ()
void writeUnstructured (int index=0, const string &driverName="")
void read (int index=0)
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)
const COORDINATE * getCoordinateptr () const
const double * getCoordinates (MED_EN::medModeSwitch Mode) const
const double getCoordinate (int Number, int Axis) const
int getNumberOfTypes (MED_EN::medEntityMesh Entity) const
int getNumberOfTypesWithPoly (MED_EN::medEntityMesh Entity) const
const MED_EN::medGeometryElement * getTypes (MED_EN::medEntityMesh Entity) const
MED_EN::medGeometryElement * getTypesWithPoly (MED_EN::medEntityMesh Entity) const
const CELLMODEL * getCellsTypes (MED_EN::medEntityMesh Entity) const
const int * getGlobalNumberingIndex (MED_EN::medEntityMesh Entity) const
int getNumberOfElements (MED_EN::medEntityMesh Entity, MED_EN::medGeometryElement Type) const
int getNumberOfElementsWithPoly (MED_EN::medEntityMesh Entity, MED_EN::medGeometryElement Type) const
bool existConnectivity (MED_EN::medConnectivity ConnectivityType, MED_EN::medEntityMesh Entity) const
MED_EN::medGeometryElement getElementType (MED_EN::medEntityMesh Entity, int Number) const
MED_EN::medGeometryElement getElementTypeWithPoly (MED_EN::medEntityMesh Entity, int Number) const
void calculateConnectivity (MED_EN::medModeSwitch Mode, MED_EN::medConnectivity ConnectivityType, MED_EN::medEntityMesh Entity) const
const CONNECTIVITY * getConnectivityptr () const
const int * getConnectivity (MED_EN::medModeSwitch Mode, MED_EN::medConnectivity ConnectivityType, MED_EN::medEntityMesh Entity, MED_EN::medGeometryElement Type) const
const int * getConnectivityIndex (MED_EN::medConnectivity ConnectivityType, MED_EN::medEntityMesh Entity) const
const int * getReverseConnectivity (MED_EN::medConnectivity ConnectivityType, MED_EN::medEntityMesh Entity=MED_EN::MED_CELL) const
const int * getReverseConnectivityIndex (MED_EN::medConnectivity ConnectivityType, MED_EN::medEntityMesh Entity=MED_EN::MED_CELL) const
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.

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 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 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

CONNECTIVITY * makeConnectivity (const MED_EN::medEntityMesh Entity, const MED_EN::medGeometryElement Geometry, const int NbEntities, int NbNodes, int nbMeshNodes, const int *NodeNumbers) const

Protected Attributes

MED_EN::med_grid_type _gridType
int _iArrayLength
double * _iArray
int _jArrayLength
double * _jArray
int _kArrayLength
double * _kArray
bool _is_coordinates_filled
bool _is_connectivity_filled
bool _is_default_gridType

Friends

class IMED_MESH_RDONLY_DRIVER
class IMED_MESH_WRONLY_DRIVER
class MED_MESH_RDONLY_DRIVER21
class MED_MESH_WRONLY_DRIVER21
class MED_MESH_RDONLY_DRIVER22
class MED_MESH_WRONLY_DRIVER22
class ENSIGHT_MESH_RDONLY_DRIVER

Constructor & Destructor Documentation

GRID::GRID (  ) 

References init().

GRID::GRID ( const MED_EN::med_grid_type  type  ) 
GRID::GRID ( const GRID m  ) 
GRID::GRID ( driverTypes  driverType,
const string &  fileName = "",
const string &  meshName = "" 
)
GRID::~GRID (  )  [virtual]

References _iArray, _jArray, and _kArray.


Member Function Documentation

CONNECTIVITY * GRID::makeConnectivity ( const MED_EN::medEntityMesh  Entity,
const MED_EN::medGeometryElement  Geometry,
const int  NbEntities,
int  NbNodes,
int  nbMeshNodes,
const int *  NodeNumbers 
) const [protected]

Referenced by fillConnectivity().

GRID & GRID::operator= ( const GRID m  ) 
void GRID::init (  )  [virtual]
void GRID::fillCoordinates (  )  const
void GRID::fillConnectivity (  )  const
void MEDMEM::GRID::makeUnstructured (  ) 

References fillConnectivity(), and fillCoordinates().

Referenced by writeUnstructured().

void GRID::fillMeshAfterRead (  ) 
void GRID::writeUnstructured ( int  index = 0,
const string &  driverName = "" 
)
void GRID::read ( int  index = 0  )  [virtual]
int MEDMEM::GRID::getNodeNumber ( const int  i,
const int  j = 0,
const int  k = 0 
) const

References _iArrayLength, and _jArrayLength.

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

References _iArrayLength, and _jArrayLength.

MED_EN::med_grid_type MEDMEM::GRID::getGridType (  )  const
const COORDINATE * MEDMEM::GRID::getCoordinateptr (  )  const [virtual]

Get the COORDINATES object. Use it only if you need COORDINATES informations not provided by the GRID class via the MESH class.

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_coordinate, and fillCoordinates().

const double * MEDMEM::GRID::getCoordinates ( MED_EN::medModeSwitch  Mode  )  const [virtual]

Get the whole coordinates array in a given interlacing mode. The interlacing mode are :

  • MED_NO_INTERLACE : X1 X2 Y1 Y2 Z1 Z2
  • MED_FULL_INTERLACE : X1 Y1 Z1 X2 Y2 Z2

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_coordinate, and fillCoordinates().

const double MEDMEM::GRID::getCoordinate ( int  number,
int  axis 
) const [virtual]

Get the coordinate n° number on axis n°axis

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_coordinate, and fillCoordinates().

int MEDMEM::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

Reimplemented from MEDMEM::MESH.

int MEDMEM::GRID::getNumberOfTypesWithPoly ( MED_EN::medEntityMesh  Entity  )  const [virtual]

Method equivalent to getNumberOfTypes except that it includes not only classical Types but polygons/polyhedra also.

Reimplemented from MEDMEM::MESH.

Referenced by getTypesWithPoly().

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

return the GRID Geometric type, without computing all connectivity

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_spaceDimension.

Referenced by getTypesWithPoly().

MED_EN::medGeometryElement * GRID::getTypesWithPoly ( MED_EN::medEntityMesh  Entity  )  const [virtual]

Reimplemented from MEDMEM::MESH.

References getNumberOfTypesWithPoly(), and getTypes().

const CELLMODEL * MEDMEM::GRID::getCellsTypes ( MED_EN::medEntityMesh  Entity  )  const [virtual]

Get the whole list of CELLMODEL used by cells of given type (medEntityMesh).

REMARK : Don't use MED_NODE as medEntityMesh

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_connectivity, and fillConnectivity().

const int * MEDMEM::GRID::getGlobalNumberingIndex ( MED_EN::medEntityMesh  entity  )  const [virtual]

Return an array of size NumbreOfTypes+1 which contains, for each geometric type of the given entity, the first global element number of this type.

For exemple, if we have a mesh with 5 triangles and 4 quadrangle :

  • size of GlobalNumberingIndex is 3
  • GlobalNumberingIndex[0]=1 (the first type)
  • GlobalNumberingIndex[1]=6 (the second type)
  • GlobalNumberingIndex[2]=10

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_connectivity, and fillConnectivity().

int MEDMEM::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.

Reimplemented from MEDMEM::MESH.

References _iArrayLength, _jArrayLength, _kArrayLength, MEDMEM::MESH::_numberOfNodes, and MEDMEM::MESH::_spaceDimension.

Referenced by getNumberOfElementsWithPoly().

int MEDMEM::GRID::getNumberOfElementsWithPoly ( MED_EN::medEntityMesh  Entity,
MED_EN::medGeometryElement  Type 
) const [virtual]

Reimplemented from MEDMEM::MESH.

References getNumberOfElements().

bool MEDMEM::GRID::existConnectivity ( MED_EN::medConnectivity  connectivityType,
MED_EN::medEntityMesh  entity 
) const [virtual]

Return true if the wanted connectivity exist, else return false (to use before a getSomething method).

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_connectivity, and fillConnectivity().

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

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

Throw an exception if Entity is not defined or Number are wrong (too big).

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_connectivity, and fillConnectivity().

Referenced by getElementTypeWithPoly().

MED_EN::medGeometryElement MEDMEM::GRID::getElementTypeWithPoly ( MED_EN::medEntityMesh  Entity,
int  Number 
) const [virtual]

Method equivalent to getElementType except that it includes not only classical Types but polygons/polyhedra also.

Reimplemented from MEDMEM::MESH.

References getElementType().

void MEDMEM::GRID::calculateConnectivity ( MED_EN::medModeSwitch  Mode,
MED_EN::medConnectivity  ConnectivityType,
MED_EN::medEntityMesh  entity 
) const [virtual]

Calculate the ask connectivity. Return an exception if this could not be done. Do nothing if connectivity already exist.

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_connectivity, and fillConnectivity().

const CONNECTIVITY * MEDMEM::GRID::getConnectivityptr (  )  const [virtual]

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_connectivity, and fillConnectivity().

const int * MEDMEM::GRID::getConnectivity ( MED_EN::medModeSwitch  Mode,
MED_EN::medConnectivity  ConnectivityType,
MED_EN::medEntityMesh  entity,
MED_EN::medGeometryElement  Type 
) const [virtual]

Return the required connectivity in the right mode for the given geometric type of the given entity.

To get connectivity for all geometric type, use Mode=MED_FULL_INTERLACE and Type=MED_ALL_ELEMENTS. You must also get the corresponding index array.

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_connectivity, and fillConnectivity().

const int * MEDMEM::GRID::getConnectivityIndex ( MED_EN::medConnectivity  ConnectivityType,
MED_EN::medEntityMesh  entity 
) const [virtual]

Return the required index array for a connectivity received in MED_FULL_ENTERLACE mode and MED_ALL_ELEMENTS type.

This array allow to find connectivity of each elements.

Example : Connectivity of i^{th} elements (1<=i<=NumberOfElement) begin at index ConnectivityIndex[i-1] and end at index ConnectivityIndex[i]-1 in Connectivity array (Connectivity[ConnectivityIndex[i-1]-1] is the first value)

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_connectivity, and fillConnectivity().

const int * MEDMEM::GRID::getReverseConnectivity ( MED_EN::medConnectivity  ConnectivityType,
MED_EN::medEntityMesh  Entity = MED_EN::MED_CELL 
) const [virtual]

Return the reverse connectivity required by ConnectivityType :

  • If ConnectivityType=MED_NODAL : return connectivity node-cell
  • If ConnectivityType=MED_DESCENDING : return connectivity face-cell

You must get ReverseConnectivityIndex array to use it.

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_connectivity, and fillConnectivity().

const int * MEDMEM::GRID::getReverseConnectivityIndex ( MED_EN::medConnectivity  ConnectivityType,
MED_EN::medEntityMesh  Entity = MED_EN::MED_CELL 
) const [virtual]

Return the index array required by ConnectivityType.

This array allow to find reverse connectivity of each elements.

Example : Reverse connectivity of i^{th} elements (1<=i<=NumberOfElement) begin at index ReverseConnectivityIndex[i-1] and end at index ReverseConnectivityIndex[i]-1 in ReverseConnectivity array ( ReverseConnectivity[ReverseConnectivityIndex[i-1]-1] is the first value)

Reimplemented from MEDMEM::MESH.

References MEDMEM::MESH::_connectivity, and fillConnectivity().

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

References _gridType.


Friends And Related Function Documentation

friend class IMED_MESH_RDONLY_DRIVER [friend]

Reimplemented from MEDMEM::MESH.

friend class IMED_MESH_WRONLY_DRIVER [friend]

Reimplemented from MEDMEM::MESH.

friend class MED_MESH_RDONLY_DRIVER21 [friend]

Reimplemented from MEDMEM::MESH.

friend class MED_MESH_WRONLY_DRIVER21 [friend]

Reimplemented from MEDMEM::MESH.

friend class MED_MESH_RDONLY_DRIVER22 [friend]

Reimplemented from MEDMEM::MESH.

friend class MED_MESH_WRONLY_DRIVER22 [friend]

Reimplemented from MEDMEM::MESH.

friend class ENSIGHT_MESH_RDONLY_DRIVER [friend]

Reimplemented from MEDMEM::MESH.


Member Data Documentation

MED_EN::med_grid_type MEDMEM::GRID::_gridType [protected]
int MEDMEM::GRID::_iArrayLength [protected]
double* MEDMEM::GRID::_iArray [protected]

Referenced by fillCoordinates(), GRID(), init(), and ~GRID().

int MEDMEM::GRID::_jArrayLength [protected]
double* MEDMEM::GRID::_jArray [protected]

Referenced by fillCoordinates(), GRID(), init(), and ~GRID().

int MEDMEM::GRID::_kArrayLength [protected]
double* MEDMEM::GRID::_kArray [protected]

Referenced by fillCoordinates(), GRID(), init(), and ~GRID().

Referenced by GRID(), and init().

Generated on Sat May 1 03:22:50 2010 for Med Memory Users' Guide by  doxygen 1.6.3