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::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.
 

Detailed Description

Class for writing H5MD files.

Definition at line 101 of file h5md_core.hpp.

Constructor & Destructor Documentation

◆ File()

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.

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.

Definition at line 505 of file h5md_core.cpp.

References file_path().

◆ ~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 183 of file h5md_core.hpp.

Referenced by 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 300 of file h5md_core.cpp.

◆ file_path()

std::string Writer::H5md::File::file_path ( ) const

Retrieve the path to the hdf5 file.

Returns
The path as a string.

Definition at line 503 of file h5md_core.cpp.

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

◆ flush()

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

Method to enforce flushing the buffer to disk.

Definition at line 501 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 171 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 159 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 153 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 string.

Definition at line 147 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 165 of file h5md_core.hpp.

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

◆ valid_fields()

auto Writer::H5md::File::valid_fields ( ) const
inline

Build the list of valid output fields.

Returns
The list as a vector of strings.

Definition at line 189 of file h5md_core.hpp.

References Writer::H5md::fields_map.

◆ 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 177 of file h5md_core.hpp.

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

◆ write()


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