SSAGES  0.1
A MetaDynamics Package
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SSAGES::Swarm Class Reference

Swarm of Trajectories String Method. More...

#include <Swarm.h>

Inheritance diagram for SSAGES::Swarm:
Inheritance graph
[legend]

Public Member Functions

 Swarm (const MPI_Comm &world, const MPI_Comm &comm, const std::vector< double > &centers, unsigned int maxiterations, const std::vector< double > cvspring, unsigned int frequency, unsigned int InitialSteps, unsigned int HarvestLength, unsigned int NumberTrajectories, unsigned int SwarmLength)
 Constructor. More...
 
void PostIntegration (Snapshot *snapshot, const class CVManager &cvmanager) override
 Post-integration hook.
 
 ~Swarm ()
 Destructor.
 
- Public Member Functions inherited from SSAGES::StringMethod
 StringMethod (const MPI_Comm &world, const MPI_Comm &comm, const std::vector< double > &centers, unsigned int maxiterations, const std::vector< double > cvspring, unsigned int frequency)
 Constructor. More...
 
void PreSimulation (Snapshot *snapshot, const class CVManager &cvmanager) override
 Pre-simulation hook.
 
void PostSimulation (Snapshot *, const class 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 (uint frequency, const MPI_Comm &world, const MPI_Comm &comm)
 Constructor. More...
 
void SetCVMask (const std::vector< uint > &mask)
 Sets the collective variable mask.
 
virtual ~Method ()
 Destructor.
 
- Public Member Functions inherited from SSAGES::EventListener
 EventListener (uint frequency)
 Constructor. More...
 
uint GetFrequency () const
 Get frequency of event listener. More...
 
virtual ~EventListener ()
 Destructor.
 

Private Member Functions

void StringUpdate ()
 Updates the positions of the string.
 
bool CVInitialized (const CVList &cvs)
 Helper function check if CVs are initialized correctly.
 

Private Attributes

std::vector< double > cv_drift_
 Drift of CVs for one iteration.
 
unsigned int initialize_steps_
 Total number of MD steps for initialization for one iteration.
 
unsigned int harvest_length_
 Length to run before harvesting a trajectory for unrestrained sampling.
 
unsigned int restrained_steps_
 Total number of restrained MD steps for one iteration.
 
unsigned int number_trajectories_
 Number of trajectories per swarm.
 
unsigned int swarm_length_
 Length of unrestrained trajectories.
 
unsigned int unrestrained_steps_
 Total number of unrestrained MD steps for one iteration.
 
unsigned int index_
 For indexing trajectory vectors.
 
std::vector< Labeltraj_atomids_
 Store atom IDs for starting trajecotires.
 
bool sampling_started
 Flag for determing whether to perform initialization or not.
 
bool snapshot_stored
 Flag for whether a snapshot was stored in the umbrella sampling.
 
int initialized
 Flag for whether a system is initialized at a given iteration.
 
bool original_initialized
 Flag for whether a system was initialized before it checked whether other systems were.
 

Additional Inherited Members

- Static Public Member Functions inherited from SSAGES::StringMethod
static StringMethodBuild (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 MethodBuildMethod (const Json::Value &json, const MPI_Comm &world, const MPI_Comm &comm, const std::string &path)
 Build a derived method from JSON node. More...
 
- Protected Member Functions inherited from SSAGES::StringMethod
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.
 
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 has been met.
 
bool CheckEnd (const CVList &CV)
 Check if method reached one of the exit criteria. More...
 
- Protected Attributes inherited from SSAGES::StringMethod
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.
 
uint 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< uint > cvmask_
 Mask which identifies which CVs to act on.
 

Detailed Description

Swarm of Trajectories String Method.

Implementation of the swarm of trajectories string method.

Definition at line 32 of file Swarm.h.

Constructor & Destructor Documentation

SSAGES::Swarm::Swarm ( const MPI_Comm &  world,
const MPI_Comm &  comm,
const std::vector< double > &  centers,
unsigned int  maxiterations,
const std::vector< double >  cvspring,
unsigned int  frequency,
unsigned int  InitialSteps,
unsigned int  HarvestLength,
unsigned int  NumberTrajectories,
unsigned int  SwarmLength 
)
inline

Constructor.

Parameters
worldMPI global communicator.
commMPI local communicator.
centersList of centers.
maxiterationsMaximum number of iterations.
cvspringSpring constants for CVs.
frequencyAplly method with this frequency.
InitialStepsNumber of initial steps.
HarvestLengthLength of trajectory before weighing.
NumberTrajectoriesNumber of trajectories.
SwarmLengthLengt of the swarms.

Constructs an instance of the swarm of trajectories method.

Definition at line 98 of file Swarm.h.

References SSAGES::StringMethod::centers_, SSAGES::StringMethod::iterator_, number_trajectories_, PostIntegration(), SSAGES::StringMethod::prev_IDs_, SSAGES::StringMethod::prev_positions_, and SSAGES::StringMethod::prev_velocities_.

107  :
108  StringMethod(world, comm, centers, maxiterations, cvspring, frequency),
109  cv_drift_(),
110  initialize_steps_(InitialSteps),
111  harvest_length_(HarvestLength),
112  number_trajectories_(NumberTrajectories),
113  swarm_length_(SwarmLength)
114  {
115  cv_drift_.resize(centers_.size(), 0);
119  //Additional initializing
120 
121  index_ = 0;
124  sampling_started = false;
125  snapshot_stored = false;
126 
127  iterator_ = 0; //Override default StringMethod.h initializing
128  }
StringMethod(const MPI_Comm &world, const MPI_Comm &comm, const std::vector< double > &centers, unsigned int maxiterations, const std::vector< double > cvspring, unsigned int frequency)
Constructor.
Definition: StringMethod.h:170
unsigned int initialize_steps_
Total number of MD steps for initialization for one iteration.
Definition: Swarm.h:40
std::vector< std::vector< double > > prev_velocities_
Store velocities for starting trajectories.
Definition: StringMethod.h:88
std::vector< double > centers_
CV starting location values.
Definition: StringMethod.h:43
std::vector< double > cv_drift_
Drift of CVs for one iteration.
Definition: Swarm.h:37
unsigned int swarm_length_
Length of unrestrained trajectories.
Definition: Swarm.h:52
bool sampling_started
Flag for determing whether to perform initialization or not.
Definition: Swarm.h:70
bool snapshot_stored
Flag for whether a snapshot was stored in the umbrella sampling.
Definition: Swarm.h:73
std::vector< std::vector< int > > prev_IDs_
Store atom IDs for starting trajectories.
Definition: StringMethod.h:91
unsigned int number_trajectories_
Number of trajectories per swarm.
Definition: Swarm.h:49
unsigned int harvest_length_
Length to run before harvesting a trajectory for unrestrained sampling.
Definition: Swarm.h:43
unsigned int restrained_steps_
Total number of restrained MD steps for one iteration.
Definition: Swarm.h:46
unsigned int iterator_
The local method iterator.
Definition: StringMethod.h:70
unsigned int unrestrained_steps_
Total number of unrestrained MD steps for one iteration.
Definition: Swarm.h:55
unsigned int index_
For indexing trajectory vectors.
Definition: Swarm.h:58
std::vector< std::vector< double > > prev_positions_
Store positions for starting trajectories.
Definition: StringMethod.h:85

Here is the call graph for this function:


The documentation for this class was generated from the following files: