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="")
 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
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)
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)
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 COORDINATEgetCoordinateptr () 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::medGeometryElementgetTypes (MED_EN::medEntityMesh Entity) const
MED_EN::medGeometryElementgetTypesWithPoly (MED_EN::medEntityMesh Entity) const
const CELLMODELgetCellsTypes (MED_EN::medEntityMesh Entity) const
const intgetGlobalNumberingIndex (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 CONNECTIVITYgetConnectivityptr () const
const intgetConnectivity (MED_EN::medModeSwitch Mode, MED_EN::medConnectivity ConnectivityType, MED_EN::medEntityMesh Entity, MED_EN::medGeometryElement Type) const
const intgetConnectivityIndex (MED_EN::medConnectivity ConnectivityType, MED_EN::medEntityMesh Entity) const
const intgetReverseConnectivity (MED_EN::medConnectivity ConnectivityType, MED_EN::medEntityMesh Entity=MED_EN::MED_CELL) const
const intgetReverseConnectivityIndex (MED_EN::medConnectivity ConnectivityType, MED_EN::medEntityMesh Entity=MED_EN::MED_CELL) const
void setGridType (MED_EN::med_grid_type gridType)

Protected Member Functions

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

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

Constructor & Destructor Documentation

GRID::GRID  ) 
 

MEDMEM.GRID.GRID const MED_EN::med_grid_type  type  ) 
 

GRID::GRID const GRID m  ) 
 

GRID::GRID driverTypes  driverType,
const string &  fileName = "",
const string &  meshName = ""
 

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

GRID::~GRID  )  [virtual]
 


Member Function Documentation

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

GRID & GRID::operator= const GRID m  ) 
 

void GRID::init  )  [virtual]
 

Reimplemented from MEDMEM.MESH.

void GRID::fillCoordinates  )  const
 

void GRID::fillConnectivity  )  const
 

void MEDMEM.GRID::makeUnstructured  ) 
 

void GRID::fillMeshAfterRead  ) 
 

void GRID::writeUnstructured int  index = 0,
const string &  driverName = ""
 

void GRID::read int  index = 0  )  [virtual]
 

Reimplemented from MEDMEM.MESH.

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)
 

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

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

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

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

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

MED_EN::med_grid_type MEDMEM.GRID::getGridType  )  const
 

int GRID::getArrayLength const int  Axis  )  const throw (MEDEXCEPTION)
 

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

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.

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.

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

Get the coordinate n° number on axis n°axis

Reimplemented from MEDMEM.MESH.

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]
 

Reimplemented from MEDMEM.MESH.

const MED_EN::medGeometryElement* MEDMEM.GRID.getTypes MED_EN::medEntityMesh  Entity  )  const [virtual]
 

Reimplemented from MEDMEM.MESH.

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

Reimplemented from MEDMEM.MESH.

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.

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.

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.

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

Reimplemented from MEDMEM.MESH.

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.

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.

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

Reimplemented from MEDMEM.MESH.

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.

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

Reimplemented from MEDMEM.MESH.

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.

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.

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.

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.

void MEDMEM.GRID::setGridType MED_EN::med_grid_type  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.


Field Documentation

MED_EN::med_grid_type MEDMEM.GRID._gridType [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_coordinates_filled [protected]
 

bool MEDMEM.GRID._is_connectivity_filled [protected]