SSAGES
0.1
A MetaDynamics Package
|
Base class for logging SSAGES data. More...
#include <Logger.h>
Public Member Functions | |
Logger (uint frequency, const std::string &filename, const MPI_Comm &world, const MPI_Comm &comm) | |
Constructor. More... | |
virtual void | PreSimulation (Snapshot *snapshot, const class CVManager &cvmanager) override |
Logger call prior to simulation initiation. More... | |
virtual void | PostIntegration (Snapshot *snapshot, const class CVManager &cvmanager) override |
Logger call post integration. More... | |
virtual void | PostSimulation (Snapshot *snapshot, const class CVManager &cvmanager) override |
Logger call post simulation. More... | |
void | SetCVMask (const std::vector< uint > &mask) |
Sets the collective variable mask. | |
void | SetAppend (bool append) |
Set append mode. More... | |
virtual | ~Logger () |
Destructor. | |
![]() | |
EventListener (uint frequency) | |
Constructor. More... | |
uint | GetFrequency () const |
Get frequency of event listener. More... | |
virtual | ~EventListener () |
Destructor. | |
Static Public Member Functions | |
static Logger * | Build (const Json::Value &json, const MPI_Comm &world, const MPI_Comm &comm, const std::string &path) |
Build a Logger from JSON node. More... | |
Protected Attributes | |
mxx::comm | world_ |
Global MPI communicator. | |
mxx::comm | comm_ |
Local MPI communicator. | |
std::vector< uint > | cvmask_ |
Mask which identifies which CVs to log. | |
std::string | filename_ |
Name of logfile. | |
std::ofstream | log_ |
Log file stream. | |
bool | append_ |
Append mode? | |
Base class for logging SSAGES data.
The base class for logging useful data in SSAGES that is not necessarily written out by methods. Primarily this includes the value(s) of the collective variable(s) on the various walkers over time, the magnitude of the bias if a method supports it, and so on.
|
inline |
Constructor.
frequency | Frequency of logging. |
world | Global MPI communicator. |
comm | MPI communicator of walker. |
Definition at line 68 of file Logger.h.
|
static |
Build a Logger from JSON node.
json | JSON Value containing all input information. |
world | MPI global communicator. |
comm | MPI local communicator. |
path | Path for JSON path specification. |
Definition at line 75 of file Logger.cpp.
References Json::Requirement::GetErrors(), Json::Requirement::HasErrors(), Json::ObjectRequirement::Parse(), and Json::ObjectRequirement::Validate().
Referenced by SSAGES::ResourceHandler::Build().
|
overridevirtual |
Logger call post integration.
snapshot | Pointer to the simulation snapshot. |
cvmanager | Collective variable manager. |
This function will be called after each integration step.
Implements SSAGES::EventListener.
Definition at line 55 of file Logger.cpp.
References SSAGES::CVManager::GetCVs(), and SSAGES::Snapshot::GetIteration().
|
overridevirtual |
Logger call post simulation.
snapshot | Pointer to the simulation snapshot. |
cvmanager | Collective variable manager. |
This function will be called after the end of the simulation run.
Implements SSAGES::EventListener.
Definition at line 71 of file Logger.cpp.
|
overridevirtual |
Logger call prior to simulation initiation.
snapshot | Pointer to the simulation snapshot. |
cvmanager | Collective variable manager. |
This function will be called before the simulation is started.
Implements SSAGES::EventListener.
Definition at line 34 of file Logger.cpp.
References SSAGES::CVManager::GetCVs().
|
inline |