SSAGES
0.9.3
Software Suite for Advanced General Ensemble Simulations
|
String base class for FTS, Swarm, and elastic band. More...
#include <StringMethod.h>
Public Member Functions | |
StringMethod (const MPI_Comm &world, const MPI_Comm &comm, const std::vector< double > ¢ers, unsigned int maxiterations, const std::vector< double > cvspring, unsigned int frequency) | |
Constructor. More... | |
void | PreSimulation (Snapshot *snapshot, const class CVManager &cvmanager) override |
Method call prior to simulation initiation. More... | |
virtual void | PostIntegration (Snapshot *snapshot, const class CVManager &cvmanager) override=0 |
Method call post integration. More... | |
void | PostSimulation (Snapshot *snapshot, const class CVManager &cvmanager) override |
Method call post simulation. More... | |
void | SetTolerance (std::vector< double > tol) |
Set the tolerance for quitting method. More... | |
void | SetSendRecvNeighbors () |
Communicate neighbor lists over MPI. | |
virtual | ~StringMethod () |
Destructor. | |
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 StringMethod * | 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... | |
Protected Member Functions | |
virtual void | StringUpdate ()=0 |
Updates the position of the string. | |
double | distance (const std::vector< double > &x, const std::vector< double > &y) const |
Helper function for calculating distances. More... | |
void | PrintString (const CVList &CV) |
Prints the CV positions to file. More... | |
void | GatherNeighbors (std::vector< double > *lcv0, std::vector< double > *ucv0) |
Gather neighbors over MPI. More... | |
void | StringReparam (double alpha_star) |
Reparameterize the string. More... | |
void | UpdateWorldString (const CVList &cvs) |
Update the world string over MPI. More... | |
bool | TolCheck () const |
Check whether tolerance criteria have been met. More... | |
bool | CheckEnd (const CVList &CV) |
Check if method reached one of the exit criteria. More... | |
Protected Attributes | |
std::vector< double > | centers_ |
CV starting location values. | |
std::vector< double > | newcenters_ |
CV starting location values. | |
std::vector< std::vector< double > > | worldstring_ |
The world's strings centers for each CV. More... | |
int | mpiid_ |
The node this belongs to. | |
std::vector< double > | tol_ |
Tolerance criteria for determining when to stop string (default 0 if no tolerance criteria) | |
int | numnodes_ |
Number of nodes on a string. | |
unsigned int | maxiterator_ |
Maximum cap on number of string method iterations performed. | |
std::vector< double > | cvspring_ |
Vector of spring constants. | |
unsigned int | iterator_ |
The local method iterator. | |
unsigned int | iteration_ |
The global method iteration. | |
std::ofstream | stringout_ |
Output stream for string data. | |
int | sendneigh_ |
Neighbor to send info to. | |
int | recneigh_ |
Neighbor to gain info from. | |
std::vector< std::vector< double > > | prev_positions_ |
Store positions for starting trajectories. | |
std::vector< std::vector< double > > | prev_velocities_ |
Store velocities for starting trajectories. | |
std::vector< std::vector< int > > | prev_IDs_ |
Store atom IDs for starting trajectories. | |
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. | |
String base class for FTS, Swarm, and elastic band.
Implementation of a multi-walker finite string method with hard wall voronoi cells and running block averages.
Definition at line 38 of file StringMethod.h.
|
inline |
Constructor.
world | MPI global communicator. |
comm | MPI local communicator. |
centers | List of centers. |
maxiterations | Maximum number of iterations. |
cvspring | Spring constants for cvs. |
frequency | Frequency with which this method is invoked. |
Definition at line 176 of file StringMethod.h.
References centers_, and newcenters_.
|
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 220 of file StringMethod.cpp.
References Json::Requirement::GetErrors(), Json::Requirement::HasErrors(), Json::ObjectRequirement::Parse(), SetTolerance(), and Json::ObjectRequirement::Validate().
|
protected |
Check if method reached one of the exit criteria.
CV | list of CVs. |
The string method exits if either the maximum number of iteration has been reached or if all CVs are within the given tolerance thresholds.
Definition at line 128 of file StringMethod.cpp.
Referenced by SSAGES::ElasticBand::PostIntegration(), SSAGES::FiniteTempString::PostIntegration(), and SSAGES::Swarm::PostIntegration().
|
inlineprotected |
Helper function for calculating distances.
x | List of coordinates. |
y | List of coordinates. |
Definition at line 102 of file StringMethod.h.
Referenced by SSAGES::FiniteTempString::StringUpdate(), and SSAGES::Swarm::StringUpdate().
|
protected |
Gather neighbors over MPI.
lcv0 | Pointer to store array of lower CV values. |
ucv0 | Pointer to store array of upper CV values. |
Definition at line 53 of file StringMethod.cpp.
Referenced by SSAGES::ElasticBand::StringUpdate(), SSAGES::FiniteTempString::StringUpdate(), and SSAGES::Swarm::StringUpdate().
|
overridepure virtual |
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.
Implemented in SSAGES::Swarm, SSAGES::FiniteTempString, and SSAGES::ElasticBand.
|
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 169 of file StringMethod.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 152 of file StringMethod.cpp.
References SSAGES::CVManager::GetCVs(), and SSAGES::Snapshot::GetWalkerID().
|
protected |
Prints the CV positions to file.
CV | Collective Variables to be printed |
Definition at line 38 of file StringMethod.cpp.
Referenced by SSAGES::ElasticBand::PostIntegration(), SSAGES::FiniteTempString::PostIntegration(), and SSAGES::Swarm::PostIntegration().
|
inline |
Set the tolerance for quitting method.
tol | List of tolerances for each CV. |
Set the tolerance levels until which the method should run. The method quit, when the tolerance level is reached for all CVs.
Definition at line 205 of file StringMethod.h.
References tol_.
Referenced by Build().
|
protected |
Reparameterize the string.
alpha_star | Factor for reparametrization. |
Definition at line 72 of file StringMethod.cpp.
Referenced by SSAGES::FiniteTempString::StringUpdate(), and SSAGES::Swarm::StringUpdate().
|
inlineprotected |
Check whether tolerance criteria have been met.
Definition at line 140 of file StringMethod.h.
References centers_, mpiid_, tol_, and worldstring_.
|
protected |
Update the world string over MPI.
cvs | List of CVs. |
Definition at line 106 of file StringMethod.cpp.
Referenced by SSAGES::ElasticBand::PostIntegration(), SSAGES::FiniteTempString::PostIntegration(), and SSAGES::Swarm::PostIntegration().
|
protected |
The world's strings centers for each CV.
worldstring_[node#][cv#]
Definition at line 52 of file StringMethod.h.
Referenced by SSAGES::FiniteTempString::InCell(), and TolCheck().