00001 #include <iostream> 00002 #include "assert.h" 00003 #include "meshbuilder.h" 00004 #include "hdf5.h" 00005 #include "ioerror.h" 00006 00007 using namespace std; 00008 00009 #define REALFILETYPE H5T_IEEE_F64BE // type used to create the datafile 00010 #define REALMEMTYPE H5T_NATIVE_DOUBLE // Data type used in memory natively 00011 #define INTFILETYPE H5T_STD_I32BE //INT type used to create the datafile 00012 #define INTMEMTYPE H5T_NATIVE_INT 00013 00014 00015 class HDF5Reader { 00016 public: 00017 HDF5Reader(const char* inputFile, MeshBuilder* builder); 00018 ~HDF5Reader(); 00019 // Read mesh data from input stream and call corresponding builder methods. 00020 void read(); 00021 00022 private: // Private attributes 00023 00024 MeshBuilder* _builder; 00025 const char* _inputFile; 00026 hid_t _file; 00027 hid_t _dataset; // Dataspace handles 00028 // hid_t _set; 00029 hsize_t _dimsf[2]; // Dataset dimensions 00030 herr_t _status; // Error checking 00031 int _nof_node; 00032 00033 };