Acoustic FDTD Solver
H5.hpp
Go to the documentation of this file.
1 #ifndef H5_HPP
2 #define H5_HPP
3 
4 #include <string>
5 #include <vector>
6 #include <cassert>
7 #include "H5Cpp.h"
8 #include "constant.hpp"
9 
15 bool H5Exist(const std::string &file_name, const std::string &name);
16 bool H5GroupExist(const std::string &file_name, const std::string &name);
17 bool H5DataSetExist(const std::string &file_name, const std::string &name);
24 bool H5AttributeExist(const std::string &file_name, const std::string &name, const std::string &attribute_name);
25 
34 void readFromH5File(double ** out,
35  const std::string &file_name,
36  const std::string &dataset_name,
37  const int M,
38  const int N);
39 
40 std::vector<std::vector<double> > readFromH5File(const std::string &file_name,
41  const std::string &dataset_name);
42 
43 void readAttributeFromH5File(unsigned out,
44  const std::string &file_name,
45  const std::string &name,
46  const std::string &attribute_name);
47 
48 void readAttributeFromH5File(int out,
49  const std::string &file_name,
50  const std::string &name,
51  const std::string &attribute_name);
52 
53 void readAttributeFromH5File(double out,
54  const std::string &file_name,
55  const std::string &name,
56  const std::string &attribute_name);
57 
58 
65 void writeToH5File(const std::string &file_name,
66  const std::string &dataset_name,
67  const std::vector<double> &data,
68  const std::string &mode="overwrite");
69 void writeToH5File(const std::string &file_name,
70  const std::string &dataset_name,
71  const std::vector<int> &data,
72  const std::string &mode="overwrite");
73 void writeToH5File(const std::string &file_name,
74  const std::string &dataset_name,
75  const std::vector<std::vector<double> > &data,
76  const std::string &mode="overwrite");
77 
82 void writeToH5File(const std::string &file_name,
83  const std::string &dataset_name,
84  const double * const * data,
85  const unsigned nJ,
86  const unsigned nK,
87  const std::string &mode="overwrite");
88 void writeAttributeToH5File(const std::string &file_name, const std::string &name, const std::string &attribute_name, const std::string &data);
89 void writeAttributeToH5File(const std::string &file_name, const std::string &name, const std::string &attribute_name, const int data);
90 void writeAttributeToH5File(const std::string &file_name, const std::string &name, const std::string &attribute_name, const double data);
91 
92 double readMaximum(const std::string &file_name, const std::string &dataset_name);
93 double readMinimum(const std::string &file_name, const std::string &dataset_name);
94 
95 
96 #endif