Gromacs  2025-dev-20241002-88a4191
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::TrajectoryFrame Class Reference

#include <gromacs/trajectory/trajectoryframe.h>

Description

Contains a valid trajectory frame.

Valid frames have a step and time, but need not have any particular other fields.

Todo:
Eventually t_trxframe should be replaced by a class such as this. Currently we need to introduce BoxMatrix so that we can have a normal C++ getter that returns the contents of a box matrix, since you cannot use a real[DIM][DIM] as a function return type.
Todo:
Consider a std::optional work-alike type for expressing that a field may or may not have content.

Public Member Functions

 TrajectoryFrame (const t_trxframe &frame)
 Constructor. More...
 
std::string frameName () const
 Return a string that helps users identify this frame, containing time and step number. More...
 
std::int64_t step () const
 Step number read from the trajectory file frame.
 
double time () const
 Time read from the trajectory file frame.
 
PbcType pbc () const
 The PBC characteristics of the box.
 
ArrayRef< const RVecx () const
 Get a view of position coordinates of the frame (which could be empty).
 
ArrayRef< const RVecv () const
 Get a view of velocity coordinates of the frame (which could be empty).
 
ArrayRef< const RVecf () const
 Get a view of force coordinates of the frame (which could be empty).
 
bool hasBox () const
 Return whether the frame has a box.
 
const BoxMatrixbox () const
 Return a handle to the frame's box, which is all zero if the frame has no box.
 

Constructor & Destructor Documentation

gmx::TrajectoryFrame::TrajectoryFrame ( const t_trxframe &  frame)
explicit

Constructor.

Exceptions
APIErrorIf frame lacks either step or time.

Member Function Documentation

std::string gmx::TrajectoryFrame::frameName ( ) const

Return a string that helps users identify this frame, containing time and step number.

Exceptions
std::bad_allocwhen out of memory

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