LOOS 4.1.0
The Lightweight Object Oriented Structural analysis library/toolkit
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
loos::AmberTraj Class Reference

Class for reading amber coordinate trajectories. More...

#include <amber_traj.hpp>

Inheritance diagram for loos::AmberTraj:
Inheritance graph
[legend]
Collaboration diagram for loos::AmberTraj:
Collaboration graph
[legend]

Public Member Functions

 AmberTraj (const std::string &s, const int na)
 
 AmberTraj (std::istream &is, const int na)
 
std::string description () const
 Return a string describing trajectory format.
 
virtual uint nframes (void) const
 Number of frames in the trajectory.
 
virtual uint natoms (void) const
 
virtual std::vector< GCoordcoords (void) const
 Returns the current frames coordinates as a vector of GCoords.
 
virtual bool hasPeriodicBox (void) const
 
virtual GCoord periodicBox (void) const
 Returns the periodic box for the current frame/trajectory.
 
virtual double velocityConversionFactor () const
 Conversion applied to velocities to get to \AA/ps.
 
virtual float timestep (void) const
 
virtual bool parseFrame (void)
 Parse an actual frame.
 
- 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...
 
 Trajectory (const Trajectory &t)
 
virtual std::string filename () const
 Return the stored filename.
 
virtual bool hasVelocities () const
 Whether or not the trajectory format supports velocities.
 
bool rewind (void)
 Rewinds the readFrame() iterator.
 
void updateGroupCoords (AtomicGroup &g)
 Update the coordinates in an AtomicGroup with the current frame.
 
virtual std::vector< GCoordvelocities (void) const
 Returns the current frame's velocities as a vector of GCoords.
 
void updateGroupVelocities (AtomicGroup &g)
 
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.
 
bool atEnd () const
 
uint currentFrame () const
 

Static Public Member Functions

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

Additional Inherited Members

- Public Types inherited from loos::Trajectory
typedef boost::shared_ptr< std::istream > pStream
 
- Protected Member Functions inherited from loos::Trajectory
void setInputStream (const std::string &fname)
 
void setInputStream (std::istream &fs)
 
- Protected Attributes inherited from loos::Trajectory
pStream ifs
 
bool cached_first
 
std::string _filename
 
uint _current_frame
 

Detailed Description

Class for reading amber coordinate trajectories.

This class will read in the first frame of the trajectory upon instantiation. It will also scan the file to determine how many frames there are.

Since the Amber trajectory format does not store the # of atoms present, this must be passed to the AmberTraj constructor.

Note that the Amber timestep is (presumably) defined in the parmtop file, not in the trajectory file. So we return a null-value here...

Member Function Documentation

◆ coords()

virtual std::vector< GCoord > loos::AmberTraj::coords ( void ) const
inlinevirtual

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.

◆ description()

std::string loos::AmberTraj::description ( ) const
inlinevirtual

Return a string describing trajectory format.

Reimplemented from loos::Trajectory.

◆ hasPeriodicBox()

virtual bool loos::AmberTraj::hasPeriodicBox ( void ) const
inlinevirtual

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.

◆ natoms()

virtual uint loos::AmberTraj::natoms ( void ) const
inlinevirtual

of atoms per frame

Implements loos::Trajectory.

◆ nframes()

virtual uint loos::AmberTraj::nframes ( void ) const
inlinevirtual

Number of frames in the trajectory.

Implements loos::Trajectory.

◆ parseFrame()

bool loos::AmberTraj::parseFrame ( void )
virtual

Parse an actual frame.

parseFrame() is expected to read in a frame through the Trajectory's StreamWrapper. It returns a bool indicating whether or not it was able to actually read a frame (i.e. false indicates EOF).

Implements loos::Trajectory.

◆ periodicBox()

virtual GCoord loos::AmberTraj::periodicBox ( void ) const
inlinevirtual

Returns the periodic box for the current frame/trajectory.

Implements loos::Trajectory.

◆ timestep()

virtual float loos::AmberTraj::timestep ( void ) const
inlinevirtual

As stated above, Amber does not store the timestep in the trajectory, but in the parmtop instead. So we return a null-value here...

Implements loos::Trajectory.

◆ velocityConversionFactor()

virtual double loos::AmberTraj::velocityConversionFactor ( ) const
inlinevirtual

Conversion applied to velocities to get to \AA/ps.

Reimplemented from loos::Trajectory.


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