#include <gromacs/fileio/h5md/h5md.h>
Manager of an H5MD filehandle. The class is designed to read/write data according to de Buyl et al., 2014 (https://doi.org/10.1016/j.cpc.2014.01.018) and https://www.nongnu.org/h5md/h5md.html.
|
| | H5md (const std::filesystem::path &fileName, H5mdFileMode mode) |
| | Open an H5MD file and manage its filehandle. More...
|
| |
|
| H5md (const H5md &)=delete |
| |
|
H5md & | operator= (const H5md &)=delete |
| |
|
| H5md (H5md &&)=delete |
| |
|
H5md & | operator= (H5md &&)=delete |
| |
| hid_t | fileid () const |
| | Return the HDF5 handle of the file. More...
|
| |
| void | flush (bool throwExceptionUponError=true) |
| | Write all unwritten data to the file. More...
|
| |
| void | setAuthor (const std::string &authorName) |
| | Set the author name attribute in the H5MD file. More...
|
| |
| std::optional< std::string > | author () |
| | Get the author name attribute from the H5MD file. More...
|
| |
| void | setCreatorProgramName (const std::string &creatorName) |
| | Set the name of the creating program as an attribute in the H5MD file. More...
|
| |
| std::optional< std::string > | creatorProgramName () |
| | Get the name of the creating program attribute from the H5MD file. More...
|
| |
| void | setCreatorProgramVersion (const std::string &version) |
| | Set the version of the creating program as an attribute in the H5MD file. More...
|
| |
| std::optional< std::string > | creatorProgramVersion () |
| | Get the version of the creating program attribute from the H5MD file. More...
|
| |
| void | setupFileFromInput (const gmx_mtop_t &topology, const t_inputrec &inputRecord) |
| | Set up the file from input data. More...
|
| |
| void | writeNextFrame (ArrayRef< const RVec > positions, ArrayRef< const RVec > velocities, ArrayRef< const RVec > forces, const matrix box, int64_t step, double time) |
| | Write input data as the next frame of the trajectory. More...
|
| |
| gmx::H5md::H5md |
( |
const std::filesystem::path & |
fileName, |
|
|
H5mdFileMode |
mode |
|
) |
| |
Open an H5MD file and manage its filehandle.
- Parameters
-
| [in] | fileName | Name of the file to open. The same as the file path. |
| [in] | mode | The mode to open the file. |
- Exceptions
-
| FileIOError | if fileName is specified and the file cannot be opened. |
| std::optional< std::string > gmx::H5md::author |
( |
| ) |
|
Get the author name attribute from the H5MD file.
- Returns
- the author name if the attribute was set.
| std::optional< std::string > gmx::H5md::creatorProgramName |
( |
| ) |
|
Get the name of the creating program attribute from the H5MD file.
- Returns
- The creator name, i.e. the name of the program that created the file, if the attribute was set.
| std::optional< std::string > gmx::H5md::creatorProgramVersion |
( |
| ) |
|
Get the version of the creating program attribute from the H5MD file.
- Returns
- the version if the attribute was set.
| hid_t gmx::H5md::fileid |
( |
| ) |
const |
Return the HDF5 handle of the file.
This handle is used as the root container of the file's data hierarchy, to which the tree of groups and data sets can be added.
- Returns
- The file handle.
| void gmx::H5md::flush |
( |
bool |
throwExceptionUponError = true | ) |
|
Write all unwritten data to the file.
- Parameters
-
| [in] | throwExceptionUponError | Whether to throw an exception if an error occurs. Assumes a valid file_ identifier. |
- Exceptions
-
| FileIOError | If there were errors during flushing (and throwExceptionUponError is true). |
| void gmx::H5md::setAuthor |
( |
const std::string & |
authorName | ) |
|
Set the author name attribute in the H5MD file.
- Parameters
-
| [in] | authorName | The author name. |
- Exceptions
-
| FileIOError | If the author name attribute could not be set. |
| void gmx::H5md::setCreatorProgramName |
( |
const std::string & |
creatorName | ) |
|
Set the name of the creating program as an attribute in the H5MD file.
- Parameters
-
| [in] | creatorName | The creator name, i.e. the name of the program that created the file. |
- Exceptions
-
| FileIOError | If the creator name attribute could not be set. |
| void gmx::H5md::setCreatorProgramVersion |
( |
const std::string & |
version | ) |
|
Set the version of the creating program as an attribute in the H5MD file.
- Parameters
-
- Exceptions
-
| void gmx::H5md::setupFileFromInput |
( |
const gmx_mtop_t & |
topology, |
|
|
const t_inputrec & |
inputRecord |
|
) |
| |
Set up the file from input data.
- Parameters
-
| [in] | topology | Topology data of system. |
| [in] | inputRecord | Simulation parameters. |
Write input data as the next frame of the trajectory.
- Parameters
-
| [in] | positions | Position data to write (or empty if not to write). |
| [in] | velocities | Velocity data to write (or empty if not to write). |
| [in] | forces | Force data to write (or empty if not to write). |
| [in] | box | Simulation box for frame. |
| [in] | step | Simulation step for frame. |
| [in] | time | Simulation time for frame. |
- Exceptions
-
| gmx::FileIOError | if position, velocity or force data is given but the corresponding data set has not been created, or if the size of the data buffers do not match the number of atoms of the system. |
The documentation for this class was generated from the following files:
- src/gromacs/fileio/h5md/h5md.h
- src/gromacs/fileio/h5md/h5md.cpp