1 #ifndef PORFLOW_MESH_DRIVER_HXX
2 #define PORFLOW_MESH_DRIVER_HXX
7 #include "MEDMEM_define.hxx"
8 #include "MEDMEM_GenDriver.hxx"
9 //#include "MEDMEM_DriverTools.hxx"
11 #include "MEDMEM_STRING.hxx"
12 #include "MEDMEM_Exception.hxx"
13 #include "utilities.h"
20 Driver PORFLOW for MESH.
22 Generic part : implement the readopen and close methods.
32 class _intermediateMED;
34 class PORFLOW_MESH_DRIVER : public GENDRIVER
39 // A VOIR FILE DESCRIPTEUR ? MED_FR::med_idt _medIdt;
43 // tableau de correspondance des types géométriques de PORFLOW -> MED
44 static const size_t nb_geometrie_porflow = 6;
45 static const MED_EN::medGeometryElement geomPORFLOWtoMED[nb_geometrie_porflow];
46 // indirection table from PORFLOW order to MED one for nodes numerotation in all PORFLOW geometries
47 static const size_t nb_nodes_max = 8; // maximal number of nodes for a porflow geometrie
48 static const size_t nb_nodes2_max = 4; // maximal number of nodes for a 2D porflow geometrie
49 static const size_t nb_faces_max = 6; // maximal number of faces for a porflow geometrie
50 static const int numPORFLOWtoMED[nb_geometrie_porflow] [nb_nodes_max];
51 static const int connectivityPORFLOW[nb_geometrie_porflow][nb_faces_max][nb_nodes2_max];
52 inline static int geomMEDtoPorflow(MED_EN::medGeometryElement medGeo);
60 PORFLOW_MESH_DRIVER() ;
64 PORFLOW_MESH_DRIVER(const string & fileName,
66 MED_EN::med_mode_acces accessMode) ;
70 PORFLOW_MESH_DRIVER(const PORFLOW_MESH_DRIVER & driver) ;
75 virtual ~PORFLOW_MESH_DRIVER() ;
77 void open() throw (MEDEXCEPTION);
78 void close() throw (MEDEXCEPTION);
80 virtual void write( void ) const = 0 ;
81 virtual void read ( void ) = 0 ;
84 Set the name of the MESH asked in file.
86 It could be different than the name of the MESH object.
88 void setMeshName(const string & meshName) ;
90 Get the name of the MESH asked in file.
92 string getMeshName() const ;
95 virtual GENDRIVER * copy ( void ) const = 0 ;
100 class PORFLOW_MESH_RDONLY_DRIVER : public virtual PORFLOW_MESH_DRIVER
108 PORFLOW_MESH_RDONLY_DRIVER() ;
112 PORFLOW_MESH_RDONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
116 PORFLOW_MESH_RDONLY_DRIVER(const PORFLOW_MESH_RDONLY_DRIVER & driver) ;
121 virtual ~PORFLOW_MESH_RDONLY_DRIVER() ;
124 Return a MEDEXCEPTION : it is the read-only driver.
126 void write( void ) const throw (MEDEXCEPTION);
128 Read MESH in the specified file.
130 void read ( void ) throw (MEDEXCEPTION);
134 GENDRIVER * copy ( void ) const ;
136 static void readPorflowCoordinateFile(const string & coorFileName,_intermediateMED & medi,const int space_dimension);
137 static void readPorflowConnectivityFile(bool hybride,const string & connecFileName,_intermediateMED & medi,std::vector<set<_maille>::iterator>& p_ma_table,int mesh_dimension);
143 Driver Med for MESH : Write only.
145 Implement write method.
149 class PORFLOW_MESH_WRONLY_DRIVER : public virtual PORFLOW_MESH_DRIVER {
156 PORFLOW_MESH_WRONLY_DRIVER() ;
160 PORFLOW_MESH_WRONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
164 PORFLOW_MESH_WRONLY_DRIVER(const PORFLOW_MESH_WRONLY_DRIVER & driver) ;
169 virtual ~PORFLOW_MESH_WRONLY_DRIVER() ;
172 Write MESH in the specified file.
174 void write( void ) const throw (MEDEXCEPTION);
176 Return a MEDEXCEPTION : it is the write-only driver.
178 void read ( void ) throw (MEDEXCEPTION);
182 GENDRIVER * copy ( void ) const ;
188 Driver PORFLOW for MESH : Read write.
189 - Use read method from PORFLOW_MESH_RDONLY_DRIVER
190 - Use write method from PORFLOW_MESH_WRONLY_DRIVER
194 class PORFLOW_MESH_RDWR_DRIVER : public PORFLOW_MESH_RDONLY_DRIVER, public PORFLOW_MESH_WRONLY_DRIVER {
201 PORFLOW_MESH_RDWR_DRIVER() ;
205 PORFLOW_MESH_RDWR_DRIVER(const string & fileName, MESH * ptrMesh) ;
209 PORFLOW_MESH_RDWR_DRIVER(const PORFLOW_MESH_RDWR_DRIVER & driver) ;
214 ~PORFLOW_MESH_RDWR_DRIVER() ;
217 Write MESH in the specified file.
219 void write(void) const throw (MEDEXCEPTION);
221 Read MESH in the specified file.
223 void read (void) throw (MEDEXCEPTION);
226 GENDRIVER * copy(void) const ;
232 #endif /* PORFLOW_MESH_DRIVER_HXX */