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)
64 for(
size_t i = 0; i <
prev_IDs_[0].size(); i++)
78 cv->Evaluate(*snapshot);
106 for(
size_t i = 0; i < cvs.size(); i++)
110 auto& grad = cv->GetGradient();
116 for(
size_t j = 0; j < forces.size(); j++)
117 forces[j] -= D*grad[j];
138 for(
auto& force : forces)
143 for(
size_t i = 0; i <
prev_IDs_[0].size(); i++)
172 for(
size_t i = 0; i <
centers_.size(); i++)
206 std::vector<double> lcv0, ucv0;
213 for(
size_t i = 0; i <
centers_.size(); i++)
Collective variable manager.
CVList GetCVs(const std::vector< unsigned int > &mask=std::vector< unsigned int >()) const
Get CV iterator.
unsigned int min_num_umbrella_steps_
Minimum number of steps to apply umbrella sampling.
unsigned int blockiterations_
Number of steps to block average the CV's postions over.
double tau_
Time step of string change.
std::vector< double > prev_CVs_
Stores the last positions of the CVs.
bool InCell(const CVList &cvs) const
Checks if CV is in Voronoi cell.
void PostIntegration(Snapshot *snapshot, const class CVManager &cvmanager) override
Method call post integration.
bool reset_for_umbrella
Flag for whether a system was to run umbrella sampling before checking against other systems.
int run_umbrella_
Flag to run umbrella or not during post-integration.
double kappa_
String modification parameter.
unsigned int umbrella_iter_
Iterator that keeps track of umbrella iterations.
void StringUpdate() override
Updates the string according to the FTS method.
std::vector< unsigned int > cvmask_
Mask which identifies which CVs to act on.
mxx::comm world_
Global MPI communicator.
Class containing a snapshot of the current simulation in time.
const std::vector< Vector3 > & GetForces() const
Access the per-particle forces.
std::vector< int > SerializeIDs()
Return the serialized IDs across all local cores.
int GetLocalIndex(int id) const
Gets the local atom index corresponding to an atom ID.
const std::vector< Vector3 > & GetPositions() const
Access the particle positions.
std::vector< double > SerializePositions()
Return the serialized positions across all local cores.
std::vector< std::vector< double > > worldstring_
The world's strings centers for each CV.
int mpiid_
The node this belongs to.
std::vector< double > cvspring_
Vector of spring constants.
void UpdateWorldString(const CVList &cvs)
Update the world string over MPI.
std::vector< double > centers_
CV starting location values.
bool CheckEnd(const CVList &CV)
Check if method reached one of the exit criteria.
unsigned int iteration_
The global method iteration.
void PrintString(const CVList &CV)
Prints the CV positions to file.
double distance(const std::vector< double > &x, const std::vector< double > &y) const
Helper function for calculating distances.
void GatherNeighbors(std::vector< double > *lcv0, std::vector< double > *ucv0)
Gather neighbors over MPI.
std::vector< std::vector< double > > prev_positions_
Store positions for starting trajectories.
std::vector< std::vector< int > > prev_IDs_
Store atom IDs for starting trajectories.
int numnodes_
Number of nodes on a string.
unsigned int iterator_
The local method iterator.
std::vector< double > newcenters_
CV starting location values.
void StringReparam(double alpha_star)
Reparameterize the string.
std::vector< CollectiveVariable * > CVList
List of Collective Variables.