30#include <boost/mpi/communicator.hpp>
38#include <unordered_map>
91 std::vector<std::string>
const &output_fields, std::string
mass_unit,
200 void create_groups();
206 void create_datasets();
211 void load_datasets();
226 void create_hard_links();
228 std::filesystem::path m_file_path;
229 std::filesystem::path m_backup_path;
230 std::filesystem::path m_script_path;
231 std::filesystem::path m_absolute_script_path;
232 std::string m_mass_unit;
233 std::string m_length_unit;
234 std::string m_time_unit;
235 std::string m_force_unit;
236 std::string m_velocity_unit;
237 std::string m_charge_unit;
239 boost::mpi::communicator m_comm;
240 unsigned int m_fields;
241 std::unique_ptr<HighFive::File> m_h5md_file;
242 std::unordered_map<std::string, HighFive::DataSet> m_datasets;
247 const char *
what() const noexcept
override {
248 return "The given .h5 file does not match the specifications in 'fields'.";
253 const char *
what() const noexcept
override {
254 return "A backup of the .h5 file exists. This usually means that either "
255 "you forgot to call the 'close' method or your simulation crashed.";
Vector implementation and trait types for boost qvm interoperability.
Class for writing H5MD files.
void write(const ParticleRange &particles, double time, int step, BoxGeometry const &geometry)
Write data to the hdf5 file.
auto const & chunk_size() const
Retrieve the set chunk size.
auto const & length_unit() const
Retrieve the set length unit.
auto const & time_unit() const
Retrieve the set time unit.
void close()
Method to perform the renaming of the temporary file from "filename" + ".bak" to "filename".
auto const & file_path() const
Retrieve the path to the hdf5 file.
auto const & force_unit() const
Retrieve the set force unit.
auto const & mass_unit() const
Retrieve the set mass unit.
auto const & charge_unit() const
Retrieve the set charge unit.
auto const & velocity_unit() const
Retrieve the set velocity unit.
std::vector< std::string > valid_fields() const
Build the list of valid output fields.
auto const & script_path() const
Retrieve the path to the simulation script.
void flush()
Method to enforce flushing the buffer to disk.
H5MDOutputFields
Constants which indicate what to output.
Layout information for H5MD files.
const char * what() const noexcept override
const char * what() const noexcept override