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);
116 virtual int init_mts(std::string
const &conf);
180 std::ostream &
write_state_data_key(std::ostream &os, std::string
const &key,
bool header =
true)
const;
187 bool header =
true)
const;
243 virtual std::ostream &
write_traj(std::ostream &os);
278 virtual const std::vector<feature *> &
features()
const
282 virtual std::vector<feature *> &modify_features()
286 static void delete_features() {
328 std::vector<int> biasing_force_scaling_factors_bin;
342 virtual int init(std::string
const &conf);
343 virtual int init_grids();
Colvar_grid derived class to hold counters in discrete n-dim colvar space.
Definition: colvargrid.h:1002
Class for accumulating the gradient of a scalar function on a grid.
Definition: colvargrid.h:1598
Class for accumulating a scalar function on a grid.
Definition: colvargrid.h:1283
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:336
std::shared_ptr< colvar_grid_count > ti_count
Histogram of sampled data.
Definition: colvarbias.h:371
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:984
virtual std::string const get_state_params() const
Write the values of specific mutable properties to a string.
Definition: colvarbias.cpp:972
std::vector< colvarvalue > ti_system_forces
Forces exerted from the system to the associated variables.
Definition: colvarbias.h:362
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:1010
virtual int update()
Definition: colvarbias.cpp:904
virtual int write_output_files()
Write any output files that this bias may have (e.g. PMF files)
Definition: colvarbias.cpp:1064
virtual int update_system_forces(std::vector< colvarvalue > const *subtract_forces)
Definition: colvarbias.cpp:910
virtual int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias.cpp:830
std::vector< int > ti_bin
Definition: colvarbias.h:375
std::string grid_conf
Grid configuration parameters (also used by grids in derived classes)
Definition: colvarbias.h:365
virtual int set_state_params(std::string const &state_conf)
Read the values of specific mutable properties from a string.
Definition: colvarbias.cpp:978
std::shared_ptr< colvar_grid_gradient > ti_avg_forces
Averaged system forces.
Definition: colvarbias.h:368
Collective variable bias, base class.
Definition: colvarbias.h:23
virtual int init_dependencies()
Initialize dependency tree.
Definition: colvarbias.cpp:180
virtual int set_state_params(std::string const &state_conf)
Read the values of specific mutable properties from a string.
Definition: colvarbias.cpp:550
virtual int change_configuration(std::string const &conf)
Load new configuration - force constant and/or centers only.
Definition: colvarbias.cpp:463
int communicate_forces()
Send forces to the collective variables.
Definition: colvarbias.cpp:420
colvarbias(colvarbias &)
Copy constructor.
bool matching_state
Flag used to tell if the state string being read is for this bias.
Definition: colvarbias.h:323
virtual int calc_energy(std::vector< colvarvalue > const *values)
Definition: colvarbias.cpp:404
cvm::step_number state_file_step
Step number read from the last state file.
Definition: colvarbias.h:320
int add_colvar(std::string const &cv_name)
Add a new collective variable to this bias.
Definition: colvarbias.cpp:339
IST & read_state_template_(IST &is)
Generic stream reading function (formatted and not)
Definition: colvarbias.cpp:602
virtual int end_of_step()
Carry out operations needed before next step is run.
Definition: colvarbias.cpp:457
virtual int write_state_to_replicas()
If this bias is communicating with other replicas through files, send it to them.
Definition: colvarbias.h:264
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:153
virtual int local_sample_count(int radius)
Return the average number of samples in a given "radius" around current bin.
Definition: colvarbias.cpp:498
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:165
virtual std::ostream & write_traj(std::ostream &os)
Output quantities such as the bias energy to the trajectory file.
Definition: colvarbias.cpp:801
cvm::real bias_energy
Current energy of this bias (colvar_forces should be obtained by deriving this)
Definition: colvarbias.h:310
size_t num_variables() const
How many variables are defined for this bias.
Definition: colvarbias.h:42
virtual int init_mts(std::string const &conf)
Initialize multiple-time-stepping options.
Definition: colvarbias.cpp:149
virtual int calc_forces(std::vector< colvarvalue > const *values)
Definition: colvarbias.cpp:411
int read_state_prefix(std::string const &prefix)
Read the bias state from a file with this name or prefix.
Definition: colvarbias.cpp:704
int write_state_prefix(std::string const &prefix)
Write the bias state to a file with the given prefix.
Definition: colvarbias.cpp:675
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:525
virtual int clear_state_data()
Delete only the allocatable data (save memory)
Definition: colvarbias.cpp:332
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:171
virtual int current_bin()
Calculate the bin index for a given bias.
Definition: colvarbias.cpp:486
virtual int bin_num()
Give the total number of bins for a given bias.
Definition: colvarbias.cpp:480
virtual std::string const get_state_params() const
Write the values of specific mutable properties to a string.
Definition: colvarbias.cpp:516
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:159
virtual int write_output_files()
Write any output files that this bias may have (e.g. PMF files)
Definition: colvarbias.h:255
virtual cvm::real energy_difference(std::string const &conf)
Calculate change in energy from using alternate configuration.
Definition: colvarbias.cpp:471
colvar * variables(int i) const
Access the i-th variable.
Definition: colvarbias.h:54
virtual bool can_accumulate_data()
Definition: colvarbias.cpp:393
std::vector< colvarvalue > previous_colvar_forces
Forces last applied by this bias to the variables.
Definition: colvarbias.h:307
std::istream & read_state(std::istream &is)
Read the bias configuration from a formatted stream.
Definition: colvarbias.cpp:663
size_t output_freq
Frequency for writing output files.
Definition: colvarbias.h:252
std::vector< colvarvalue > colvar_values
Up to date value of each colvar.
Definition: colvarbias.h:301
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:278
std::vector< colvar * > colvars
Pointers to collective variables to which the bias is applied; current values and metric functions wi...
Definition: colvarbias.h:298
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:317
virtual std::ostream & write_traj_label(std::ostream &os)
Write a label to the trajectory file (comment line)
Definition: colvarbias.cpp:791
virtual int setup_output()
(Re)initialize the output files (does not write them yet)
Definition: colvarbias.h:246
colvarbias()
Default constructor.
Definition: colvarbias.cpp:280
std::ostream & write_state(std::ostream &os)
Write the bias configuration to a formatted stream.
Definition: colvarbias.cpp:559
std::ostream & write_state_data_key(std::ostream &os, std::string const &key, bool header=true) const
Definition: colvarbias.cpp:745
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:762
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:692
int read_state_string(char const *buffer)
Read the bias state from this string buffer.
Definition: colvarbias.cpp:722
std::string bias_type
Keyword indicating the type of this bias.
Definition: colvarbias.h:30
virtual int clear()
Delete everything.
Definition: colvarbias.cpp:291
bool b_output_energy
Whether to write the current bias energy from this bias to the trajectory file.
Definition: colvarbias.h:313
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:304
std::istream & read_state_data_key(std::istream &is, std::string const &key)
Definition: colvarbias.cpp:779
virtual ~colvarbias()
Destructor.
Definition: colvarbias.cpp:285
virtual int update()
Definition: colvarbias.cpp:371
virtual size_t replica_share_freq() const
Report the frequency at which this bias needs to communicate with replicas.
Definition: colvarbias.cpp:510
virtual int reset()
Set to zero all mutable data.
Definition: colvarbias.cpp:270
static std::vector< feature * > cvb_features
Implementation of the feature list for colvarbias.
Definition: colvarbias.h:275
std::string output_prefix
Use this prefix for all output files.
Definition: colvarbias.h:261
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:327
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:150
long long step_number
Use a 64-bit integer to store the step number.
Definition: colvarmodule.h:147
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.