10#ifndef COLVARBIAS_ABF_H
11#define COLVARBIAS_ABF_H
20#include "colvarbias.h"
21#include "colvargrid.h"
22#include "colvar_UIestimator.h"
35 int init(std::string
const &conf)
override;
104 std::shared_ptr<integrate_potential>
pmf;
129 int replica_share()
override;
132 int replica_share_CZAR();
138 std::unique_ptr<colvar_grid_gradient> last_gradients;
139 std::shared_ptr<colvar_grid_count> last_samples;
141 std::unique_ptr<colvar_grid_gradient> z_gradients_in;
142 std::shared_ptr<colvar_grid_count> z_samples_in;
144 std::shared_ptr<colvar_grid_gradient> local_gradients;
145 std::shared_ptr<colvar_grid_count> local_samples;
146 std::unique_ptr<integrate_potential> local_pmf;
149 std::shared_ptr<colvar_grid_gradient> global_z_gradients;
150 std::shared_ptr<colvar_grid_count> global_z_samples;
151 std::shared_ptr<colvar_grid_gradient> global_czar_gradients;
152 std::shared_ptr<integrate_potential> global_czar_pmf;
174 std::string
const &
name,
198 int calc_energy(std::vector<colvarvalue>
const *values)
override;
Definition: colvar_UIestimator.h:215
ABF bias.
Definition: colvarbias_abf.h:28
std::shared_ptr< colvar_grid_count > samples
n-dim grid of number of samples
Definition: colvarbias_abf.h:102
int calc_biasing_force(std::vector< cvm::real > &force)
Calulate the biasing force for the current bin.
Definition: colvarbias_abf.cpp:487
int local_sample_count(int radius) override
Return the average number of samples in a given "radius" around current bin.
int current_bin() override
Calculate the bin index for a given bias.
Definition: colvarbias_abf.cpp:853
int pabf_integrate_iterations
Max number of CG iterations for integrating PMF at on-the-fly pABF updates.
Definition: colvarbias_abf.h:78
int init(std::string const &conf) override
Initializer for ABF bias.
Definition: colvarbias_abf.cpp:27
bool b_CZAR_estimator
Run CZAR estimator?
Definition: colvarbias_abf.h:69
std::vector< cvm::real > max_force
Maximum force to be applied.
Definition: colvarbias_abf.h:85
bool cap_force
Cap the biasing force to be applied? (option maxForce)
Definition: colvarbias_abf.h:83
int write_grid_to_file(T const *grid, std::string const &name, bool close)
Shorthand template used in write_gradient_samples()
Definition: colvarbias_abf.cpp:730
size_t replica_share_freq() const override
Report the frequency at which this bias needs to communicate with replicas.
Definition: colvarbias_abf.cpp:724
std::vector< int > z_bin
Cuurent bin in "actual" coordinate, when running extended Lagrangian dynamics.
Definition: colvarbias_abf.h:94
bool b_czar_window_file
Write CZAR output file for stratified eABF (.zgrad)
Definition: colvarbias_abf.h:61
std::vector< std::string > input_prefix
Base filename(s) for reading previous gradient data (replaces data from restart file)
Definition: colvarbias_abf.h:44
int bin_num() override
Give the total number of bins for a given bias.
Definition: colvarbias_abf.cpp:848
int update_system_force()
Calculate system force for all colvars.
Definition: colvarbias_abf.cpp:455
OST & write_state_data_template_(OST &os)
Generic stream writing function (formatted and not)
Definition: colvarbias_abf.cpp:917
std::shared_ptr< colvar_grid_gradient > z_gradients
n-dim grid: average force on "real" coordinate for eABF z-based estimator
Definition: colvarbias_abf.h:106
int read_gradients_samples()
Read human-readable FE gradients and sample count (if not using restart)
Definition: colvarbias_abf.cpp:871
bool b_integrate
Integrate gradients into a PMF on output.
Definition: colvarbias_abf.h:52
std::shared_ptr< integrate_potential > pmf
n-dim grid of pmf (dimension 1 to 3)
Definition: colvarbias_abf.h:104
cvm::real integrate_tol
Tolerance for integrating PMF at startup and for file output.
Definition: colvarbias_abf.h:76
std::shared_ptr< colvar_grid_gradient > gradients
n-dim grid of free energy gradients
Definition: colvarbias_abf.h:100
size_t full_samples
Number of samples per bin before applying the full biasing force.
Definition: colvarbias_abf.h:55
std::ostream & write_state_data(std::ostream &os) override
Write all mutable data not already written by get_state_params() to a formatted stream.
Definition: colvarbias_abf.cpp:949
cvm::step_number history_last_step
Latest absolute time step at which history files were written.
Definition: colvarbias_abf.h:59
std::vector< int > force_bin
Current bin in force grid.
Definition: colvarbias_abf.h:92
gradient_t system_force
Measured instantaneous system force.
Definition: colvarbias_abf.h:97
int update() override
Per-timestep update of ABF bias.
Definition: colvarbias_abf.cpp:317
cvm::real smoothing_factor(cvm::real weight)
Calulate the smoothing factor to apply to biasing forces for given local count.
Definition: colvarbias_abf.cpp:473
bool update_bias
Adapt the bias at each time step (as opposed to keeping it constant)?
Definition: colvarbias_abf.h:47
int bin_count(int bin_index) override
Give the count at a given bin index.
Definition: colvarbias_abf.cpp:858
cvm::real pabf_integrate_tol
Tolerance for integrating PMF at on-the-fly pABF updates.
Definition: colvarbias_abf.h:80
bool b_UI_estimator
Run UI estimator?
Definition: colvarbias_abf.h:67
std::vector< int > bin
Current bin in sample grid.
Definition: colvarbias_abf.h:90
size_t history_freq
Number of timesteps between recording data in history files (if non-zero)
Definition: colvarbias_abf.h:63
std::shared_ptr< colvar_grid_count > z_samples
n-dim grid of number of samples on "real" coordinate for eABF z-based estimator
Definition: colvarbias_abf.h:108
std::istream & read_state_data(std::istream &is) override
Read all mutable data not already set by set_state_params() from a formatted stream.
Definition: colvarbias_abf.cpp:1029
std::shared_ptr< integrate_potential > czar_pmf
n-dim grid of CZAR pmf (dimension 1 to 3)
Definition: colvarbias_abf.h:112
IST & read_state_data_template_(IST &is)
Generic stream readingx function (formatted and not)
Definition: colvarbias_abf.cpp:961
int integrate_iterations
Max number of CG iterations for integrating PMF at startup and for file output.
Definition: colvarbias_abf.h:74
int write_output_files() override
Write any output files that this bias may have (e.g. PMF files)
Definition: colvarbias_abf.cpp:1041
UIestimator::UIestimator eabf_UI
Umbrella Integration estimator of free energy from eABF.
Definition: colvarbias_abf.h:65
void write_gradients_samples(const std::string &prefix, bool close=true, bool local=false)
Definition: colvarbias_abf.cpp:769
std::shared_ptr< colvar_grid_gradient > czar_gradients
n-dim grid containing CZAR estimatr of "real" free energy gradients
Definition: colvarbias_abf.h:110
int pabf_freq
Frequency for updating pABF PMF (if zero, pABF is not used)
Definition: colvarbias_abf.h:72
size_t min_samples
Number of samples per bin before applying a scaled-down biasing force.
Definition: colvarbias_abf.h:57
~colvarbias_abf() override
Default destructor for ABF bias.
Definition: colvarbias_abf.cpp:309
bool hide_Jacobian
Definition: colvarbias_abf.h:50
int calc_energy(std::vector< colvarvalue > const *values) override
Calculate the bias energy for 1D ABF.
Definition: colvarbias_abf.cpp:1085
Collective variable bias, base class.
Definition: colvarbias.h:23
std::string name
Name of this bias.
Definition: colvarbias.h:27
double real
Defining an abstract real number allows to switch precision.
Definition: colvarmodule.h:95
long long step_number
Use a 64-bit integer to store the step number.
Definition: colvarmodule.h:92
Definition: colvars_memstream.h:30