17#include "colvardeps.h"
70 virtual int calc_energy(std::vector<colvarvalue>
const *values);
75 virtual int calc_forces(std::vector<colvarvalue>
const *values);
96 virtual int bin_count(
int bin_index);
101 virtual int replica_share();
113 virtual int init(std::string
const &conf);
177 std::ostream &
write_state_data_key(std::ostream &os, std::string
const &key,
bool header =
true)
const;
184 bool header =
true)
const;
240 virtual std::ostream &
write_traj(std::ostream &os);
275 virtual const std::vector<feature *> &
features()
const
279 virtual std::vector<feature *> &modify_features()
283 static void delete_features() {
325 std::vector<int> biasing_force_scaling_factors_bin;
339 virtual int init(std::string
const &conf);
340 virtual int init_grids();
Colvar_grid derived class to hold counters in discrete n-dim colvar space.
Definition: colvargrid.h:959
Class for accumulating the gradient of a scalar function on a grid.
Definition: colvargrid.h:1555
Class for accumulating a scalar function on a grid.
Definition: colvargrid.h:1242
A collective variable (main class); to be defined, it needs at least one object of a derived class of...
Definition: colvar.h:53
Base class for unconstrained thermodynamic-integration FE estimator.
Definition: colvarbias.h:333
std::shared_ptr< colvar_grid_count > ti_count
Histogram of sampled data.
Definition: colvarbias.h:365
virtual std::ostream & write_state_data(std::ostream &os)
Write all mutable data not already written by get_state_params() to a formatted stream.
Definition: colvarbias.cpp:935
virtual std::string const get_state_params() const
Write the values of specific mutable properties to a string.
Definition: colvarbias.cpp:923
std::vector< colvarvalue > ti_system_forces
Forces exerted from the system to the associated variables.
Definition: colvarbias.h:359
virtual std::istream & read_state_data(std::istream &is)
Read all mutable data not already set by set_state_params() from a formatted stream.
Definition: colvarbias.cpp:961
virtual int update()
Definition: colvarbias.cpp:864
virtual int write_output_files()
Write any output files that this bias may have (e.g. PMF files)
Definition: colvarbias.cpp:1015
virtual int update_system_forces(std::vector< colvarvalue > const *subtract_forces)
Definition: colvarbias.cpp:870
virtual int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias.cpp:791
std::vector< int > ti_bin
Definition: colvarbias.h:369
virtual int set_state_params(std::string const &state_conf)
Read the values of specific mutable properties from a string.
Definition: colvarbias.cpp:929
std::shared_ptr< colvar_grid_gradient > ti_avg_forces
Averaged system forces.
Definition: colvarbias.h:362
Collective variable bias, base class.
Definition: colvarbias.h:23
virtual int init_dependencies()
Initialize dependency tree.
Definition: colvarbias.cpp:144
virtual int set_state_params(std::string const &state_conf)
Read the values of specific mutable properties from a string.
Definition: colvarbias.cpp:511
virtual int change_configuration(std::string const &conf)
Load new configuration - force constant and/or centers only.
Definition: colvarbias.cpp:424
int communicate_forces()
Send forces to the collective variables.
Definition: colvarbias.cpp:381
colvarbias(colvarbias &)
Copy constructor.
bool matching_state
Flag used to tell if the state string being read is for this bias.
Definition: colvarbias.h:320
virtual int calc_energy(std::vector< colvarvalue > const *values)
Definition: colvarbias.cpp:365
cvm::step_number state_file_step
Step number read from the last state file.
Definition: colvarbias.h:317
int add_colvar(std::string const &cv_name)
Add a new collective variable to this bias.
Definition: colvarbias.cpp:300
IST & read_state_template_(IST &is)
Generic stream reading function (formatted and not)
Definition: colvarbias.cpp:563
virtual int end_of_step()
Carry out operations needed before next step is run.
Definition: colvarbias.cpp:418
virtual int write_state_to_replicas()
If this bias is communicating with other replicas through files, send it to them.
Definition: colvarbias.h:261
virtual std::ostream & write_state_data(std::ostream &os)
Write all mutable data not already written by get_state_params() to a formatted stream.
Definition: colvarbias.h:150
virtual int local_sample_count(int radius)
Return the average number of samples in a given "radius" around current bin.
Definition: colvarbias.cpp:459
virtual std::istream & read_state_data(std::istream &is)
Read all mutable data not already set by set_state_params() from a formatted stream.
Definition: colvarbias.h:162
virtual std::ostream & write_traj(std::ostream &os)
Output quantities such as the bias energy to the trajectory file.
Definition: colvarbias.cpp:762
cvm::real bias_energy
Current energy of this bias (colvar_forces should be obtained by deriving this)
Definition: colvarbias.h:307
size_t num_variables() const
How many variables are defined for this bias.
Definition: colvarbias.h:42
virtual int calc_forces(std::vector< colvarvalue > const *values)
Definition: colvarbias.cpp:372
int read_state_prefix(std::string const &prefix)
Read the bias state from a file with this name or prefix.
Definition: colvarbias.cpp:665
int write_state_prefix(std::string const &prefix)
Write the bias state to a file with the given prefix.
Definition: colvarbias.cpp:636
int check_matching_state(std::string const &conf)
Check the name of the bias vs. the given string, set the matching_state flag accordingly.
Definition: colvarbias.cpp:486
virtual int clear_state_data()
Delete only the allocatable data (save memory)
Definition: colvarbias.cpp:293
virtual cvm::memory_stream & read_state_data(cvm::memory_stream &is)
Read all mutable data not already set by set_state_params() from an unformatted stream.
Definition: colvarbias.h:168
virtual int current_bin()
Calculate the bin index for a given bias.
Definition: colvarbias.cpp:447
virtual int bin_num()
Give the total number of bins for a given bias.
Definition: colvarbias.cpp:441
virtual std::string const get_state_params() const
Write the values of specific mutable properties to a string.
Definition: colvarbias.cpp:477
virtual cvm::memory_stream & write_state_data(cvm::memory_stream &os)
Write all mutable data not already written by get_state_params() to an unformatted stream.
Definition: colvarbias.h:156
virtual int write_output_files()
Write any output files that this bias may have (e.g. PMF files)
Definition: colvarbias.h:252
virtual cvm::real energy_difference(std::string const &conf)
Calculate change in energy from using alternate configuration.
Definition: colvarbias.cpp:432
colvar * variables(int i) const
Access the i-th variable.
Definition: colvarbias.h:54
virtual bool can_accumulate_data()
Definition: colvarbias.cpp:354
std::vector< colvarvalue > previous_colvar_forces
Forces last applied by this bias to the variables.
Definition: colvarbias.h:304
std::istream & read_state(std::istream &is)
Read the bias configuration from a formatted stream.
Definition: colvarbias.cpp:624
size_t output_freq
Frequency for writing output files.
Definition: colvarbias.h:249
std::vector< colvarvalue > colvar_values
Up to date value of each colvar.
Definition: colvarbias.h:298
virtual void analyze()
Perform analysis tasks.
Definition: colvarbias.h:107
virtual const std::vector< feature * > & features() const
Implementation of the feature list accessor for colvarbias.
Definition: colvarbias.h:275
std::vector< colvar * > colvars
Pointers to collective variables to which the bias is applied; current values and metric functions wi...
Definition: colvarbias.h:295
std::string name
Name of this bias.
Definition: colvarbias.h:27
bool has_data
Whether this bias has already accumulated information (for history-dependent biases)
Definition: colvarbias.h:314
virtual std::ostream & write_traj_label(std::ostream &os)
Write a label to the trajectory file (comment line)
Definition: colvarbias.cpp:752
virtual int setup_output()
(Re)initialize the output files (does not write them yet)
Definition: colvarbias.h:243
colvarbias()
Default constructor.
Definition: colvarbias.cpp:241
std::ostream & write_state(std::ostream &os)
Write the bias configuration to a formatted stream.
Definition: colvarbias.cpp:520
std::ostream & write_state_data_key(std::ostream &os, std::string const &key, bool header=true) const
Definition: colvarbias.cpp:706
std::vector< colvar * > * variables()
Access the variables vector.
Definition: colvarbias.h:48
IST & read_state_data_key_template_(IST &is, std::string const &key)
Definition: colvarbias.cpp:723
std::string state_keyword
Keyword used in state files (== bias_type most of the time)
Definition: colvarbias.h:33
virtual int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias.cpp:44
int write_state_string(std::string &output)
Write the bias state to a string.
Definition: colvarbias.cpp:653
int read_state_string(char const *buffer)
Read the bias state from this string buffer.
Definition: colvarbias.cpp:683
std::string bias_type
Keyword indicating the type of this bias.
Definition: colvarbias.h:30
virtual int clear()
Delete everything.
Definition: colvarbias.cpp:252
bool b_output_energy
Whether to write the current bias energy from this bias to the trajectory file.
Definition: colvarbias.h:310
int rank
Track how many times a bias of this type was defined.
Definition: colvarbias.h:36
std::vector< colvarvalue > colvar_forces
Current forces from this bias to the variables.
Definition: colvarbias.h:301
std::istream & read_state_data_key(std::istream &is, std::string const &key)
Definition: colvarbias.cpp:740
virtual ~colvarbias()
Destructor.
Definition: colvarbias.cpp:246
virtual int update()
Definition: colvarbias.cpp:332
virtual size_t replica_share_freq() const
Report the frequency at which this bias needs to communicate with replicas.
Definition: colvarbias.cpp:471
virtual int reset()
Set to zero all mutable data.
Definition: colvarbias.cpp:231
static std::vector< feature * > cvb_features
Implementation of the feature list for colvarbias.
Definition: colvarbias.h:272
std::string output_prefix
Use this prefix for all output files.
Definition: colvarbias.h:258
colvar_grid_scalar * biasing_force_scaling_factors
The biasing forces will be scaled by the factor in this grid if b_bias_force_scaled is true.
Definition: colvarbias.h:324
Parent class for a member object of a bias, cv or cvc etc. containing features and their dependencies...
Definition: colvardeps.h:34
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
Base class containing parsing functions; all objects which need to parse input inherit from this.
Definition: colvarparse.h:27
Definition: colvars_memstream.h:30
Parsing functions for collective variables.