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"
15 using namespace MEDMEM;
19 Driver PORFLOW for MESH.
21 Generic part : implement the readopen and close methods.
31 class PORFLOW_MESH_DRIVER : public GENDRIVER
36 // A VOIR FILE DESCRIPTEUR ? MED_FR::med_idt _medIdt;
40 // tableau de correspondance des types géométriques de PORFLOW -> MED
41 static const size_t nb_geometrie_porflow = 6;
42 static const medGeometryElement geomPORFLOWtoMED[nb_geometrie_porflow];
43 // indirection table from PORFLOW order to MED one for nodes numerotation in all PORFLOW geometries
44 static const size_t nb_nodes_max = 8; // maximal number of nodes for a porflow geometrie
45 static const size_t nb_nodes2_max = 4; // maximal number of nodes for a 2D porflow geometrie
46 static const size_t nb_faces_max = 6; // maximal number of faces for a porflow geometrie
47 static const int numPORFLOWtoMED[nb_geometrie_porflow] [nb_nodes_max];
48 static const int connectivityPORFLOW[nb_geometrie_porflow][nb_faces_max][nb_nodes2_max];
49 inline static int geomMEDtoPorflow(medGeometryElement medGeo);
57 PORFLOW_MESH_DRIVER() ;
61 PORFLOW_MESH_DRIVER(const string & fileName,
63 med_mode_acces accessMode) ;
67 PORFLOW_MESH_DRIVER(const PORFLOW_MESH_DRIVER & driver) ;
72 virtual ~PORFLOW_MESH_DRIVER() ;
74 void open() throw (MEDEXCEPTION);
75 void close() throw (MEDEXCEPTION);
77 virtual void write( void ) const = 0 ;
78 virtual void read ( void ) = 0 ;
81 Set the name of the MESH asked in file.
83 It could be different than the name of the MESH object.
85 void setMeshName(const string & meshName) ;
87 Get the name of the MESH asked in file.
89 string getMeshName() const ;
92 virtual GENDRIVER * copy ( void ) const = 0 ;
97 class PORFLOW_MESH_RDONLY_DRIVER : public virtual PORFLOW_MESH_DRIVER
105 PORFLOW_MESH_RDONLY_DRIVER() ;
109 PORFLOW_MESH_RDONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
113 PORFLOW_MESH_RDONLY_DRIVER(const PORFLOW_MESH_RDONLY_DRIVER & driver) ;
118 virtual ~PORFLOW_MESH_RDONLY_DRIVER() ;
121 Return a MEDEXCEPTION : it is the read-only driver.
123 void write( void ) const throw (MEDEXCEPTION);
125 Read MESH in the specified file.
127 void read ( void ) throw (MEDEXCEPTION);
131 GENDRIVER * copy ( void ) const ;
133 static void readPorflowCoordinateFile(const string & coorFileName,_intermediateMED & medi,const int space_dimension);
134 static void readPorflowConnectivityFile(bool hybride,const string & connecFileName,_intermediateMED & medi,std::vector<set<_maille>::iterator>& p_ma_table,int mesh_dimension);
140 Driver Med for MESH : Write only.
142 Implement write method.
146 class PORFLOW_MESH_WRONLY_DRIVER : public virtual PORFLOW_MESH_DRIVER {
153 PORFLOW_MESH_WRONLY_DRIVER() ;
157 PORFLOW_MESH_WRONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
161 PORFLOW_MESH_WRONLY_DRIVER(const PORFLOW_MESH_WRONLY_DRIVER & driver) ;
166 virtual ~PORFLOW_MESH_WRONLY_DRIVER() ;
169 Write MESH in the specified file.
171 void write( void ) const throw (MEDEXCEPTION);
173 Return a MEDEXCEPTION : it is the write-only driver.
175 void read ( void ) throw (MEDEXCEPTION);
179 GENDRIVER * copy ( void ) const ;
185 Driver PORFLOW for MESH : Read write.
186 - Use read method from PORFLOW_MESH_RDONLY_DRIVER
187 - Use write method from PORFLOW_MESH_WRONLY_DRIVER
191 class PORFLOW_MESH_RDWR_DRIVER : public PORFLOW_MESH_RDONLY_DRIVER, public PORFLOW_MESH_WRONLY_DRIVER {
198 PORFLOW_MESH_RDWR_DRIVER() ;
202 PORFLOW_MESH_RDWR_DRIVER(const string & fileName, MESH * ptrMesh) ;
206 PORFLOW_MESH_RDWR_DRIVER(const PORFLOW_MESH_RDWR_DRIVER & driver) ;
211 ~PORFLOW_MESH_RDWR_DRIVER() ;
214 Write MESH in the specified file.
216 void write(void) const throw (MEDEXCEPTION);
218 Read MESH in the specified file.
220 void read (void) throw (MEDEXCEPTION);
223 GENDRIVER * copy(void) const ;
229 #endif /* PORFLOW_MESH_DRIVER_HXX */