Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef MEDMEM_Grid_HeaderFile
00031 #define MEDMEM_Grid_HeaderFile
00032
00033 #include <MEDMEM.hxx>
00034
00035 #include "MEDMEM_Mesh.hxx"
00036
00037
00038
00039 namespace MEDMEM {
00040 class MEDMEM_EXPORT GRID: public GMESH
00041 {
00042 protected:
00043
00044
00045
00046
00047
00048 MED_EN::med_grid_type _gridType;
00049
00050
00051 COORDINATE* _coordinate;
00052
00053
00054 int _iArrayLength;
00055 double* _iArray;
00056
00057 int _jArrayLength;
00058 double* _jArray;
00059
00060 int _kArrayLength;
00061 double* _kArray;
00062
00063
00064 bool _is_default_gridType;
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 protected:
00080 virtual bool isEmpty() const;
00081
00082
00083 public:
00084
00085
00086
00087
00088 GRID();
00089 GRID(const MED_EN::med_grid_type type);
00090 GRID(const GRID &m);
00091 GRID( driverTypes driverType, const string & fileName,const string & meshName);
00092 GRID(const std::vector<std::vector<double> >& xyz_array,
00093 const std::vector<std::string>& coord_name,
00094 const std::vector<std::string>& coord_unit,
00095 const MED_EN::med_grid_type type=MED_EN::MED_CARTESIAN);
00096 GRID & operator=(const GRID &m);
00097 virtual ~GRID();
00098 virtual void init();
00099 virtual bool deepCompare(const GMESH& other) const;
00100 virtual void printMySelf(std::ostream &os) const;
00101
00102 virtual const MESH * convertInMESH() const;
00103
00104 virtual int getMeshDimension() const;
00105 virtual bool getIsAGrid() const;
00106 virtual int getNumberOfNodes() const;
00107
00108 virtual std::string getCoordinatesSystem() const;
00109 virtual const std::string * getCoordinatesNames() const;
00110 virtual const std::string * getCoordinatesUnits() const;
00111
00112 virtual int getNumberOfTypes(MED_EN::medEntityMesh Entity) const;
00113 virtual int getNumberOfElements(MED_EN::medEntityMesh Entity,
00114 MED_EN::medGeometryElement Type) const;
00115 virtual const MED_EN::medGeometryElement * getTypes(MED_EN::medEntityMesh Entity) const;
00116 virtual MED_EN::medGeometryElement getElementType(MED_EN::medEntityMesh Entity,
00117 int Number) const;
00118
00119 virtual SUPPORT * getBoundaryElements(MED_EN::medEntityMesh Entity) const
00120 throw (MEDEXCEPTION);
00121 virtual SUPPORT * getSkin(const SUPPORT * Support3D)
00122 throw (MEDEXCEPTION);
00123 virtual SUPPORT *buildSupportOnNodeFromElementList(const std::list<int>& listOfElt, MED_EN::medEntityMesh entity) const throw (MEDEXCEPTION);
00124 virtual void fillSupportOnNodeFromElementList(const std::list<int>& listOfElt, SUPPORT *supportToFill) const throw (MEDEXCEPTION);
00125
00126 virtual FIELD<double>* getVolume (const SUPPORT * Support, bool isAbs = true) const
00127 throw (MEDEXCEPTION);
00128
00129 virtual FIELD<double>* getArea (const SUPPORT * Support) const
00130 throw (MEDEXCEPTION);
00131
00132 virtual FIELD<double>* getLength (const SUPPORT * Support) const
00133 throw (MEDEXCEPTION);
00134
00135 virtual FIELD<double>* getNormal (const SUPPORT * Support) const
00136 throw (MEDEXCEPTION);
00137
00138 virtual FIELD<double>* getBarycenter (const SUPPORT * Support) const
00139 throw (MEDEXCEPTION);
00140
00141 virtual vector< vector<double> > getBoundingBox() const;
00142
00143
00144
00145
00146
00147 inline int getNodeNumber(const int i, const int j=0, const int k=0) const;
00148
00149
00150
00151
00152 inline int getCellNumber(const int i, const int j=0, const int k=0) const ;
00153
00154
00155
00156
00157 int getEdgeNumber(const int Axis, const int i, const int j=0, const int k=0) const throw (MEDEXCEPTION) ;
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168 int getFaceNumber(const int Axis, const int i, const int j=0, const int k=0) const throw (MEDEXCEPTION) ;
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180 void getNodePosition(const int Number, int& i, int& j, int& k) const throw (MEDEXCEPTION) ;
00181 void getCellPosition(const int Number, int& i, int& j, int& k) const throw (MEDEXCEPTION) ;
00182 void getEdgePosition(const int Number, int& Axis, int& i, int& j, int& k) const throw (MEDEXCEPTION) ;
00183 void getFacePosition(const int Number, int& Axis, int& i, int& j, int& k) const throw (MEDEXCEPTION) ;
00184
00185
00186
00187
00188
00189
00190
00191
00192 inline MED_EN::med_grid_type getGridType() const;
00193
00194
00195 int getArrayLength( const int Axis ) const throw (MEDEXCEPTION);
00196
00197
00198
00199 const double getArrayValue (const int Axis, const int i) const throw (MEDEXCEPTION) ;
00200
00201
00202
00203
00204 inline void setGridType(MED_EN::med_grid_type gridType);
00205
00206
00207 friend class MED_MESH_RDONLY_DRIVER;
00208 friend class MED_MESH_WRONLY_DRIVER;
00209 friend class ENSIGHT_MESH_RDONLY_DRIVER;
00210 };
00211
00212
00213
00214
00215
00216
00217 inline MED_EN::med_grid_type GRID::getGridType() const
00218 {
00219 return _gridType;
00220 }
00221
00222
00223
00224
00225
00226 inline int GRID::getNodeNumber(const int i, const int j, const int k) const
00227 {
00228 return 1 + i + _iArrayLength * j + _iArrayLength * _jArrayLength * k;
00229 }
00230
00231
00232
00233
00234
00235
00236 inline int GRID::getCellNumber(const int i, const int j, const int k) const
00237 {
00238 return 1 + i + (_iArrayLength-1) * j + (_iArrayLength-1) * (_jArrayLength-1) * k;
00239 }
00240
00241
00242
00243
00244
00245
00246 inline void GRID::setGridType(MED_EN::med_grid_type gridType)
00247 {
00248 _gridType = gridType;
00249 }
00250
00251 }
00252
00253 #endif