Version: 5.1.6

MEDMEM.GRID Class Reference

#include <MEDMEM_Grid.hxx>

Inheritance diagram for MEDMEM.GRID:
Inheritance graph

Public Member Functions

CONNECTIVITYmakeConnectivity (const MED_EN::medEntityMesh Entity, const MED_EN::medGeometryElement Geometry, const int NbEntities, int NbNodes, int nbMeshNodes, const int *NodeNumbers) const
 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)
 Constructor specifying the axes of the grid.
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 COORDINATEgetCoordinateptr () const
const doublegetCoordinates (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)
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)

Data Fields

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 MEDMEM.GRID.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 &  meshName = "" 
)
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_array specifies the node coordinates for each direction
coord_name names of the different coordinates
coord_unit names of the different coordinate units
type grid type (MED_POLAR, MED_CARTESIAN)

References MEDMEM.MESH._coordinate, MEDMEM.GRID._gridType, MEDMEM.GRID._iArray, MEDMEM.GRID._iArrayLength, MEDMEM.GRID._is_connectivity_filled, MEDMEM.GRID._is_coordinates_filled, MEDMEM.GRID._is_default_gridType, MEDMEM.MESH._isAGrid, MEDMEM.GRID._jArray, MEDMEM.GRID._jArrayLength, MEDMEM.GRID._kArray, MEDMEM.GRID._kArrayLength, MEDMEM.MESH._meshDimension, MEDMEM.MESH._numberOfNodes, MEDMEM.MESH._spaceDimension, med_test1.begin, med_test1.end, MEDMEM.GRID.init(), MED_EN.MED_CARTESIAN, MED_EN.MED_POLAR, MEDMEM.COORDINATE.setCoordinatesSystem(), and test_NonCoincidentDEC.size.

GRID::~GRID (  )  [virtual]

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
GRID & GRID::operator= ( const GRID m  ) 

Reimplemented from MEDMEM.MESH.

void GRID::init (  )  [virtual]
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]
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.

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

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

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.

References MESSAGE_MED.

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

Reimplemented from MEDMEM.MESH.

References MESSAGE_MED.

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, LOCALIZED, MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, MED_EN.MED_HEXA8, MED_EN.MED_NODE, MED_EN.MED_POINT1, MED_EN.MED_QUAD4, and MED_EN.MED_SEG2.

MED_EN::medGeometryElement * GRID::getTypesWithPoly ( MED_EN::medEntityMesh  Entity  )  const [virtual]
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, MEDMEM.GRID.fillConnectivity(), MEDMEM.CONNECTIVITY.getCellsTypes(), LOCALIZED, and NULL.

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, MEDMEM.GRID.fillConnectivity(), MEDMEM.CONNECTIVITY.getGlobalNumberingIndex(), LOCALIZED, and NULL.

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

Reimplemented from MEDMEM.MESH.

References MEDMEM.GRID.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, MEDMEM.CONNECTIVITY.existConnectivity(), MEDMEM.GRID.fillConnectivity(), and NULL.

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, MEDMEM.GRID.fillConnectivity(), MEDMEM.CONNECTIVITY.getElementType(), and NULL.

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

Reimplemented from MEDMEM.MESH.

References MEDMEM.GRID.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, MEDMEM.CONNECTIVITY.calculateConnectivity(), MEDMEM.GRID.fillConnectivity(), LOCALIZED, and MED_EN.MED_FULL_INTERLACE.

const CONNECTIVITY * MEDMEM.GRID::getConnectivityptr (  )  const [virtual]
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, MEDMEM.GRID.fillConnectivity(), MEDMEM.CONNECTIVITY.getConnectivity(), LOCALIZED, and MED_EN.MED_FULL_INTERLACE.

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, MEDMEM.GRID.fillConnectivity(), and MEDMEM.CONNECTIVITY.getConnectivityIndex().

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, MEDMEM.GRID.fillConnectivity(), MEDMEM.CONNECTIVITY.getReverseConnectivity(), and NULL.

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, MEDMEM.GRID.fillConnectivity(), MEDMEM.CONNECTIVITY.getReverseConnectivityIndex(), and NULL.

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

References MEDMEM.GRID._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.


Field Documentation