22#if !defined(LOOS_MDTRAJ_TRAJ_HPP)
23#define LOOS_MDTRAJ_TRAJ_HPP
28#include <loos_defs.hpp>
30#include <Trajectory.hpp>
43 explicit MDTrajTraj(
const std::string& s,
const int na) : _natoms(na),
51 throw(
LOOSError(
"Creating an MDTrajTraj from a stream isn't implemented"));
54 std::string
description()
const {
return(
"MDTraj HDF5 trajectory"); }
55 static pTraj create(
const std::string& fname,
const AtomicGroup& model) {
56 return(pTraj(
new MDTrajTraj(fname, model.size())));
60 virtual uint
nframes(
void)
const {
return(_nframes); }
61 virtual uint
natoms(
void)
const {
return(_natoms); }
62 virtual std::vector<GCoord>
coords(
void)
const {
return(
frame); }
74 virtual float timestep(
void)
const {
return(0.0); }
81 virtual void rewindImpl(
void) { _current_frame = 0; }
82 virtual void seekNextFrameImpl(
void) { _current_frame++; seekFrameImpl(_current_frame);}
83 virtual void seekFrameImpl(
const uint);
84 virtual void updateGroupCoordsImpl(AtomicGroup&);
85 void readRawFrame(
const uint i);
89 uint _natoms, _nframes;
90 std::string _filename;
93 std::vector<GCoord>
frame;
97 H5::DataSet box_dataset;
98 H5::DataSpace box_dataspace;
99 H5::DataType box_datatype;
100 H5::DataSpace box_memspace;
101 H5::DataSet coords_dataset;
102 H5::DataSpace coords_dataspace;
103 H5::DataType coords_datatype;
104 H5::DataSpace coord_memspace;
105 float (*one_frame)[3];
Class for handling groups of Atoms (pAtoms, actually)
Definition AtomicGroup.hpp:108
Generic LOOS exception.
Definition exceptions.hpp:40
Class for reading MDTraj HDF5 coordinate trajectories.
Definition mdtrajtraj.hpp:41
virtual float timestep(void) const
Definition mdtrajtraj.hpp:74
virtual GCoord periodicBox(void) const
Returns the periodic box for the current frame/trajectory.
Definition mdtrajtraj.hpp:65
std::string description() const
Return a string describing trajectory format.
Definition mdtrajtraj.hpp:54
virtual uint natoms(void) const
Definition mdtrajtraj.hpp:61
virtual bool hasPeriodicBox(void) const
Definition mdtrajtraj.hpp:64
virtual bool parseFrame(void)
Parse an actual frame.
Definition mdtrajtraj.cpp:72
virtual std::vector< GCoord > coords(void) const
Returns the current frames coordinates as a vector of GCoords.
Definition mdtrajtraj.hpp:62
virtual uint nframes(void) const
Number of frames in the trajectory.
Definition mdtrajtraj.hpp:60
Base-class for polymorphic trajectories.
Definition Trajectory.hpp:65
Namespace for most things not already encapsulated within a class.
Definition version.cpp:3