![]() |
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::filesystem::path file_path, std::filesystem::path 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, int chunk_size) | |
| 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. | |
| auto const & | 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 const & | chunk_size () const |
| Retrieve the set chunk size. | |
| std::vector< std::string > | 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 75 of file h5md_core.hpp.
| Writer::H5md::File::File | ( | std::filesystem::path | file_path, |
| std::filesystem::path | 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, | ||
| int | chunk_size | ||
| ) |
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. |
| chunk_size | The chunk size for DataSet in hdf5 file |
Definition at line 702 of file h5md_core.cpp.
References chunk_size().
| Writer::H5md::File::~File | ( | ) |
Definition at line 727 of file h5md_core.cpp.
References close().
Retrieve the set charge unit.
Definition at line 158 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
Retrieve the set chunk size.
Definition at line 163 of file h5md_core.hpp.
Referenced by File(), and 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 371 of file h5md_core.cpp.
Referenced by ~File().
Retrieve the path to the hdf5 file.
Definition at line 116 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
| void Writer::H5md::File::flush | ( | ) |
Method to enforce flushing the buffer to disk.
This pushes all buffers to the Virtual File Driver (VFD) layer. However, the file superblock, which contains the address space information (End of Allocation, EOA), won't be flushed. Therefore, the file won't necessarily be in a guaranteed consistent state for a read operation by another HDF5 parser. Only the close() method can flush the EOA.
Definition at line 695 of file h5md_core.cpp.
Retrieve the set force unit.
Definition at line 146 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
Retrieve the set length unit.
Definition at line 134 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
Retrieve the set mass unit.
Definition at line 128 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
Retrieve the path to the simulation script.
Definition at line 122 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
Retrieve the set time unit.
Definition at line 140 of file h5md_core.hpp.
Referenced by ScriptInterface::Writer::H5md::H5md().
| std::vector< std::string > Writer::H5md::File::valid_fields | ( | ) | const |
Build the list of valid output fields.
Definition at line 697 of file h5md_core.cpp.
References Writer::H5md::fields_map, and stream.
Retrieve the set velocity unit.
Definition at line 152 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 567 of file h5md_core.cpp.
References Particle::force(), 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, Particle::id(), BoxGeometry::lees_edwards_bc(), Particle::mass(), Particle::q(), ParticleRange::size(), stream, Particle::type(), Particle::v(), Writer::H5md::write_box(), Writer::H5md::write_dataset(), Writer::H5md::write_le_dir(), Writer::H5md::write_le_normal(), and Writer::H5md::write_le_off().