Gromacs  2026.0-dev-20251119-5f0a571d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Friends
gmx::H5mdParticleBlock Class Reference

#include <gromacs/fileio/h5md/h5md_particleblock.h>

Description

Class which manages trajectory data inside of a H5md particle group.

Per the H5md specification, trajectory data for subgroups is stored in the tree hierarchy as:

-- /particles/group1 -- box -- edges -- value: real[numFrames][3][3] -- position -- value: RVec[numFrames][numAtoms] -- step: int64_t[numFrames] -- (time): double[numFrames] (optional) -- velocity -- value: RVec[numFrames][numAtoms] -- step: int64_t[numFrames] -- (time): double[numFrames] (optional) -- force -- value: RVec[numFrames][numAtoms] -- step: int64_t[numFrames] -- (time): double[numFrames] (optional)

This class collects data sets for a single group into one object, providing access to H5mdTimeDataBlocks<RVec> for position, velocity and force using getters, and a H5mdFrameDataSet<real> for the simulation box.

Use the H5mdParticleBlockBuilder builder class to construct this object by adding selected data sets at will.

Public Member Functions

bool hasBox () const
 Return whether the block stores a per-position-frame box value, else false.
 
bool hasPosition () const
 Return whether the block stores a position block.
 
bool hasVelocity () const
 Return whether the block stores a velocity block.
 
bool hasForce () const
 Return whether the block stores a force block.
 
bool hasTime () const
 Return whether time is stored in any of the managed data block sets.
 
int64_t numParticles () const
 Return the number of particles for the managed blocks (0 if none are managed).
 
std::optional
< H5mdFrameDataSet< real > > & 
box ()
 Get the simulation box data set.
 
std::optional
< H5mdTimeDataBlock< RVec > > & 
position ()
 Get the position data set.
 
std::optional
< H5mdTimeDataBlock< RVec > > & 
velocity ()
 Get the velocity data set.
 
std::optional
< H5mdTimeDataBlock< RVec > > & 
force ()
 Get the force data set.
 

Friends

class H5mdParticleBlockBuilder
 

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