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::TinkerArc Class Reference

Class for handling Tinker ARC files (concatenation of .xyz files) More...

#include <tinker_arc.hpp>

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

Public Member Functions

 TinkerArc (const std::string &s)
 
 TinkerArc (std::istream &is)
 
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 float timestep (void) const
 Timestep per frame.
 
TinkerXYZ currentFrame (void) const
 Returns the contained TinkerXYZ object.
 
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.
 
virtual double velocityConversionFactor () const
 Conversion applied to velocities to get to \AA/ps.
 
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 handling Tinker ARC files (concatenation of .xyz files)

This class reads a concatenated .xyz tinker trajectory (i.e. an ARC file). In order to determine the number of frames present, the trajectory is scanned from beginning to end upon instantiation. A list of seek indices for each frame is also built.

The first frame is read in by init(), so there is no explicit readFrame() during initialization.

There seems to be an issue with some .ARC files where reading the end of the contained TinkerXYZ object does not put the input stream into an EOF state. So, we can't depend on checking eof() in parseFrame() to flag when we've iterated off the end. TinkerArc therefore keeps track of what index into the Trajectory it's at and uses that to check to see if it's at the end or not.

It is possible to get the contained TinkerXYZ object out of a TinkerArc, but with certain caveats. See CCPDB::currentFrame() for more details.

Member Function Documentation

◆ coords()

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

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.

◆ currentFrame()

TinkerXYZ loos::TinkerArc::currentFrame ( void ) const
inline

Returns the contained TinkerXYZ object.

See CCPDB::currentFrame() for some important notes about using this function.

◆ description()

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

Return a string describing trajectory format.

Reimplemented from loos::Trajectory.

◆ hasPeriodicBox()

virtual bool loos::TinkerArc::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::TinkerArc::natoms ( void ) const
inlinevirtual

of atoms per frame

Implements loos::Trajectory.

◆ nframes()

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

Number of frames in the trajectory.

Implements loos::Trajectory.

◆ parseFrame()

bool loos::TinkerArc::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::TinkerArc::periodicBox ( void ) const
inlinevirtual

Returns the periodic box for the current frame/trajectory.

Implements loos::Trajectory.

◆ timestep()

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

Timestep per frame.

Implements loos::Trajectory.


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