Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 22 of file qmc-extract-eshdf-kvectors.cpp.
References hdf_archive::close(), hdf_archive::open(), and hdf_archive::read().
25 mpi3::environment env(argc, argv);
31 std::cout <<
"Program must take as an argument a single input eshdf file to parse" << std::endl;
34 std::string fname(argv[1]);
37 hin.
open(fname, H5F_ACC_RDONLY);
38 const std::string dataset =
"electrons/number_of_kpoints";
41 hin.
read(data, dataset);
43 std::array<float, 3> kpt;
44 for (
int i = 0; i < data; i++)
46 std::ostringstream os;
47 os <<
"electrons/kpoint_" << i <<
"/reduced_k";
48 hin.
read(kpt, os.str());
49 std::cout << kpt[0] <<
" " << kpt[1] <<
" " << kpt[2] <<
"\n";
bool open(const std::filesystem::path &fname, unsigned flags=H5F_ACC_RDWR)
open a file
helper functions for EinsplineSetBuilder
void close()
close all the open groups and file
void read(T &data, const std::string &aname)
read the data from the group aname and check status runtime error is issued on I/O error ...