LOOS  v2.3.2
loos::XTC Class Reference

Class representing GROMACS reduced precision, compressed trajectories. More...

#include <xtc.hpp>

Inheritance diagram for loos::XTC:
Collaboration diagram for loos::XTC:

Public Member Functions

 XTC (const std::string &s)
 XTC (std::istream &is)
std::string description () const
 Return a string describing trajectory format.
uint natoms (void) const

of atoms per frame

float timestep (void) const
 Timestep per frame.
uint nframes (void) const
 Number of frames in the trajectory.
bool hasPeriodicBox (void) const
GCoord periodicBox (void) const
 Returns the periodic box for the current frame/trajectory.
uint currentStep (void) const
double currentTime (void) const
std::vector< GCoordcoords (void)
 Returns the current frames coordinates as a vector of GCoords. More...
double precision (void) const
 Return the stored file's precision.
- Public Member Functions inherited from loos::Trajectory
 Trajectory (const std::string &s)
 Automatically open the file named s.
 Trajectory (std::istream &fs)
 Open using the given stream...
bool rewind (void)
 Rewinds the readFrame() iterator.
void updateGroupCoords (AtomicGroup &g)
 Update the coordinates in an AtomicGroup with the current frame. More...
void seekNextFrame (void)
void seekFrame (const uint i)
bool readFrame (void)
 Reads the next frame in a trajectory, returning false if at the end.
bool readFrame (const int i)
 Reads a specific frame in a trajectory. More...

Static Public Member Functions

static pTraj create (const std::string &fname, const AtomicGroup &model)

Additional Inherited Members

- Protected Attributes inherited from loos::Trajectory
StreamWrapper ifs
bool cached_first
std::string _filename

Detailed Description

Class representing GROMACS reduced precision, compressed trajectories.

The XTC format does not have even-sized frames nor does it have any kind of frame index or number of frames metadata. The entire trajectory has to be scanned in order to determine the number of frames and to build an index that allows seeking to specific frames. This is done by reading only enough of each frame header to permit building the index, so it should be a pretty fast operation.

Definition at line 61 of file xtc.hpp.

Member Function Documentation

std::vector<GCoord> loos::XTC::coords ( void  )

Returns the current frames coordinates as a vector of GCoords.

Some formats, notably DCDs, do not interleave their coordinates. This means that this could be a potentially expensive operation.

Implements loos::Trajectory.

Definition at line 108 of file xtc.hpp.

bool loos::XTC::hasPeriodicBox ( void  ) const

Tests whether or not the given frame/trajectory has periodic boundary information. The presence of periodic box information does not necessarily indicate that said information has been read in yet. For example, the presence of crystal data is in the header so this can be detected before any frame is read, but the crystal data itself is only read when a frame is read in.

Implements loos::Trajectory.

Definition at line 101 of file xtc.hpp.

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