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

#include <BALL/FORMAT/TRRFile.h>

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

List of all members.

Classes

class  TRRHeader

Public Member Functions

Constructors and Destructor

 TRRFile ()
 Default constructor.
 TRRFile (const String &name, File::OpenMode open_mode=std::ios::in)
 Construct and open a file.
virtual ~TRRFile ()
 Destructor.
Assignment

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)
virtual bool readNextHeader (TRRHeader &header)
virtual bool append (const SnapShot &snapshot)
virtual bool read (SnapShot &snapshot)
virtual TRRFileoperator>> (SnapShotManager &ssm)
 Read the whole file into a SnapShotManager.
virtual bool flushToDisk (const std::vector< SnapShot > &buffer) throw (File::CannotWrite)
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< Sizeadapt_size_
BinaryFileAdaptor< char > adapt_char_
BinaryFileAdaptor< floatadapt_float_
BinaryFileAdaptor< doubleadapt_double_

Private Member Functions

const TRRFileoperator= (const TRRFile &file)

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.

Definition at line 24 of file TRRFile.h.


Constructor & Destructor Documentation

BALL::TRRFile::TRRFile (  ) 

Default constructor.

BALL::TRRFile::TRRFile ( const String name,
File::OpenMode  open_mode = std::ios::in 
)

Construct and open a file.

virtual BALL::TRRFile::~TRRFile (  )  [virtual]

Destructor.


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 void BALL::TRRFile::clear (  )  [virtual]

Clear method.

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.

Vector3 BALL::TRRFile::getBoundingBoxX (  )  const
Vector3 BALL::TRRFile::getBoundingBoxY (  )  const
Vector3 BALL::TRRFile::getBoundingBoxZ (  )  const
Size BALL::TRRFile::getPrecision (  )  const
float BALL::TRRFile::getTimestep (  )  const
bool BALL::TRRFile::hasForces (  )  const
bool BALL::TRRFile::hasVelocities (  )  const
virtual bool BALL::TRRFile::init (  )  [virtual]

Initialize the file for usage.

const TRRFile& BALL::TRRFile::operator= ( const TRRFile file  )  [private]
bool BALL::TRRFile::operator== ( const TRRFile file  )  const

Equality operator.

virtual TRRFile& BALL::TRRFile::operator>> ( SnapShotManager ssm  )  [virtual]

Read the whole file into a SnapShotManager.

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.
void BALL::TRRFile::setBoundingBox ( const Vector3 x,
const Vector3 y,
const Vector3 z 
)
void BALL::TRRFile::setForceStorage ( bool  storage  ) 
bool BALL::TRRFile::setPrecision ( const Size  precision  ) 
void BALL::TRRFile::setTimestep ( float  timestep  ) 
void BALL::TRRFile::setVelocityStorage ( bool  storage  ) 
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.

Member Data Documentation

Definition at line 293 of file TRRFile.h.

Definition at line 295 of file TRRFile.h.

Definition at line 294 of file TRRFile.h.

Definition at line 292 of file TRRFile.h.

Definition at line 290 of file TRRFile.h.

Definition at line 290 of file TRRFile.h.

Definition at line 290 of file TRRFile.h.

Definition at line 280 of file TRRFile.h.

Definition at line 277 of file TRRFile.h.

Definition at line 271 of file TRRFile.h.

Definition at line 274 of file TRRFile.h.

Definition at line 286 of file TRRFile.h.

Definition at line 283 of file TRRFile.h.

Generated by  doxygen 1.6.3