SSAGES
0.1
A MetaDynamics Package
|
Base class for hooks into the simultion engines. More...
#include <Hook.h>
Public Member Functions | |
Hook () | |
Constructor. More... | |
void | SetSnapshot (class Snapshot *snapshot) |
Sets the active snapshot. | |
void | SetCVManager (class CVManager *cvmanager) |
Sets the current CV manager. More... | |
void | AddListener (EventListener *listener) |
Add a listener to the hook. More... | |
void | NotifyObservers () |
Notify observers of changes in the simulation. | |
void | PreSimulationHook () |
Pre-simulation hook. More... | |
void | PostIntegrationHook () |
Post-integration hook. More... | |
void | PostStepHook () |
Post-step hook. More... | |
void | PostSimulationHook () |
Post-simulation hook. More... | |
virtual | ~Hook () |
Destructor. | |
Protected Member Functions | |
virtual void | SyncToEngine ()=0 |
Synchronization to the simulation engine. More... | |
virtual void | SyncToSnapshot ()=0 |
Synchronization to the snapshot. More... | |
Protected Attributes | |
class Snapshot * | snapshot_ |
Local snapshot. | |
Private Attributes | |
std::vector< EventListener * > | listeners_ |
Vector of event listeners. | |
class CVManager * | cvmanager_ |
Collective variable manager. | |
Base class for hooks into the simultion engines.
Abstract base class responsible for hooking into simulation engine and calling appropriate events.
|
inline |
void SSAGES::Hook::AddListener | ( | EventListener * | listener | ) |
Add a listener to the hook.
listener | Pointer to the EventListener to be added to the Hook. |
Does nothing if the listener is already added.
Definition at line 103 of file Hook.cpp.
References listeners_.
void SSAGES::Hook::PostIntegrationHook | ( | ) |
Post-integration hook.
This function should be called by the Hook implementation within the integration routine such that the forces, position, velocities, etc.. will be updated.
Definition at line 52 of file Hook.cpp.
References SSAGES::Snapshot::Changed(), cvmanager_, SSAGES::CVManager::GetCVs(), SSAGES::Snapshot::GetIteration(), SSAGES::Snapshot::HasChanged(), listeners_, snapshot_, and SyncToEngine().
void SSAGES::Hook::PostSimulationHook | ( | ) |
Post-simulation hook.
This method should be called by the Hook implementation at the end of the simulation.
Definition at line 69 of file Hook.cpp.
References SSAGES::Snapshot::Changed(), cvmanager_, SSAGES::CVManager::GetCVs(), SSAGES::Snapshot::HasChanged(), listeners_, snapshot_, and SyncToEngine().
|
inline |
void SSAGES::Hook::PreSimulationHook | ( | ) |
Pre-simulation hook.
This should be called at the appropriate time by the Hook implementation.
Definition at line 30 of file Hook.cpp.
References SSAGES::Snapshot::Changed(), cvmanager_, SSAGES::CVManager::GetCVs(), SSAGES::Snapshot::HasChanged(), listeners_, snapshot_, and SyncToEngine().
void SSAGES::Hook::SetCVManager | ( | class CVManager * | cvmanager | ) |
Sets the current CV manager.
Sets the active CV manager.
Definition at line 92 of file Hook.cpp.
References cvmanager_.
|
protectedpure virtual |
Synchronization to the simulation engine.
A Hook must implement this method. It takes data from the snapshot and updates the simulation engine with it.
Referenced by PostIntegrationHook(), PostSimulationHook(), and PreSimulationHook().
|
protectedpure virtual |
Synchronization to the snapshot.
A Hook must implement this method. It takes data from the simulation eingine and updates the snapshot with it.