1 #ifndef MED_MESH_DRIVER_HXX
2 #define MED_MESH_DRIVER_HXX
6 #include "MEDMEM_define.hxx"
7 #include "MEDMEM_GenDriver.hxx"
9 #include "MEDMEM_STRING.hxx"
10 #include "MEDMEM_Exception.hxx"
11 #include "utilities.h"
17 Generic part : implement open and close methods.
26 class MED_MESH_DRIVER : public GENDRIVER
31 MED_FR::med_idt _medIdt;
32 string _meshName; // const ?
33 int _meshNum; // INUTILE ?
38 static const MED_FR::med_geometrie_element all_cell_type[MED_NBR_GEOMETRIE_MAILLE];
40 static const char * const all_cell_type_tab [MED_NBR_GEOMETRIE_MAILLE];
49 MED_MESH_DRIVER(const string & fileName,
51 med_mode_acces accessMode) ;
55 MED_MESH_DRIVER(const MED_MESH_DRIVER & driver) ;
60 virtual ~MED_MESH_DRIVER() ;
62 void open() throw (MEDEXCEPTION);
63 void close() throw (MEDEXCEPTION);
65 virtual void write( void ) const = 0 ;
66 virtual void read ( void ) = 0 ;
69 Set the name of the MESH asked in file.
71 It could be different than the name of the MESH object.
73 void setMeshName(const string & meshName) ;
75 Get the name of the MESH asked in file.
77 string getMeshName() const ;
80 virtual GENDRIVER * copy ( void ) const = 0 ;
86 Driver Med for MESH : Read only.
88 Implement read method.
92 class MED_MESH_RDONLY_DRIVER : public virtual MED_MESH_DRIVER
100 MED_MESH_RDONLY_DRIVER() ;
104 MED_MESH_RDONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
108 MED_MESH_RDONLY_DRIVER(const MED_MESH_RDONLY_DRIVER & driver) ;
113 virtual ~MED_MESH_RDONLY_DRIVER() ;
115 // CREER UNE METHODE POUR LIRE LA LISTE DES MAILLAGES .....
118 Return a MEDEXCEPTION : it is the read-only driver.
120 void write( void ) const throw (MEDEXCEPTION);
122 Read MESH in the specified file.
124 void read ( void ) throw (MEDEXCEPTION);
128 int getCONNECTIVITY();
130 int getNodalConnectivity(CONNECTIVITY * Connectivity) ;
131 int getDescendingConnectivity(CONNECTIVITY * Connectivity) ;
132 int getNodesFamiliesNumber(int * MEDArrayNodeFamily) ;
133 int getCellsFamiliesNumber(int** Arrays, CONNECTIVITY* Connectivity) ;
134 void updateFamily() ;
135 void buildAllGroups(vector<GROUP*> & Groups, vector<FAMILY*> & Families) ;
138 GENDRIVER * copy ( void ) const ;
144 Driver Med for MESH : Write only.
146 Implement write method.
150 class MED_MESH_WRONLY_DRIVER : public virtual MED_MESH_DRIVER {
157 MED_MESH_WRONLY_DRIVER() ;
161 MED_MESH_WRONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
165 MED_MESH_WRONLY_DRIVER(const MED_MESH_WRONLY_DRIVER & driver) ;
170 virtual ~MED_MESH_WRONLY_DRIVER() ;
173 Write MESH in the specified file.
175 void write( void ) const throw (MEDEXCEPTION);
177 Return a MEDEXCEPTION : it is the write-only driver.
179 void read ( void ) throw (MEDEXCEPTION);
182 int writeCoordinates () const;
183 int writeConnectivities (medEntityMesh entity) const;
184 int writeFamilyNumbers () const;
185 int writeFamilies (vector<FAMILY*> & families) const;
186 int writeGRID() const;
188 GENDRIVER * copy ( void ) const ;
194 Driver Med for MESH : Read write.
195 - Use read method from MED_MESH_RDONLY_DRIVER
196 - Use write method from MED_MESH_WRONLY_DRIVER
200 class MED_MESH_RDWR_DRIVER : public MED_MESH_RDONLY_DRIVER, public MED_MESH_WRONLY_DRIVER {
207 MED_MESH_RDWR_DRIVER() ;
211 MED_MESH_RDWR_DRIVER(const string & fileName, MESH * ptrMesh) ;
215 MED_MESH_RDWR_DRIVER(const MED_MESH_RDWR_DRIVER & driver) ;
220 ~MED_MESH_RDWR_DRIVER() ;
223 Write MESH in the specified file.
225 void write(void) const throw (MEDEXCEPTION);
227 Read MESH in the specified file.
229 void read (void) throw (MEDEXCEPTION);
232 GENDRIVER * copy(void) const ;
237 #endif /* MED_MESH_DRIVER_HXX */