#include <snapShotManager.h>
Public Member Functions | |
Constructors and Destructors | |
SnapShotManager () throw () | |
Default constructor. | |
SnapShotManager (System *my_system, const ForceField *my_force_field, TrajectoryFile *my_snapshot_file) throw () | |
This constructor expects a valid system, a valid force field and the name of a snapshot file. | |
SnapShotManager (System *my_system, const ForceField *my_force_field, const Options &my_options, TrajectoryFile *file) throw () | |
This constructor expects a valid system, a valid force field and the name of a snapshot file. | |
SnapShotManager (const SnapShotManager &manager) throw () | |
Copy constructor. | |
virtual | ~SnapShotManager () throw () |
Destructor. | |
Setup methods | |
bool | setup (System *my_system, const ForceField *my_forcefield, TrajectoryFile *my_snapshot_file) throw () |
This setup method sets all necessary members and calls setup afterwards. | |
virtual bool | setup () throw () |
The setup method does all preparations necessary for using the SnapshotManager. | |
Assignment | |
const SnapShotManager & | operator= (const SnapShotManager &manager) throw () |
The assignment operator. | |
virtual void | clear () throw () |
Clear method. | |
Debugging and diagnostics | |
virtual bool | isValid () const throw () |
Is the SnapshotManager ready for use? | |
Accessors | |
void | setSystem (System *my_system) throw () |
Set the system member. | |
System * | getSystem () const throw () |
get a const pointer to the system member | |
void | setForceField (const ForceField *my_ff) throw () |
set the force field | |
const ForceField * | getForceField () const throw () |
get a const pointer to the force field | |
void | setTrajectoryFile (TrajectoryFile *my_file) throw () |
set the trajectory file | |
TrajectoryFile * | getTrajectoryFile () const throw () |
get a pointer to the trajectory file | |
void | setFlushToDiskFrequency (Size number) throw () |
Set the frequency for saving snapshots to hard disk. | |
Size | getFlushToDiskFrequency () const throw () |
Get the current frequency for doing saves to hard disk. | |
virtual void | takeSnapShot () throw (File::CannotWrite) |
This method takes a snapshot of the system's current state and stores it in main memory. | |
virtual bool | applySnapShot (Size number) throw () |
Read a certain SnapShot from a TrajectoryFile. | |
virtual bool | applyFirstSnapShot () throw () |
Read a the first SnapShot from the associated TrajectoryFile. | |
virtual bool | applyNextSnapShot () throw () |
Read a the next SnapShot from the associated TrajectoryFile and apply it to the system. | |
virtual bool | applyLastSnapShot () throw () |
This method applies the last SnapShot of the associated file i. | |
virtual void | flushToDisk () throw (File::CannotWrite) |
This method writes all snapshots taken so far to hard disk. | |
Size | getNumberOfSnapShotsInBuffer () throw () |
Position | getCurrentSnapshotNumber () const throw () |
bool | readFromFile () throw () |
Try to read all SnapShot 's from the TrajectoryFile into the memory. | |
void | clearBuffer () throw () |
Clear all currently loaded SnapShot 's. | |
Public Attributes | |
Public Attributes | |
Options | options |
The available options for this class. | |
Protected Member Functions | |
double | calculateKineticEnergy_ () |
Protected Attributes | |
System * | system_ptr_ |
const ForceField * | force_field_ptr_ |
vector< SnapShot > | snapshot_buffer_ |
TrajectoryFile * | trajectory_file_ptr_ |
Size | flush_to_disk_frequency_ |
Size | buffer_counter_ |
Position | current_snapshot_ |
for MD simulations. This class manages a list of single SnapShot objects. Snapshots are numbered starting with 1.
|
This constructor expects a valid system, a valid force field and the name of a snapshot file. Any existing file of the given name will be overwritten.
|
|
This constructor expects a valid system, a valid force field and the name of a snapshot file. Any existing file of the given name will be overwritten.
|
|
Read a the first SnapShot from the associated TrajectoryFile.
|
|
This method applies the last SnapShot of the associated file i. e. writes all available data (positions, forces, etc.) from the SnapShot to the System. Note that a SnapShot does not need to have all data. |
|
Read a the next SnapShot from the associated TrajectoryFile and apply it to the system.
|
|
Read a certain SnapShot from a TrajectoryFile. This method tries to read SnapShot number number from the file
|
|
Get the current frequency for doing saves to hard disk.
|
|
The assignment operator.
|
|
Try to read all SnapShot 's from the TrajectoryFile into the memory.
|
|
Set the frequency for saving snapshots to hard disk. Every 'number' iterations, a save will be done.
|
|
Set the system member.
|
|
The setup method does all preparations necessary for using the SnapshotManager.
|
|
This setup method sets all necessary members and calls setup afterwards.
|
|
This method takes a snapshot of the system's current state and stores it in main memory. If there is not sufficient space, the snapshots collected so far are flushed to hard disk. The first snapshot taken has index 1. |