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, boost::mpi::communicator comm=boost::mpi::communicator()) | |
Constructor. | |
~File ()=default | |
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. | |
auto | 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 103 of file h5md_core.hpp.
|
inline |
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. |
comm | The MPI communicator. |
Definition at line 118 of file h5md_core.hpp.
References file_path().
|
default |
|
inline |
Retrieve the set charge unit.
Definition at line 197 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 279 of file h5md_core.cpp.
|
inline |
Retrieve the path to the hdf5 file.
Definition at line 155 of file h5md_core.hpp.
Referenced by File(), and ScriptInterface::Writer::H5md::H5md().
void Writer::H5md::File::flush | ( | ) |
Method to enforce flushing the buffer to disk.
Definition at line 478 of file h5md_core.cpp.
|
inline |
Retrieve the set force unit.
Definition at line 185 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
|
inline |
Retrieve the set length unit.
Definition at line 173 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
|
inline |
Retrieve the set mass unit.
Definition at line 167 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
|
inline |
Retrieve the path to the simulation script.
Definition at line 161 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
|
inline |
Retrieve the set time unit.
Definition at line 179 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
|
inline |
Build the list of valid output fields.
Definition at line 203 of file h5md_core.hpp.
References Writer::H5md::fields_map.
|
inline |
Retrieve the set velocity unit.
Definition at line 191 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 356 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().