ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
Writer::H5md::File Class Reference

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 constfile_path () const
 Retrieve the path to the hdf5 file.
 
auto constscript_path () const
 Retrieve the path to the simulation script.
 
auto constmass_unit () const
 Retrieve the set mass unit.
 
auto constlength_unit () const
 Retrieve the set length unit.
 
auto consttime_unit () const
 Retrieve the set time unit.
 
auto constforce_unit () const
 Retrieve the set force unit.
 
auto constvelocity_unit () const
 Retrieve the set velocity unit.
 
auto constcharge_unit () const
 Retrieve the set charge unit.
 
auto constchunk_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.
 

Detailed Description

Class for writing H5MD files.

Definition at line 75 of file h5md_core.hpp.

Constructor & Destructor Documentation

◆ File()

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.

Parameters
file_pathName for the hdf5 file on disk.
script_pathPath to the simulation script.
output_fieldsProperties to write to disk.
mass_unitThe unit for mass.
length_unitThe unit for length.
time_unitThe unit for time.
force_unitThe unit for force.
velocity_unitThe unit for velocity.
charge_unitThe unit for charge.
chunk_sizeThe chunk size for DataSet in hdf5 file

Definition at line 684 of file h5md_core.cpp.

References chunk_size().

◆ ~File()

Writer::H5md::File::~File ( )
default

Member Function Documentation

◆ charge_unit()

auto const & Writer::H5md::File::charge_unit ( ) const
inline

Retrieve the set charge unit.

Returns
The unit as a string.

Definition at line 158 of file h5md_core.hpp.

Referenced by ScriptInterface::Writer::H5md::H5md().

◆ chunk_size()

auto const & Writer::H5md::File::chunk_size ( ) const
inline

Retrieve the set chunk size.

Definition at line 163 of file h5md_core.hpp.

Referenced by File(), and ScriptInterface::Writer::H5md::H5md().

◆ close()

void Writer::H5md::File::close ( )

Method to perform the renaming of the temporary file from "filename" + ".bak" to "filename".

Definition at line 361 of file h5md_core.cpp.

◆ file_path()

auto const & Writer::H5md::File::file_path ( ) const
inline

Retrieve the path to the hdf5 file.

Returns
The path as a file system object.

Definition at line 116 of file h5md_core.hpp.

Referenced by ScriptInterface::Writer::H5md::H5md().

◆ flush()

void Writer::H5md::File::flush ( )

Method to enforce flushing the buffer to disk.

Definition at line 677 of file h5md_core.cpp.

◆ force_unit()

auto const & Writer::H5md::File::force_unit ( ) const
inline

Retrieve the set force unit.

Returns
The unit as a string.

Definition at line 146 of file h5md_core.hpp.

Referenced by ScriptInterface::Writer::H5md::H5md().

◆ length_unit()

auto const & Writer::H5md::File::length_unit ( ) const
inline

Retrieve the set length unit.

Returns
The unit as a string.

Definition at line 134 of file h5md_core.hpp.

Referenced by ScriptInterface::Writer::H5md::H5md().

◆ mass_unit()

auto const & Writer::H5md::File::mass_unit ( ) const
inline

Retrieve the set mass unit.

Returns
The unit as a string.

Definition at line 128 of file h5md_core.hpp.

Referenced by ScriptInterface::Writer::H5md::H5md().

◆ script_path()

auto const & Writer::H5md::File::script_path ( ) const
inline

Retrieve the path to the simulation script.

Returns
The path as a file system object.

Definition at line 122 of file h5md_core.hpp.

Referenced by ScriptInterface::Writer::H5md::H5md().

◆ time_unit()

auto const & Writer::H5md::File::time_unit ( ) const
inline

Retrieve the set time unit.

Returns
The unit as a string.

Definition at line 140 of file h5md_core.hpp.

Referenced by ScriptInterface::Writer::H5md::H5md().

◆ valid_fields()

std::vector< std::string > Writer::H5md::File::valid_fields ( ) const

Build the list of valid output fields.

Returns
The list as a vector of strings.

Definition at line 679 of file h5md_core.cpp.

References Writer::H5md::fields_map, and stream.

◆ velocity_unit()

auto const & Writer::H5md::File::velocity_unit ( ) const
inline

Retrieve the set velocity unit.

Returns
The unit as a string.

Definition at line 152 of file h5md_core.hpp.

Referenced by ScriptInterface::Writer::H5md::H5md().

◆ write()


The documentation for this class was generated from the following files: