// // h5_file.cpp // mc_electron // // Created by Christian Reiling on 18.05.19. // Copyright © 2019 Christian Reiling. All rights reserved. // #include "h5_file.hpp" #include "read_system.h" #include using namespace std; H5_File::H5_File(std::string output_path) { create(output_path); } void H5_File::create(std::string output_path) { //const string constH5Name = get_file_name(); h5f = H5Fcreate(output_path.c_str(), H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); h5g_particles = H5Gcreate(h5f, h5g_particles_path.c_str(), H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); h5g_populations = H5Gcreate(h5f, h5g_populations_path.c_str(), H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } /* std::string H5_File::get_file_name() { string parname = get_parameter_filenamepath(); stringstream H5name; int i = 1; do { H5name.str(std::string()); H5name << parname << "_" << get_time_string() << "_" << i++<<".h5"; } while ( is_file(H5name.str()) ); return H5name.str(); } */