SSAGES
0.9.3
Software Suite for Advanced General Ensemble Simulations
|
Umbrella sampling method. More...
#include <Umbrella.h>
Public Member Functions | |
Umbrella (const MPI_Comm &world, const MPI_Comm &comm, const std::vector< double > &kspring, const std::vector< double > ¢ers, std::string name, unsigned int frequency) | |
Constructor. More... | |
Umbrella (const MPI_Comm &world, const MPI_Comm &comm, const std::vector< double > &kspring, const std::vector< double > ¢ers0, const std::vector< double > ¢ers1, size_t timesteps, std::string name, unsigned int frequency) | |
Constructor. More... | |
void | PreSimulation (Snapshot *snapshot, const class CVManager &cvmanager) override |
Method call prior to simulation initiation. More... | |
void | PostIntegration (Snapshot *snapshot, const class CVManager &cvmanager) override |
Method call post integration. More... | |
void | PostSimulation (Snapshot *snapshot, const class CVManager &cvmanager) override |
Method call post simulation. More... | |
void | SetOutputFrequency (int outfreq) |
Set output frequency. More... | |
void | SetAppend (bool append) |
Set append mode. More... | |
Public Member Functions inherited from SSAGES::Method | |
Method (unsigned int frequency, const MPI_Comm &world, const MPI_Comm &comm) | |
Constructor. More... | |
void | SetCVMask (const std::vector< unsigned int > &mask) |
Sets the collective variable mask. More... | |
virtual | ~Method () |
Destructor. | |
Public Member Functions inherited from SSAGES::EventListener | |
EventListener (unsigned int frequency) | |
Constructor. More... | |
unsigned int | GetFrequency () const |
Get frequency of event listener. More... | |
virtual | ~EventListener () |
Destructor. | |
Static Public Member Functions | |
static Umbrella * | Build (const Json::Value &json, const MPI_Comm &world, const MPI_Comm &comm, const std::string &path) |
Build a derived method from JSON node. More... | |
Static Public Member Functions inherited from SSAGES::Method | |
static Method * | BuildMethod (const Json::Value &json, const MPI_Comm &world, const MPI_Comm &comm, const std::string &path) |
Build a derived method from JSON node. More... | |
Static Public Member Functions inherited from SSAGES::EventListener | |
static unsigned int | GetWalkerID (const MPI_Comm &world, const MPI_Comm &comm) |
Get walker ID number of specified communicator. More... | |
static unsigned int | GetNumWalkers (const MPI_Comm &world, const MPI_Comm &comm) |
Get total number of walkers in the simulation. More... | |
static bool | IsMasterRank (const MPI_Comm &comm) |
Check if current processor is master. More... | |
Private Member Functions | |
double | GetCurrentCenter (size_t iteration, size_t i) |
Get the current center of the umbrella at a given iteration. More... | |
void | PrintUmbrella (const CVList &cvs, size_t iteration) |
Print umbrella values. More... | |
Private Attributes | |
std::vector< double > | kspring_ |
Vector of spring constants. | |
size_t | time_ |
Amount of time over which to scale centers. | |
std::string | filename_ |
Output filename. | |
int | outfreq_ |
Frequency of outputting data. | |
std::ofstream | umbrella_ |
Output stream for umbrella data. | |
bool | append_ |
Append to output files? | |
std::vector< double > | centers0_ |
std::vector< double > | centers1_ |
Additional Inherited Members | |
Protected Attributes inherited from SSAGES::Method | |
mxx::comm | world_ |
Global MPI communicator. | |
mxx::comm | comm_ |
Local MPI communicator. | |
std::vector< unsigned int > | cvmask_ |
Mask which identifies which CVs to act on. | |
Umbrella sampling method.
Umbrella sampling method to constrain an arbitrary number of CVs at specified equilibrium distances.
Definition at line 35 of file Umbrella.h.
|
inline |
Constructor.
world | MPI global communicator. |
comm | MPI local communicator. |
kspring | List of spring constants. |
centers | List of spring equilibrium positions. |
name | Filename. |
frequency | Frequency with which this method is applied. |
Create instance of umbrella with spring constants "kspring", and centers "centers". Note the sizes of the vectors should be commensurate with the number of CVs.
Definition at line 98 of file Umbrella.h.
|
inline |
Constructor.
world | MPI global communicator. |
comm | MPI local communicator. |
kspring | List of spring constants. |
centers0 | List of starting spring equilibrium positions. |
centers1 | List of ending spring equilibrium positions. |
timesteps | Number of timesteps over which to scale centers. |
name | Filename. |
frequency | Frequency with which this method is applied. |
Create instance of umbrella with spring constants "kspring", and centers "centers". Note the sizes of the vectors should be commensurate with the number of CVs.
Definition at line 124 of file Umbrella.h.
|
static |
Build a derived method from JSON node.
json | JSON Value containing all input information. |
world | MPI global communicator. |
comm | MPI local communicator. |
path | Path for JSON path specification. |
This function builds a registered method from a JSON node. The difference between this function and "Build" is that this automatically determines the appropriate derived type based on the JSON node information.
Definition at line 112 of file Umbrella.cpp.
References Json::Requirement::GetErrors(), Json::Requirement::HasErrors(), Json::ObjectRequirement::Parse(), SetAppend(), SetOutputFrequency(), and Json::ObjectRequirement::Validate().
|
inlineprivate |
Get the current center of the umbrella at a given iteration.
iteration | Current iteration of the Snapshot. |
i | index (iterator) for CV. |
Definition at line 68 of file Umbrella.h.
|
overridevirtual |
Method call post integration.
snapshot | Pointer to the simulation snapshot. |
cvmanager | Collective variable manager. |
This function will be called after each integration step.
Implements SSAGES::Method.
Definition at line 57 of file Umbrella.cpp.
References SSAGES::CVManager::GetCVs(), SSAGES::Snapshot::GetForces(), SSAGES::Snapshot::GetIteration(), and SSAGES::Snapshot::GetVirial().
|
overridevirtual |
Method 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::Method.
Definition at line 86 of file Umbrella.cpp.
|
overridevirtual |
Method 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::Method.
Definition at line 33 of file Umbrella.cpp.
References SSAGES::CVManager::GetCVs().
|
private |
Print umbrella values.
cvs | List of CVs. |
iteration | Current iteration. |
Definition at line 92 of file Umbrella.cpp.
|
inline |
Set append mode.
append | Whether to enable or disable append mode. |
Definition at line 159 of file Umbrella.h.
References append_.
Referenced by Build().
|
inline |
Set output frequency.
outfreq | New value for output frequency. |
Definition at line 150 of file Umbrella.h.
References outfreq_.
Referenced by Build().
|
private |
Vector of equilibrium distances.
Definition at line 43 of file Umbrella.h.
Referenced by GetCurrentCenter().