BALL::TRRFile Class Reference
[Molecular Dynamics Trajectory File Formats]

TRR Trajectory file format. More...

#include <TRRFile.h>

Inheritance diagram for BALL::TRRFile:
Inheritance graph
[legend]

List of all members.


Classes

class TRRHeader
The header for each coordinate set stored in the TRR file. More...

Public Member Functions

Constructors and Destructor
TRRFile ()
Default constructor.
TRRFile (const TRRFile &file) throw (Exception::FileNotFound)
Copy constructor.
TRRFile (const String &name, File::OpenMode open_mode=std::ios::in)
Construct and open a file.
virtual ~TRRFile ()
Destructor.
Assignment
const TRRFile & operator= (const TRRFile &file)
Assignment operator.
virtual void clear ()
Clear method.
Predicates
bool operator== (const TRRFile &file) const
Equality operator.
Public methods for file handling
virtual bool init ()
Initialize the file for usage.
virtual bool writeNextHeader (const TRRHeader &header)
Writes the next header that shall preceed the next data block.
virtual bool readNextHeader (TRRHeader &header)
Reads the next header preceding the next data block.
virtual bool append (const SnapShot &snapshot)
Append a SnapShot to an existing file.
virtual bool read (SnapShot &snapshot)
Read the next snapshot from the file.
virtual TRRFile & operator>> (SnapShotManager &ssm)
Read the whole file into a SnapShotManager.
virtual bool flushToDisk (const std::vector< SnapShot > &buffer) throw (File::CannotWrite)
Write several SnapShots to disk.
Accessors
bool hasVelocities () const
void setVelocityStorage (bool storage)
bool hasForces () const
void setForceStorage (bool storage)
Size getPrecision () const
bool setPrecision (const Size precision)
float getTimestep () const
void setTimestep (float timestep)
Vector3 getBoundingBoxX () const
Vector3 getBoundingBoxY () const
Vector3 getBoundingBoxZ () const
void setBoundingBox (const Vector3 &x, const Vector3 &y, const Vector3 &z)

Protected Attributes

TRRHeader header_
Size precision_
bool has_velocities_
bool has_forces_
Size timestep_index_
float timestep_
Vector3 box1_
Vector3 box2_
Vector3 box3_
BinaryFileAdaptor< Size > adapt_size_
BinaryFileAdaptor< char > adapt_char_
BinaryFileAdaptor< float > adapt_float_
BinaryFileAdaptor< double > adapt_double_

Detailed Description

TRR Trajectory file format.

This class enables BALL to read and write GROMACS TRR files. This format is portable.

In a TRR file, each timestep is preceded by a header. The header is handled by the nested TRRHeader class.

Member Function Documentation

virtual bool BALL::TRRFile::append ( const SnapShot & snapshot ) [virtual]

Append a SnapShot to an existing file.

Parameters:
snapshot the SnapShot we want to store
Returns:
true, if writing was successful

Reimplemented from BALL::TrajectoryFile.

virtual bool BALL::TRRFile::flushToDisk ( const std::vector< SnapShot > & buffer ) throw (File::CannotWrite) [virtual]

Write several SnapShots to disk.

Parameters:
buffer a vector of snapshots
Returns:
true, if flushing was successful, false ow.

Reimplemented from BALL::TrajectoryFile.

virtual bool BALL::TRRFile::read ( SnapShot & snapshot ) [virtual]

Read the next snapshot from the file.

Parameters:
snapshot a buffer for result delivery
Returns:
true, if a snapshot could be read, false otherwise.

Reimplemented from BALL::TrajectoryFile.

virtual bool BALL::TRRFile::readNextHeader ( TRRHeader & header ) [virtual]

Reads the next header preceding the next data block.

Parameters:
header a buffer for result delivery
Returns:
true, if a header could be read, false ow.

virtual bool BALL::TRRFile::writeNextHeader ( const TRRHeader & header ) [virtual]

Writes the next header that shall preceed the next data block.

Parameters:
header the TRRHeader we want to write
Returns:
true, if a header could be written, false ow.

Generated on Thu Aug 6 18:30:30 2009 for BALL by doxygen 1.5.8