102 double distance(
const std::vector<double>& x,
const std::vector<double>& y)
const
105 for (
size_t i = 0; i < x.size(); i++)
106 distance += pow((x[i] - y[i]),2);
108 return sqrt(distance);
119 void GatherNeighbors(std::vector<double> *lcv0, std::vector<double> *ucv0);
139 for(
size_t i = 0; i <
centers_.size(); i++)
171 const MPI_Comm& comm,
172 const std::vector<double>& centers,
173 unsigned int maxiterations,
174 const std::vector<double> cvspring,
175 unsigned int frequency) :
213 const MPI_Comm& world,
214 const MPI_Comm& comm,
215 const std::string& path);
int sendneigh_
Neighbor to send info to.
double distance(const std::vector< double > &x, const std::vector< double > &y) const
Helper function for calculating distances.
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.
Collective variable manager.
bool TolCheck() const
Check whether tolerance criteria has been met.
std::vector< CollectiveVariable * > CVList
List of Collective Variables.
void SetSendRecvNeighbors()
Communicate neighbor lists over MPI.
String base class for FTS, Swarm, and elastic band.
std::vector< std::vector< double > > prev_velocities_
Store velocities for starting trajectories.
std::vector< double > tol_
Tolerance criteria for determining when to stop string (default 0 if no tolerance criteria) ...
std::ofstream stringout_
Output stream for string data.
Class containing a snapshot of the current simulation in time.
void GatherNeighbors(std::vector< double > *lcv0, std::vector< double > *ucv0)
Gather neighbors over MPI.
std::vector< double > centers_
CV starting location values.
uint iteration_
The global method iteration.
std::vector< double > newcenters_
CV starting location values.
Interface for Method implementations.
bool CheckEnd(const CVList &CV)
Check if method reached one of the exit criteria.
int numnodes_
Number of nodes on a string.
unsigned int maxiterator_
Maximum cap on number of string method iterations performed.
int recneigh_
Neighbor to gain info from.
std::vector< std::vector< int > > prev_IDs_
Store atom IDs for starting trajectories.
int mpiid_
The node this belongs to.
void UpdateWorldString(const CVList &cvs)
Update the world string over MPI.
void StringReparam(double alpha_star)
Reparameterize the string.
void PrintString(const CVList &CV)
Prints the CV positions to file.
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.
virtual void PostIntegration(Snapshot *snapshot, const class CVManager &cvmanager) override=0
Post-integration hook.
unsigned int iterator_
The local method iterator.
std::vector< std::vector< double > > worldstring_
The world's strings centers for each CV.
void SetTolerance(std::vector< double > tol)
Set the tolerance for quitting method.
std::vector< double > cvspring_
Vector of spring constants.
void PostSimulation(Snapshot *, const class CVManager &) override
Method call post simulation.
virtual void StringUpdate()=0
Updates the position of the string.
void PreSimulation(Snapshot *snapshot, const class CVManager &cvmanager) override
Pre-simulation hook.
virtual ~StringMethod()
Destructor.
std::vector< std::vector< double > > prev_positions_
Store positions for starting trajectories.