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 #ifndef PORFLOW_MESH_DRIVER_HXX
00024 #define PORFLOW_MESH_DRIVER_HXX
00025
00026 #include "MEDMEM.hxx"
00027
00028 #include <string>
00029 #include <fstream>
00030
00031 #include "MEDMEM_define.hxx"
00032 #include "MEDMEM_GenDriver.hxx"
00033
00034
00035 #include "MEDMEM_STRING.hxx"
00036 #include "MEDMEM_Exception.hxx"
00037 #include "MEDMEM_Utilities.hxx"
00038
00039 #include <vector>
00040 #include <set>
00041
00051 namespace MEDMEM {
00052 class GMESH;
00053 class MESH;
00054 class FAMILY;
00055 class GROUP;
00056 class CONNECTIVITY;
00057 struct _intermediateMED;
00058 struct _maille;
00059 class MEDMEM_EXPORT PORFLOW_MESH_DRIVER : public GENDRIVER
00060 {
00061 protected:
00062
00063 MESH * _ptrMesh;
00064
00065 string _meshName;
00066 ifstream _porflow;
00067
00068
00069
00070 enum
00071 {
00072 nb_geometrie_porflow = 6,
00073 nb_nodes_max = 8,
00074 nb_nodes2_max = 4,
00075 nb_faces_max = 6
00076 };
00077
00078
00079
00080 static const MED_EN::medGeometryElement geomPORFLOWtoMED[nb_geometrie_porflow];
00081
00082
00083
00084
00085 static const int numPORFLOWtoMED[nb_geometrie_porflow] [nb_nodes_max];
00086 static const int connectivityPORFLOW[nb_geometrie_porflow][nb_faces_max][nb_nodes2_max];
00087 inline static int geomMEDtoPorflow(MED_EN::medGeometryElement medGeo);
00088
00089
00090 public :
00091
00095 PORFLOW_MESH_DRIVER() ;
00099 PORFLOW_MESH_DRIVER(const string & fileName,
00100 GMESH * ptrMesh,
00101 MED_EN::med_mode_acces accessMode) ;
00105 PORFLOW_MESH_DRIVER(const PORFLOW_MESH_DRIVER & driver) ;
00106
00110 virtual ~PORFLOW_MESH_DRIVER() ;
00111
00112 void open() throw (MEDEXCEPTION);
00113 void close() throw (MEDEXCEPTION);
00114
00115 virtual void write( void ) const = 0 ;
00116 virtual void read ( void ) = 0 ;
00117
00123 void setMeshName(const string & meshName) ;
00127 string getMeshName() const ;
00128
00129 private:
00130 virtual GENDRIVER * copy ( void ) const = 0 ;
00131
00132 };
00133
00134
00135 class MEDMEM_EXPORT PORFLOW_MESH_RDONLY_DRIVER : public virtual PORFLOW_MESH_DRIVER
00136 {
00137
00138 public :
00139
00143 PORFLOW_MESH_RDONLY_DRIVER() ;
00147 PORFLOW_MESH_RDONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
00151 PORFLOW_MESH_RDONLY_DRIVER(const PORFLOW_MESH_RDONLY_DRIVER & driver) ;
00152
00156 virtual ~PORFLOW_MESH_RDONLY_DRIVER() ;
00157
00161 void write( void ) const throw (MEDEXCEPTION);
00165 void read ( void ) throw (MEDEXCEPTION);
00166
00167 private:
00168
00169 GENDRIVER * copy ( void ) const ;
00170
00171 static void readPorflowCoordinateFile(const string & coorFileName,_intermediateMED & medi,const int space_dimension);
00172 static void readPorflowConnectivityFile(bool hybride,const string & connecFileName,_intermediateMED & medi,std::vector<set<_maille>::iterator>& p_ma_table,int mesh_dimension);
00173
00174 };
00175
00184 class MEDMEM_EXPORT PORFLOW_MESH_WRONLY_DRIVER : public virtual PORFLOW_MESH_DRIVER {
00185
00186 public :
00187
00191 PORFLOW_MESH_WRONLY_DRIVER() ;
00195 PORFLOW_MESH_WRONLY_DRIVER(const string & fileName, GMESH * ptrMesh) ;
00199 PORFLOW_MESH_WRONLY_DRIVER(const PORFLOW_MESH_WRONLY_DRIVER & driver) ;
00200
00204 virtual ~PORFLOW_MESH_WRONLY_DRIVER() ;
00205
00209 void write( void ) const throw (MEDEXCEPTION);
00213 void read ( void ) throw (MEDEXCEPTION);
00214
00215 private:
00216
00217 GENDRIVER * copy ( void ) const ;
00218 };
00219
00220
00229 class MEDMEM_EXPORT PORFLOW_MESH_RDWR_DRIVER : public PORFLOW_MESH_RDONLY_DRIVER, public PORFLOW_MESH_WRONLY_DRIVER {
00230
00231 public :
00232
00236 PORFLOW_MESH_RDWR_DRIVER() ;
00240 PORFLOW_MESH_RDWR_DRIVER(const string & fileName, MESH * ptrMesh) ;
00244 PORFLOW_MESH_RDWR_DRIVER(const PORFLOW_MESH_RDWR_DRIVER & driver) ;
00245
00249 ~PORFLOW_MESH_RDWR_DRIVER() ;
00250
00254 void write(void) const throw (MEDEXCEPTION);
00258 void read (void) throw (MEDEXCEPTION);
00259
00260 private:
00261 GENDRIVER * copy(void) const ;
00262
00263 };
00264 }
00265
00266
00267 #endif