21 #include "FiniteTempString.h"
22 #include "CVs/CVManager.h"
38 for(
size_t j = 0; j < cvs.size(); j++)
39 dists[i]+= pow(cvs[j]->GetDifference(
worldstring_[i][j]),2);
41 if(std::min_element(dists.begin(), dists.end()) - dists.begin() ==
mpiid_)
57 for(
auto& force : forces)
65 for(
size_t i = 0; i <
prev_IDs_[0].size(); i++)
79 cv->Evaluate(*snapshot);
104 for(
size_t i = 0; i < cvs.size(); i++)
108 auto& grad = cv->GetGradient();
114 for(
size_t j = 0; j < forces.size(); j++)
115 forces[j] -= D*grad[j];
133 for(
auto& force : forces)
139 for(
size_t i = 0; i <
prev_IDs_[0].size(); i++)
167 for(
size_t i = 0; i <
centers_.size(); i++)
201 std::vector<double> lcv0, ucv0;
208 for(
size_t i = 0; i <
centers_.size(); i++)
double distance(const std::vector< double > &x, const std::vector< double > &y) const
Helper function for calculating distances.
Collective variable manager.
bool InCell(const CVList &cvs) const
Checks if CV is in voronoi cell.
int run_umbrella_
Flag to run umbrella or not during post-integration.
void PostIntegration(Snapshot *snapshot, const class CVManager &cvmanager) override
Post-integration hook.
std::vector< CollectiveVariable * > CVList
List of Collective Variables.
unsigned int min_num_umbrella_steps_
Minimum number of steps to apply umbrella sampling.
void StringUpdate()
Updates the string according to the FTS method.
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.
std::vector< double > SerializePositions()
Return the serialized positions across all local cores.
mxx::comm world_
Global MPI communicator.
unsigned int blockiterations_
Number of steps to block average the CV's postions over.
bool CheckEnd(const CVList &CV)
Check if method reached one of the exit criteria.
int numnodes_
Number of nodes on a string.
std::vector< int > SerializeIDs()
Return the serialized positions across all local cores.
int GetLocalIndex(int id) const
Gets the local atom index corresponding to an atom ID.
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.
const Label & GetAtomIDs() const
Access the atom IDs.
void StringReparam(double alpha_star)
Reparameterize the string.
std::vector< CollectiveVariable * > GetCVs(const std::vector< uint > &mask=std::vector< uint >()) const
Get CV iterator.
void PrintString(const CVList &CV)
Prints the CV positions to file.
unsigned int iterator_
The local method iterator.
std::vector< std::vector< double > > worldstring_
The world's strings centers for each CV.
double tau_
Time step of string change.
std::vector< double > cvspring_
Vector of spring constants.
std::vector< double > prev_CVs_
Stores the last positions of the CVs.
std::vector< uint > cvmask_
Mask which identifies which CVs to act on.
bool reset_for_umbrella
Flag for whether a system was to run umbrella sampling before checking against other systems...
unsigned int umbrella_iter_
Iterator that keeps track of umbrella iterations.
const std::vector< Vector3 > & GetForces() const
Access the per-particle forces.
const std::vector< Vector3 > & GetPositions() const
Access the particle positions.
std::vector< std::vector< double > > prev_positions_
Store positions for starting trajectories.
double kappa_
String modification parameter.