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

Class for reading DCD files. More...

#include <dcd.hpp>

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

Classes

class  EndOfFile
 

Public Member Functions

 DCD (const std::string s)
 Begin reading from the file named s.
 
 DCD (const char *s)
 Begin reading from the file named s.
 
 DCD (std::istream &fs)
 Begin reading from the stream ifs.
 
std::string description () const
 Return a string describing trajectory format.
 
virtual uint natoms (void) const
 
virtual bool hasPeriodicBox (void) const
 
virtual GCoord periodicBox (void) const
 Returns the periodic box for the current frame/trajectory.
 
virtual bool hasVelocities () const
 Whether or not the trajectory format supports velocities.
 
virtual double velocityConversionFactor () const
 Conversion applied to velocities to get to \AA/ps.
 
std::vector< std::string > titles (void) const
 
int icntrl (const int) const
 
void icntrl (const int, const int)
 
std::vector< double > crystalParams (void) const
 
bool hasCrystalParams (void) const
 
virtual float timestep (void) const
 Timestep per frame.
 
virtual uint nframes (void) const
 Number of frames in the trajectory.
 
std::vector< dcd_real > xcoords (void) const
 Return the raw coords...
 
std::vector< dcd_real > ycoords (void) const
 Return the raw coords...
 
std::vector< dcd_real > zcoords (void) const
 Return the raw coords...
 
unsigned int nsteps (void) const
 
float delta (void) const
 
int nsavc (void) const
 
int nfile (void) const
 
int nfixed (void) const
 
bool nativeFormat (void) const
 Returns true if the DCD file being read is in the native endian format.
 
virtual std::vector< GCoordcoords (void) const
 Auto-interleave the coords into a vector of GCoord()'s.
 
std::vector< GCoordmappedCoords (const std::vector< int > &map)
 Interleave coords, selecting entries indexed by map.
 
virtual bool parseFrame (void)
 Parse a frame of the DCD.
 
- 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.
 
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)
 
static void setSuppression (const bool b)
 

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 DCD files.

Instantiating a DCD object with either a filename or an fstream only reads the header from the file, not any frames. When a frame is read, the x,y,z coordinates are stored internally in a vector. This must be copied out to the caller or used to update the coordinates for an AtomicGroup.

Notes:

Member Function Documentation

◆ coords()

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

Auto-interleave the coords into a vector of GCoord()'s.

This can be a pretty slow operation, so be careful.

Implements loos::Trajectory.

◆ description()

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

Return a string describing trajectory format.

Reimplemented from loos::Trajectory.

◆ hasPeriodicBox()

bool loos::DCD::hasPeriodicBox ( void ) const
virtual

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.

◆ hasVelocities()

virtual bool loos::DCD::hasVelocities ( void ) const
inlinevirtual

Whether or not the trajectory format supports velocities.

Reimplemented from loos::Trajectory.

◆ natoms()

uint loos::DCD::natoms ( void ) const
virtual

of atoms per frame

Implements loos::Trajectory.

◆ nframes()

uint loos::DCD::nframes ( void ) const
virtual

Number of frames in the trajectory.

Implements loos::Trajectory.

◆ parseFrame()

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

Parse a frame of the DCD.

Implements loos::Trajectory.

◆ periodicBox()

GCoord loos::DCD::periodicBox ( void ) const
virtual

Returns the periodic box for the current frame/trajectory.

Implements loos::Trajectory.

◆ timestep()

float loos::DCD::timestep ( void ) const
virtual

Timestep per frame.

Implements loos::Trajectory.

◆ velocityConversionFactor()

virtual double loos::DCD::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: