BALL
1.4.1
|
#include <BALL/FORMAT/DCDFile.h>
Public Member Functions | |
Constructors and Destructor | |
DCDFile () | |
Default constructor. | |
DCDFile (const String &name, File::OpenMode open_mode=std::ios::in) | |
virtual | ~DCDFile () |
Destructor. | |
Assignment | |
virtual void | clear () |
Clear method. | |
Predicates | |
bool | operator== (const DCDFile &file) const |
Equality operator. | |
bool | isSwappingBytes () const |
bool | hasVelocities () const |
Public methods for file handling | |
virtual bool | open (const String &name, File::OpenMode open_mode=std::ios::in) |
bool | init () |
virtual bool | readHeader () |
virtual bool | writeHeader () |
virtual bool | seekAndWriteHeader () |
virtual bool | append (const SnapShot &snapshot) |
virtual bool | read (SnapShot &snapshot) |
virtual bool | flushToDisk (const std::vector< SnapShot > &buffer) |
Accessors | |
void | enableVelocityStorage () |
void | disableVelocityStorage () |
Protected Member Functions | |
void | writeSize_ (const Size &data) |
void | writeFloat_ (const float &data) |
void | writeVector_ (const vector< Vector3 > &v) |
float | readFloat_ () |
Size | readSize_ () |
bool | readSize_ (Size expected_size, const String &what) |
bool | readVector_ (vector< Vector3 > &v) |
Protected Attributes | |
Size | verbosity_ |
bool | swap_bytes_ |
bool | has_velocities_ |
bool | charmm_extra_block_A_ |
bool | charmm_extra_block_B_ |
String | CORD_ |
Size | step_number_of_starting_time_ |
Size | steps_between_saves_ |
double | time_step_length_ |
Size | number_of_comments_ |
Position | current_snapshot_ |
BinaryFileAdaptor< Size > | adapt_size_ |
BinaryFileAdaptor< float > | adapt_float_ |
Private Member Functions | |
const DCDFile & | operator= (const DCDFile &file) |
DCD Trajectory file format. This class enables BALL to write DCD files that can be read by VMD. The format stems from the xplor package. This format is NOT portable.
Default constructor.
BALL::DCDFile::DCDFile | ( | const String & | name, |
File::OpenMode | open_mode = std::ios::in |
||
) |
Detailed constructor
Exception::FileNotFound | if the file could not be openend |
virtual BALL::DCDFile::~DCDFile | ( | ) | [virtual] |
Destructor.
virtual bool BALL::DCDFile::append | ( | const SnapShot & | snapshot | ) | [virtual] |
Append a SnapShot to an existing file. Note that this method does not update the header.
snapshot | the snapshot we want to save |
Reimplemented from BALL::TrajectoryFile.
virtual void BALL::DCDFile::clear | ( | ) | [virtual] |
Clear method.
Reimplemented from BALL::TrajectoryFile.
void BALL::DCDFile::enableVelocityStorage | ( | ) |
virtual bool BALL::DCDFile::flushToDisk | ( | const std::vector< SnapShot > & | buffer | ) | [virtual] |
Write several SnapShots to disk.
buffer | a vector of snapshots |
File::CannotWrite | if writing to the file failed |
Reimplemented from BALL::TrajectoryFile.
bool BALL::DCDFile::hasVelocities | ( | ) | const |
Initialize this instance, i. e. read the header and update members
bool BALL::DCDFile::isSwappingBytes | ( | ) | const |
virtual bool BALL::DCDFile::open | ( | const String & | name, |
File::OpenMode | open_mode = std::ios::in |
||
) | [virtual] |
open a DCDFile
Exception::FileNotFound | if the file could not be openend |
Reimplemented from BALL::File.
virtual bool BALL::DCDFile::read | ( | SnapShot & | snapshot | ) | [virtual] |
Read the next snapshot from the file
snapshot | a buffer for result delivery |
Reimplemented from BALL::TrajectoryFile.
float BALL::DCDFile::readFloat_ | ( | ) | [protected] |
virtual bool BALL::DCDFile::readHeader | ( | ) | [virtual] |
Read the header of an existing file. Return true if the header could be read successfully, false ow.
Reimplemented from BALL::TrajectoryFile.
Size BALL::DCDFile::readSize_ | ( | ) | [protected] |
bool BALL::DCDFile::readSize_ | ( | Size | expected_size, |
const String & | what | ||
) | [protected] |
bool BALL::DCDFile::readVector_ | ( | vector< Vector3 > & | v | ) | [protected] |
virtual bool BALL::DCDFile::seekAndWriteHeader | ( | ) | [virtual] |
void BALL::DCDFile::writeFloat_ | ( | const float & | data | ) | [inline, protected] |
virtual bool BALL::DCDFile::writeHeader | ( | ) | [virtual] |
Write a header Return true if the header could be written successfully, false ow.
Reimplemented from BALL::TrajectoryFile.
void BALL::DCDFile::writeSize_ | ( | const Size & | data | ) | [inline, protected] |
void BALL::DCDFile::writeVector_ | ( | const vector< Vector3 > & | v | ) | [protected] |
BinaryFileAdaptor<float> BALL::DCDFile::adapt_float_ [protected] |
BinaryFileAdaptor<Size> BALL::DCDFile::adapt_size_ [protected] |
bool BALL::DCDFile::charmm_extra_block_A_ [protected] |
bool BALL::DCDFile::charmm_extra_block_B_ [protected] |
String BALL::DCDFile::CORD_ [protected] |
Position BALL::DCDFile::current_snapshot_ [protected] |
bool BALL::DCDFile::has_velocities_ [protected] |
Size BALL::DCDFile::number_of_comments_ [protected] |
Size BALL::DCDFile::step_number_of_starting_time_ [protected] |
Size BALL::DCDFile::steps_between_saves_ [protected] |
bool BALL::DCDFile::swap_bytes_ [protected] |
double BALL::DCDFile::time_step_length_ [protected] |
Size BALL::DCDFile::verbosity_ [protected] |