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