21 #include "ElasticBand.h"
22 #include "CVs/CVManager.h"
36 for(
size_t i = 0; i < cvs.size(); ++i)
40 auto& grad = cv->GetGradient();
43 auto diff = cv->GetDifference(
centers_[i]);
47 for(
size_t j = 0; j < forces.size(); ++j)
48 for(
int k = 0; k < forces[j].size(); ++k)
49 forces[j][k] -= D*grad[j][k];
83 double dot = 0, norm = 0, lnorm = 0, unorm = 0;
84 std::vector<double> lcv0, ucv0, tngt, ltngt, utngt;
94 for(
size_t ii = 0; ii <
centers_.size(); ii++)
99 unorm += utngt[ii]*utngt[ii];
100 lnorm += ltngt[ii]*ltngt[ii];
106 for(
size_t ii = 0; ii<
centers_.size(); ii++)
108 tngt[ii] = ltngt[ii]/lnorm + utngt[ii]/unorm;
109 norm += tngt[ii]*tngt[ii];
114 for(
size_t ii = 0; ii <
centers_.size(); ii++) {
122 for(
size_t ii = 0; ii <
centers_.size(); ii++)
Collective variable manager.
CVList GetCVs(const std::vector< unsigned int > &mask=std::vector< unsigned int >()) const
Get CV iterator.
void StringUpdate() override
Updates the nudged elastic band string.
unsigned int equilibrate_
unsigned int nsampled_
Number samples actually sampled.
double stringspring_
String spring constant.
double tau_
Time step of string change.
void PostIntegration(Snapshot *snapshot, const class CVManager &cvmanager) override
Post-integration hook.
unsigned int nsamples_
Block iterations.
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.
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.
void GatherNeighbors(std::vector< double > *lcv0, std::vector< double > *ucv0)
Gather neighbors over MPI.
unsigned int iterator_
The local method iterator.
std::vector< double > newcenters_
CV starting location values.