Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Hydroinfo_h5.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Hydroinfo_h5.h
1 #ifndef Hydroinfo_h5_H
2 #define Hydroinfo_h5_H
3 
4 #include<fstream>
5 #include<sstream>
6 #include<string>
7 #include<vector>
8 
9 #include "hdf5.h"
10 #include "fluidCell.h"
11 
12 // using namespace std;
13 using std::string;
14 using std::vector;
15 using std::ofstream;
16 using std::ifstream;
17 using std::abs;
18 
20 {
21  private:
24 
25  string filename;
26 
27  int Visflag; // flag to determine whether to read evolutions for viscous variables
30 
33  double grid_X0, grid_Y0;
36  double grid_Taumax;
37 
39  int LST_cur;
40 
42  double ***ed, ***sd, ***vx, ***vy, ***Temperature, ***Pressure;
43  double ***pi00, ***pi01, ***pi02, ***pi03, ***pi11, ***pi12, ***pi13;
44  double ***pi22, ***pi23, ***pi33;
45  double ***BulkPi;
46 
47  public:
48  HydroinfoH5();
49  HydroinfoH5(string filename_in, int bufferSize_in, int Visflag_in);
50  HydroinfoH5(int XL_in, int XH_in, double DX_in, int LSX_in,
51  int YL_in, int YH_in, double DY_in, int LSY_in,
52  double Tau0_in, double dTau_in, double LST_in,
53  int Visflag_in, string filename_in);
54 
55  ~HydroinfoH5();
56 
58  void clean_hydro_event();
59 
60  // functions to write into hdf5 file
61  void setHydroFiles(int XL_in, int XH_in, double DX_in, int LSX_in, int YL_in, int YH_in, double DY_in, int LSY_in, double Tau0_in, double dTau_in, double LST_in, int Visflag_in, string filename_in);
63  void addGroupattributeInt(hid_t H5groupEventid, string attName, int attValue);
64  void addGroupattributeDouble(hid_t H5groupEventid, string attName, double attValue);
65  void writeHydroBlock(int Time_id, double **ed_in, double **sd_in, double **p_in, double **Temp_in, double **Vx_in, double **Vy_in, double **Pi00_in, double **Pi01_in, double **Pi02_in, double **Pi03_in, double **Pi11_in, double **Pi12_in, double **Pi13_in, double **Pi22_in, double **Pi23_in, double **Pi33_in, double ** BulkPi_in);
66  void CSH5dumpBlockdata(hid_t group_id, const hsize_t * dims, string DatasetName, double** Dataset);
67 
68  // functions to read hdf5 files
69  void readHydroinfoH5(string filename, int bufferSize_in, int Visflag_in);
70  void readHydrogridInfo();
71  void printHydrogridInfo();
72  int readH5Attribute_int(hid_t id, string attributeName);
73  double readH5Attribute_double(hid_t id, string attributeName);
74 
76  void readHydroinfoSingleframe(int frameIdx);
77  void readH5Dataset_double(hid_t id, string datasetName, double** dset_data);
78 
79  int getNumberofFrames() {return((int)grid_Framenum);};
80  double getHydrogridDX() {return(grid_dx);};
81  double getHydrogridDY() {return(grid_dy);};
82  double getHydrogridDTau() {return(grid_dTau);};
83  double getHydrogridTau0() {return(grid_Tau0);};
84  double getHydrogridTaumax() {return(grid_Taumax);};
85  double getHydrogridNX() {return(grid_XH - grid_XL + 1);};
86  double getHydrogridNY() {return(grid_YH - grid_YL + 1);};
87  double getHydrogridX0() {return(grid_X0);};
88  double getHydrogridY0() {return(grid_Y0);};
89  double getHydrogridXmax() {return(grid_Xmax);};
90  double getHydrogridYmax() {return(grid_Ymax);};
91  void getHydroinfoOnlattice(int frameIdx, int xIdx, int yIdx, hydrofluidCell* fluidCellptr);
92  void getHydroinfo(double tau, double x, double y, hydrofluidCell* fluidCellptr);
93  void setZero_fluidCell(hydrofluidCell* fluidCellptr);
94 
95  double cubeInterpShell(int idx_x, int idx_y, int idx_z,
96  double x, double y, double z, double ***dataset);
97  double cubeInterp(double x, double y, double z,
98  double A000, double A100, double A010, double A110,
99  double A001, double A101, double A011, double A111);
100 };
101 
102 #endif