ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Class for writing H5MD files. More...
#include <h5md_core.hpp>
Public Member Functions | |
File (std::string file_path, std::string script_path, std::vector< std::string > const &output_fields, std::string mass_unit, std::string length_unit, std::string time_unit, std::string force_unit, std::string velocity_unit, std::string charge_unit) | |
Constructor. | |
~File () | |
void | close () |
Method to perform the renaming of the temporary file from "filename" + ".bak" to "filename". | |
void | write (const ParticleRange &particles, double time, int step, BoxGeometry const &geometry) |
Write data to the hdf5 file. | |
std::string | file_path () const |
Retrieve the path to the hdf5 file. | |
auto const & | script_path () const |
Retrieve the path to the simulation script. | |
auto const & | mass_unit () const |
Retrieve the set mass unit. | |
auto const & | length_unit () const |
Retrieve the set length unit. | |
auto const & | time_unit () const |
Retrieve the set time unit. | |
auto const & | force_unit () const |
Retrieve the set force unit. | |
auto const & | velocity_unit () const |
Retrieve the set velocity unit. | |
auto const & | charge_unit () const |
Retrieve the set charge unit. | |
auto | valid_fields () const |
Build the list of valid output fields. | |
void | flush () |
Method to enforce flushing the buffer to disk. | |
Class for writing H5MD files.
Definition at line 101 of file h5md_core.hpp.
Writer::H5md::File::File | ( | std::string | file_path, |
std::string | script_path, | ||
std::vector< std::string > const & | output_fields, | ||
std::string | mass_unit, | ||
std::string | length_unit, | ||
std::string | time_unit, | ||
std::string | force_unit, | ||
std::string | velocity_unit, | ||
std::string | charge_unit | ||
) |
Constructor.
file_path | Name for the hdf5 file on disk. |
script_path | Path to the simulation script. |
output_fields | Properties to write to disk. |
mass_unit | The unit for mass. |
length_unit | The unit for length. |
time_unit | The unit for time. |
force_unit | The unit for force. |
velocity_unit | The unit for velocity. |
charge_unit | The unit for charge. |
Definition at line 505 of file h5md_core.cpp.
References file_path().
|
default |
|
inline |
Retrieve the set charge unit.
Definition at line 183 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
void Writer::H5md::File::close | ( | ) |
Method to perform the renaming of the temporary file from "filename" + ".bak" to "filename".
Definition at line 300 of file h5md_core.cpp.
std::string Writer::H5md::File::file_path | ( | ) | const |
Retrieve the path to the hdf5 file.
Definition at line 503 of file h5md_core.cpp.
Referenced by File(), and ScriptInterface::Writer::H5md::H5md().
void Writer::H5md::File::flush | ( | ) |
Method to enforce flushing the buffer to disk.
Definition at line 501 of file h5md_core.cpp.
|
inline |
Retrieve the set force unit.
Definition at line 171 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
|
inline |
Retrieve the set length unit.
Definition at line 159 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
|
inline |
Retrieve the set mass unit.
Definition at line 153 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
|
inline |
Retrieve the path to the simulation script.
Definition at line 147 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
|
inline |
Retrieve the set time unit.
Definition at line 165 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
|
inline |
Build the list of valid output fields.
Definition at line 189 of file h5md_core.hpp.
References Writer::H5md::fields_map.
|
inline |
Retrieve the set velocity unit.
Definition at line 177 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
void Writer::H5md::File::write | ( | const ParticleRange & | particles, |
double | time, | ||
int | step, | ||
BoxGeometry const & | geometry | ||
) |
Write data to the hdf5 file.
particles | Particle range for which to write data. |
time | Simulation time. |
step | Simulation step (monotonically increasing). |
geometry | The box dimensions. |
Definition at line 377 of file h5md_core.cpp.
References BoxGeometry::folded_image_box(), BoxGeometry::folded_position(), Writer::H5md::H5MD_OUT_BONDS, Writer::H5md::H5MD_OUT_BOX_L, Writer::H5md::H5MD_OUT_CHARGE, Writer::H5md::H5MD_OUT_FORCE, Writer::H5md::H5MD_OUT_IMG, Writer::H5md::H5MD_OUT_LE_DIR, Writer::H5md::H5MD_OUT_LE_NORMAL, Writer::H5md::H5MD_OUT_LE_OFF, Writer::H5md::H5MD_OUT_MASS, Writer::H5md::H5MD_OUT_POS, Writer::H5md::H5MD_OUT_TYPE, Writer::H5md::H5MD_OUT_VEL, BoxGeometry::lees_edwards_bc(), ParticleRange::size(), Writer::H5md::write_box(), Writer::H5md::write_dataset(), Writer::H5md::write_le_dir(), Writer::H5md::write_le_normal(), and Writer::H5md::write_le_off().