28 #include "Grids/Grid.h"
62 std::vector<Grid<double>*>
F_;
213 ABF(
const MPI_Comm& world,
214 const MPI_Comm& comm,
219 std::vector<std::vector<double>> restraint,
220 std::vector<bool> isperiodic,
221 std::vector<std::vector<double>> periodicboundaries,
224 std::string filename,
225 std::string Nworld_filename,
226 std::string Fworld_filename,
227 const std::vector<std::vector<double>>& histdetails,
231 unsigned int frequency) :
232 Method(frequency, world, comm),
N_(N),
Nworld_(Nworld),
F_(F),
Fworld_(Fworld),
restraint_(restraint),
isperiodic_(isperiodic),
periodicboundaries_(periodicboundaries),
260 static ABF*
Build(
const Json::Value& json,
261 const MPI_Comm& world,
262 const MPI_Comm& comm,
263 const std::string& path);
Adaptive Biasing Force Algorithm.
double unitconv_
Unit Conversion Constant from W dot P to Force.
Eigen::VectorXd Fold_
To hold last iterations F_ value for removing bias.
void PostSimulation(Snapshot *snapshot, const class CVManager &cvmanager) override
Method call prior to simulation initiation.
std::vector< std::vector< double > > histdetails_
Histogram details.
Eigen::VectorXd wdotp2_
To hold second to last iteration wdotp value for numerical derivative.
void PreSimulation(Snapshot *snapshot, const class CVManager &cvmanager) override
Method call prior to simulation initiation.
double timestep_
Timestep of integration.
Grid< int > * N_
To store number of local hits at a given CV bin.
std::vector< Grid< double > * > F_
To store running total of the local walker.
std::string Nworld_filename_
Nworld print out filename, for restarts.
std::ofstream worldout_
Output stream for F/N world data.
ABF(const MPI_Comm &world, const MPI_Comm &comm, Grid< int > *N, Grid< int > *Nworld, std::vector< Grid< double > * > F, std::vector< Grid< double > * > Fworld, std::vector< std::vector< double >> restraint, std::vector< bool > isperiodic, std::vector< std::vector< double >> periodicboundaries, double min, bool massweigh, std::string filename, std::string Nworld_filename, std::string Fworld_filename, const std::vector< std::vector< double >> &histdetails, int FBackupInterv, double unitconv, double timestep, unsigned int frequency)
Constructor.
Eigen::VectorXd wdotp1_
To hold last iteration wdotp value for numerical derivative.
std::vector< Grid< double > * > Fworld_
Will hold the global total, synced across walkers at every time step.
std::vector< std::vector< double > > restraint_
Information for a harmonic restraint to keep CV in the region of interest.
std::vector< std::vector< double > > periodicboundaries_
Holds periodic boundaries of CVs.
unsigned int dim_
Number of CVs in system.
static ABF * Build(const Json::Value &json, const MPI_Comm &world, const MPI_Comm &comm, const std::string &path)
Build a derived method from JSON node.
void CalcBiasForce(const Snapshot *snapshot, const CVList &cvs, const std::vector< double > &cvVals)
Computes the bias force.
unsigned int iteration_
Iteration counter.
std::vector< bool > isperiodic_
For each CV, holds whether that CV has periodic boundaries or not.
bool massweigh_
Mass weighing of bias enabled/disabled.
void WriteData()
Writes out data to file.
void SetIteration(const int iter)
Set iteration of the method.
Eigen::VectorXd mass_
Mass vector. Empty unless required.
int FBackupInterv_
Integer to hold F estimate backup information.
void PostIntegration(Snapshot *snapshot, const class CVManager &cvmanager) override
Method call post integration.
bool boundsCheck(const std::vector< double > &CVs)
Checks whether the local walker is within CV bounds.
Grid< int > * Nworld_
To store number of global hits at a given CV bin.
std::vector< Vector3 > biases_
Biases applied to atoms each timestep.
std::string Fworld_filename_
Fworld print out filename, for restarts.
Collective variable manager.
Interface for Method implementations.
Class containing a snapshot of the current simulation in time.
std::vector< CollectiveVariable * > CVList
List of Collective Variables.