#ifndef MEDMEM_Grid_HeaderFile
#define MEDMEM_Grid_HeaderFile
+#include <MEDMEM.hxx>
+
#include "MEDMEM_Mesh.hxx"
// class containing structured mesh data
namespace MEDMEM {
-class GRID: public MESH
+class MEDMEM_EXPORT GRID: public MESH
{
protected:
//-----------------------//
bool _is_coordinates_filled;
bool _is_connectivity_filled;
+ // 4. is _gridType a true value or just a default one
+ bool _is_default_gridType;
+
//-----------------------//
// Protected Methods
//-----------------------//
inline bool existConnectivity(MED_EN::medConnectivity ConnectivityType,
MED_EN::medEntityMesh Entity) const;
+ inline bool existConnectivityWithPoly(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity) const;
+
inline MED_EN::medGeometryElement getElementType(MED_EN::medEntityMesh Entity,
int Number) const;
// Cas où le nombre d'éléments n'est pas nul
if (entity==MED_EN::MED_FACE && (Type==MED_EN::MED_QUAD4 || Type==MED_EN::MED_ALL_ELEMENTS) && _spaceDimension>2)
+ if ( _meshDimension == 2 )
numberOfElements=(_iArrayLength-1)*(_jArrayLength-1);
-
+ else
+ numberOfElements=
+ (_iArrayLength-1)*(_jArrayLength-1)*_kArrayLength +
+ (_jArrayLength-1)*(_kArrayLength-1)*_iArrayLength +
+ (_iArrayLength-1)*(_kArrayLength-1)*_jArrayLength;
+
else if (entity==MED_EN::MED_EDGE && (Type==MED_EN::MED_SEG2 || Type==MED_EN::MED_ALL_ELEMENTS) && _spaceDimension>1)
+ if ( _meshDimension == 1 )
numberOfElements=_iArrayLength-1;
-
+ else if ( _meshDimension == 2 )
+ numberOfElements=
+ (_iArrayLength-1)*_jArrayLength + (_jArrayLength-1)*_iArrayLength;
+ else
+ numberOfElements=
+ (_iArrayLength-1)*_jArrayLength*_kArrayLength +
+ (_jArrayLength-1)*_kArrayLength*_iArrayLength +
+ (_kArrayLength-1)*_iArrayLength*_jArrayLength;
+
else if (entity==MED_EN::MED_NODE && (Type==MED_EN::MED_NONE || Type==MED_EN::MED_ALL_ELEMENTS) && _spaceDimension>0)
numberOfElements=_numberOfNodes;
return _connectivity->existConnectivity(connectivityType,entity);
}
+/*!
+ Same as the previous
+ */
+inline bool GRID::existConnectivityWithPoly(MED_EN::medConnectivity ConnectivityType,
+ MED_EN::medEntityMesh Entity) const
+{
+ return existConnectivity(ConnectivityType,Entity);
+}
+
/*!
Return the geometric type of global element Number of entity Entity.