Loading...
Searching...
No Matches
snapShotManager.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: snapShotManager.h,v 1.19.20.1 2007/05/10 10:51:04 amoll Exp $
//
#ifndef BALL_MOLMEC_COMMON_SNAPSHOTMANAGER_H
#define BALL_MOLMEC_COMMON_SNAPSHOTMANAGER_H
#ifndef BALL_MOLMEC_COMMON_SNAPSHOT_H
# include <BALL/MOLMEC/COMMON/snapShot.h>
#endif
#ifndef BALL_DATATYPE_OPTIONS_H
# include <BALL/DATATYPE/options.h>
#endif
#ifndef BALL_SYSTEM_FILE_H
# include <BALL/SYSTEM/file.h>
#endif
namespace BALL
{
class TrajectoryFile;
class System;
class ForceField;
class BALL_EXPORT SnapShotManager
{
public:
struct BALL_EXPORT Option
{
static const char* FLUSH_TO_DISK_FREQUENCY;
};
struct BALL_EXPORT Default
{
static const Size FLUSH_TO_DISK_FREQUENCY;
};
BALL_CREATE(SnapShotManager)
SnapShotManager();
SnapShotManager(System* my_system, TrajectoryFile* my_snapshot_file = 0);
SnapShotManager(System* my_system, const ForceField* my_force_field, TrajectoryFile* my_snapshot_file);
SnapShotManager (System* my_system, const ForceField* my_force_field,
const Options& my_options, TrajectoryFile* file);
SnapShotManager(const SnapShotManager& manager);
virtual ~SnapShotManager();
bool setup(System* my_system, const ForceField* my_forcefield, TrajectoryFile* my_snapshot_file);
bool setup(System* my_system, TrajectoryFile* my_snapshot_file);
virtual bool setup();
const SnapShotManager& operator = (const SnapShotManager& manager);
virtual void clear();
virtual bool isValid() const;
void setSystem(System* my_system);
System* getSystem() const;
void setForceField(const ForceField* my_ff);
const ForceField* getForceField() const;
void setTrajectoryFile(TrajectoryFile* my_file);
TrajectoryFile* getTrajectoryFile() const;
void setFlushToDiskFrequency(Size number);
Size getFlushToDiskFrequency() const;
virtual void takeSnapShot();
virtual bool applySnapShot(Size number);
virtual bool applyFirstSnapShot();
virtual bool applyNextSnapShot();
virtual bool applyLastSnapShot();
virtual void flushToDisk();
Size getNumberOfSnapShotsInBuffer() { return snapshot_buffer_.size(); }
Position getCurrentSnapshotNumber() const { return current_snapshot_ + 1; }
bool readFromFile();
void clearBuffer();
Options options;
//_ @name Protected Attributes
//_@{
protected:
//_ The system to which the SnapshotManager is bound
System* system_ptr_;
//_ The force field of the current system
const ForceField* force_field_ptr_;
//_ A vector containing those snapshot objects currently in memory
vector<SnapShot> snapshot_buffer_;
//_ The trajectory file where the data is saved in
TrajectoryFile* trajectory_file_ptr_;
/*_ The frequency of saving snapshots in memory to disk.
After flush_to_disk_frequency_ iterations, a save is done.
*/
Size flush_to_disk_frequency_;
//_ Number of taken SnapShot sine last flushToDisk
Size buffer_counter_;
//_ Number of the current SnapShot (used with buffer_)
Position current_snapshot_;
//_@}
/*_ @name Protected methods
*/
//_@{
/*_ Calculate the kinetic energy
*/
double calculateKineticEnergy_();
//_@}
}; // end of class SnapshotManager
} // namespace
#endif // BALL_MOLMEC_COMMON_SNAPSHOTMANAGER_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::ForceField
Definition forceField.h:86
BALL::Options
Definition options.h:48
BALL::SnapShotManager::force_field_ptr_
const ForceField * force_field_ptr_
Definition snapShotManager.h:253
BALL::SnapShotManager::getFlushToDiskFrequency
Size getFlushToDiskFrequency() const
BALL::SnapShotManager::setTrajectoryFile
void setTrajectoryFile(TrajectoryFile *my_file)
set the trajectory file
BALL::SnapShotManager::applySnapShot
virtual bool applySnapShot(Size number)
BALL::SnapShotManager::takeSnapShot
virtual void takeSnapShot()
BALL::SnapShotManager::applyNextSnapShot
virtual bool applyNextSnapShot()
BALL::SnapShotManager::clear
virtual void clear()
Clear method.
BALL::SnapShotManager::setFlushToDiskFrequency
void setFlushToDiskFrequency(Size number)
BALL::SnapShotManager::SnapShotManager
SnapShotManager()
Default constructor.
BALL::SnapShotManager::system_ptr_
System * system_ptr_
Definition snapShotManager.h:250
BALL::SnapShotManager::trajectory_file_ptr_
TrajectoryFile * trajectory_file_ptr_
Definition snapShotManager.h:259
BALL::SnapShotManager::snapshot_buffer_
vector< SnapShot > snapshot_buffer_
Definition snapShotManager.h:256
BALL::SnapShotManager::getNumberOfSnapShotsInBuffer
Size getNumberOfSnapShotsInBuffer()
Definition snapShotManager.h:224
BALL::SnapShotManager::setForceField
void setForceField(const ForceField *my_ff)
set the force field
BALL::SnapShotManager::applyFirstSnapShot
virtual bool applyFirstSnapShot()
BALL::SnapShotManager::flush_to_disk_frequency_
Size flush_to_disk_frequency_
Definition snapShotManager.h:264
BALL::SnapShotManager::getCurrentSnapshotNumber
Position getCurrentSnapshotNumber() const
Definition snapShotManager.h:227
BALL::SnapShotManager::isValid
virtual bool isValid() const
BALL::SnapShotManager::applyLastSnapShot
virtual bool applyLastSnapShot()
BALL::SnapShotManager::buffer_counter_
Size buffer_counter_
Definition snapShotManager.h:267
BALL::SnapShotManager::options
Options options
The available options for this class.
Definition snapShotManager.h:241
BALL::SnapShotManager::getForceField
const ForceField * getForceField() const
get a const pointer to the force field
BALL::SnapShotManager::getTrajectoryFile
TrajectoryFile * getTrajectoryFile() const
get a pointer to the trajectory file
BALL::SnapShotManager::setup
bool setup(System *my_system, const ForceField *my_forcefield, TrajectoryFile *my_snapshot_file)
BALL::SnapShotManager::current_snapshot_
Position current_snapshot_
Definition snapShotManager.h:270
BALL::SnapShotManager::setSystem
void setSystem(System *my_system)
BALL::SnapShotManager::calculateKineticEnergy_
double calculateKineticEnergy_()
BALL::SnapShotManager::clearBuffer
void clearBuffer()
Clear all currently loaded SnapShot 's.
BALL::SnapShotManager::getSystem
System * getSystem() const
get a const pointer to the system member
BALL::SnapShotManager::readFromFile
bool readFromFile()
BALL::SnapShotManager::flushToDisk
virtual void flushToDisk()
BALL::System
Definition KERNEL/system.h:40
BALL::TrajectoryFile
Definition trajectoryFile.h:30
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
file.h
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::Position
BALL_SIZE_TYPE Position
Definition COMMON/global.h:140
options.h
snapShot.h
BALL::SnapShotManager::Default
Local class for handling default values for the options.
Definition snapShotManager.h:49
BALL::SnapShotManager::Default::FLUSH_TO_DISK_FREQUENCY
static const Size FLUSH_TO_DISK_FREQUENCY
Definition snapShotManager.h:54
BALL::SnapShotManager::Option
Local class for handling options.
Definition snapShotManager.h:39
BALL::SnapShotManager::Option::FLUSH_TO_DISK_FREQUENCY
static const char * FLUSH_TO_DISK_FREQUENCY
Definition snapShotManager.h:44