Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

TRRFile Class Reference
[Molecular Dynamics Trajectory File Formats]

TRR Trajectory file format. More...

#include <TRRFile.h>

Inheritance diagram for TRRFile:

TrajectoryFile File List of all members.

Public Member Functions

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

Protected Attributes

TRRHeader header_
Size precision_
bool has_velocities_
bool has_forces_
Size timestep_index_
float timestep_
Vector3 box1_
Vector3 box2_
Vector3 box3_

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 TRRFile::append const SnapShot snapshot  )  throw () [virtual]
 

Append a SnapShot to an existing file.

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

Reimplemented from TrajectoryFile.

virtual bool 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 TrajectoryFile.

virtual bool TRRFile::read SnapShot snapshot  )  throw () [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 TrajectoryFile.

virtual bool TRRFile::readNextHeader TRRHeader header  )  throw () [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 TRRFile::writeNextHeader const TRRHeader header  )  throw () [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.