#include <colvarbias.h>
Inheritance diagram for colvarbias:
Public Methods | |||||
int | add_colvar (std::string const &cv_name) | ||||
Add a new collective variable to this bias. More... | |||||
size_t | num_variables () const | ||||
How many variables are defined for this bias. More... | |||||
std::vector< colvar * > * | variables () | ||||
Access the variables vector. More... | |||||
colvar * | variables (int i) const | ||||
Access the i-th variable. More... | |||||
virtual int | update () | ||||
Retrieve colvar values and calculate their biasing forces Some implementations may use calc_energy() and calc_forces(). More... | |||||
virtual bool | can_accumulate_data () | ||||
Returns true if the current step represent a valid increment, whose data can be recorded (as opposed to e.g. a continuation step from a restart). More... | |||||
virtual int | calc_energy (std::vector< colvarvalue > const *values) | ||||
Compute the energy of the bias Uses the vector of colvar values provided if not NULL, and the values currently cached in the bias instance otherwise. More... | |||||
virtual int | calc_forces (std::vector< colvarvalue > const *values) | ||||
Compute the forces due to the bias Uses the vector of colvar values provided if not NULL, and the values currently cached in the bias instance otherwise. More... | |||||
int | communicate_forces () | ||||
Send forces to the collective variables. More... | |||||
virtual int | end_of_step () | ||||
Carry out operations needed before next step is run. More... | |||||
virtual int | change_configuration (std::string const &conf) | ||||
Load new configuration - force constant and/or centers only. More... | |||||
virtual cvm::real | energy_difference (std::string const &conf) | ||||
Calculate change in energy from using alternate configuration. More... | |||||
virtual int | bin_num () | ||||
Give the total number of bins for a given bias. More... | |||||
virtual int | current_bin () | ||||
Calculate the bin index for a given bias. More... | |||||
virtual int | bin_count (int bin_index) | ||||
virtual int | replica_share () | ||||
virtual void | analyze () | ||||
Perform analysis tasks. More... | |||||
colvarbias (char const *key) | |||||
\brief Constructor. More... | |||||
virtual int | init (std::string const &conf) | ||||
\brief Parse config string and (re)initialize. More... | |||||
virtual int | init_dependencies () | ||||
\brief Initialize dependency tree. More... | |||||
virtual int | reset () | ||||
\brief Set to zero all mutable data. More... | |||||
virtual int | clear () | ||||
\brief Delete everything. More... | |||||
virtual int | clear_state_data () | ||||
\brief Delete only the allocatable data (save memory). More... | |||||
virtual | ~colvarbias () | ||||
Destructor. More... | |||||
virtual std::string const | get_state_params () const | ||||
Write the values of specific mutable properties to a string. More... | |||||
virtual int | set_state_params (std::string const &state_conf) | ||||
Read the values of specific mutable properties from a string. More... | |||||
virtual std::ostream & | write_state_data (std::ostream &os) | ||||
Write all mutable data not already written by get_state_params(). More... | |||||
virtual std::istream & | read_state_data (std::istream &is) | ||||
Read all mutable data not already set by set_state_params(). More... | |||||
std::istream & | read_state_data_key (std::istream &is, char const *key) | ||||
Read a keyword from the state data (typically a header)
| |||||
std::ostream & | write_state (std::ostream &os) | ||||
Write the bias configuration to a state file or other stream. More... | |||||
std::istream & | read_state (std::istream &is) | ||||
Read the bias configuration from a restart file or other stream. More... | |||||
int | write_state_prefix (std::string const &prefix) | ||||
Write the bias state to a file with the given prefix. More... | |||||
int | write_state_string (std::string &output) | ||||
Write the bias state to a string. More... | |||||
int | read_state_prefix (std::string const &prefix) | ||||
Read the bias state from a file with this name or prefix. More... | |||||
int | read_state_string (char const *buffer) | ||||
Read the bias state from this string buffer. More... | |||||
virtual std::ostream & | write_traj_label (std::ostream &os) | ||||
Write a label to the trajectory file (comment line). More... | |||||
virtual std::ostream & | write_traj (std::ostream &os) | ||||
Output quantities such as the bias energy to the trajectory file. More... | |||||
virtual int | setup_output () | ||||
(Re)initialize the output files (does not write them yet). More... | |||||
virtual int | write_output_files () | ||||
Write any output files that this bias may have (e.g. PMF files). More... | |||||
virtual int | write_state_to_replicas () | ||||
If this bias is communicating with other replicas through files, send it to them. More... | |||||
cvm::real | get_energy () | ||||
virtual const std::vector< feature * > & | features () const | ||||
\brief Implementation of the feature list accessor for colvarbias. More... | |||||
virtual std::vector< feature * > & | modify_features () | ||||
Static Public Methods | |||||
void | delete_features () | ||||
Public Attributes | |||||
std::string | name | ||||
Name of this bias. More... | |||||
std::string | bias_type | ||||
Keyword indicating the type of this bias. More... | |||||
std::string | state_keyword | ||||
Keyword used in state files (== bias_type most of the time). More... | |||||
int | rank | ||||
Track how many times a bias of this type was defined. More... | |||||
size_t | output_freq | ||||
Frequency for writing output files. More... | |||||
std::string | output_prefix | ||||
Use this prefix for all output files. More... | |||||
Static Public Attributes | |||||
std::vector< feature * > | cvb_features | ||||
\brief Implementation of the feature list for colvarbias. More... | |||||
Protected Attributes | |||||
std::vector< colvar * > | colvars | ||||
\brief Pointers to collective variables to which the bias is applied; current values and metric functions will be obtained through each colvar object. More... | |||||
std::vector< colvarvalue > | colvar_values | ||||
\brief Up to date value of each colvar. More... | |||||
std::vector< colvarvalue > | colvar_forces | ||||
\brief Current forces from this bias to the variables. More... | |||||
std::vector< colvarvalue > | previous_colvar_forces | ||||
\brief Forces last applied by this bias to the variables. More... | |||||
cvm::real | bias_energy | ||||
\brief Current energy of this bias (colvar_forces should be obtained by deriving this). More... | |||||
bool | b_output_energy | ||||
Whether to write the current bias energy from this bias to the trajectory file. More... | |||||
bool | has_data | ||||
\brief Whether this bias has already accumulated information (for history-dependent biases). More... | |||||
cvm::step_number | state_file_step | ||||
\brief Step number read from the last state file. More... | |||||
bool | matching_state | ||||
Flag used to tell if the state string being read is for this bias. More... | |||||
colvar_grid_scalar * | biasing_force_scaling_factors | ||||
\brief The biasing forces will be scaled by the factor in this grid if b_bias_force_scaled is true. More... | |||||
std::vector< int > | biasing_force_scaling_factors_bin |
Definition at line 20 of file colvarbias.h.
|
\brief Constructor.
Definition at line 20 of file colvarbias.C. References b_output_energy, bias_type, biasing_force_scaling_factors, colvardeps::description, has_data, init_dependencies, matching_state, NULL, output_freq, rank, reset, state_file_step, state_keyword, colvardeps::time_step_factor, and colvarparse::to_lower_cppstr. |
|
Destructor.
Definition at line 239 of file colvarbias.C. References clear. |
|
Add a new collective variable to this bias.
Definition at line 293 of file colvarbias.C. References colvardeps::add_child, colvar::biases, colvarmodule::colvar_by_name, colvar_forces, colvars, COLVARS_INPUT_ERROR, colvarmodule::debug, colvarmodule::error, colvarmodule::log, colvar::name, previous_colvar_forces, and colvar::value. Referenced by init. |
|
Perform analysis tasks.
Definition at line 100 of file colvarbias.h. |
|
Definition at line 444 of file colvarbias.C. References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error. |
|
Give the total number of bins for a given bias.
Definition at line 434 of file colvarbias.C. References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error. |
|
Compute the energy of the bias Uses the vector of colvar values provided if not NULL, and the values currently cached in the bias instance otherwise.
Definition at line 358 of file colvarbias.C. References bias_energy. Referenced by colvarbias_abf::update, and update. |
|
Compute the forces due to the bias Uses the vector of colvar values provided if not NULL, and the values currently cached in the bias instance otherwise.
Reimplemented in colvarbias_meta. Definition at line 365 of file colvarbias.C. References colvar_forces, and num_variables. Referenced by update. |
|
Returns true if the current step represent a valid increment, whose data can be recorded (as opposed to e.g. a continuation step from a restart).
Definition at line 347 of file colvarbias.C. References colvardeps::f_cvb_step_zero_data, colvardeps::is_enabled, colvarmodule::main, colvarmodule::proxy, colvarproxy::simulation_continuing, and colvarmodule::step_relative. Referenced by colvarbias_histogram::update, and colvarbias_meta::update_bias. |
|
Load new configuration - force constant and/or centers only.
Reimplemented in colvarbias_restraint. Definition at line 417 of file colvarbias.C. References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error. Referenced by colvarmodule::change_configuration. |
|
\brief Delete everything.
Reimplemented from colvarparse. Definition at line 245 of file colvarbias.C. References colvarmodule::biases, biasing_force_scaling_factors, biasing_force_scaling_factors_bin, colvars, colvarmodule::config_changed, colvardeps::free_children_deps, colvarmodule::main, and NULL. Referenced by ~colvarbias. |
|
\brief Delete only the allocatable data (save memory).
Reimplemented in colvarbias_ti. Definition at line 286 of file colvarbias.C. |
|
Send forces to the collective variables.
Definition at line 374 of file colvarbias.C. References biasing_force_scaling_factors, biasing_force_scaling_factors_bin, colvar_forces, colvar_grid< cvm::real >::current_bin_scalar, colvarmodule::debug, colvardeps::f_cvb_apply_force, colvardeps::f_cvb_bypass_ext_lagrangian, colvardeps::f_cvb_scale_biasing_force, colvar_grid< cvm::real >::index_ok, colvardeps::is_enabled, colvarmodule::log, num_variables, previous_colvar_forces, colvardeps::time_step_factor, colvar_grid< cvm::real >::value, and variables. |
|
Calculate the bin index for a given bias.
Definition at line 439 of file colvarbias.C. References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error. |
|
Definition at line 221 of file colvarbias.h. References cvb_features. Referenced by colvarmodule::~colvarmodule. |
|
Carry out operations needed before next step is run.
Definition at line 411 of file colvarbias.C. |
|
Calculate change in energy from using alternate configuration.
Reimplemented in colvarbias_restraint. Definition at line 425 of file colvarbias.C. References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error. Referenced by colvarmodule::energy_difference. |
|
\brief Implementation of the feature list accessor for colvarbias.
Implements colvardeps. Definition at line 213 of file colvarbias.h. References cvb_features. Referenced by init_dependencies. |
|
Definition at line 204 of file colvarbias.h. References bias_energy. |
|
Write the values of specific mutable properties to a string.
Reimplemented in colvarbias_ti. Definition at line 456 of file colvarbias.C. References name, and colvarmodule::step_absolute. Referenced by colvarbias_restraint::get_state_params, colvarbias_meta::get_state_params, and write_state. |
|
|
|
Implements colvardeps. Definition at line 217 of file colvarbias.h. References cvb_features. Referenced by init_dependencies. |
|
|
Read the bias configuration from a restart file or other stream.
Definition at line 516 of file colvarbias.C. References bias_type, COLVARS_INPUT_ERROR, conf, colvarmodule::error, colvarmodule::log, matching_state, name, read_state_data, set_state_params, state_file_step, and state_keyword. Referenced by read_state_prefix, and read_state_string. |
|
Read all mutable data not already set by set_state_params().
Reimplemented in colvarbias_ti. Definition at line 146 of file colvarbias.h. Referenced by read_state. |
|
Read a keyword from the state data (typically a header)
Definition at line 638 of file colvarbias.C. References bias_type, COLVARS_INPUT_ERROR, colvarmodule::error, and colvarparse::to_lower_cppstr. Referenced by colvarbias_reweightaMD::read_state_data, colvarbias_histogram::read_state_data, and colvarbias_ti::read_state_data. |
|
Read the bias state from a file with this name or prefix.
Definition at line 597 of file colvarbias.C. References colvarproxy_io::close_input_stream, COLVARS_FILE_ERROR, colvarproxy_io::input_stream, colvarmodule::main, colvarmodule::proxy, and read_state. |
|
Read the bias state from this string buffer.
Definition at line 615 of file colvarbias.C. References COLVARS_BUG_ERROR, COLVARS_FILE_ERROR, colvarmodule::debug, colvarmodule::error, colvarmodule::log, name, NULL, and read_state. |
|
Definition at line 449 of file colvarbias.C. References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error. Referenced by colvarbias_abf::update. |
|
\brief Set to zero all mutable data.
Definition at line 224 of file colvarbias.C. References bias_energy, colvar_forces, and num_variables. Referenced by colvarbias. |
|
Read the values of specific mutable properties from a string.
Reimplemented in colvarbias_ti. Definition at line 465 of file colvarbias.C. References bias_type, COLVARS_INPUT_ERROR, conf, colvarmodule::debug, colvarmodule::error, colvarparse::get_keyval, colvarmodule::log, matching_state, name, colvarparse::parse_silent, and state_file_step. Referenced by read_state, colvarbias_restraint::set_state_params, colvarbias_meta::set_state_params, and colvarbias_alb::set_state_params. |
|
(Re)initialize the output files (does not write them yet).
Reimplemented in colvarbias_meta. Definition at line 181 of file colvarbias.h. |
|
Retrieve colvar values and calculate their biasing forces Some implementations may use calc_energy() and calc_forces().
Reimplemented in colvarbias_ti. Definition at line 325 of file colvarbias.C. References bias_type, calc_energy, calc_forces, colvar_values, colvars, colvarmodule::debug, has_data, colvarmodule::log, NULL, and num_variables. Referenced by colvarproxy_smp::smp_biases_loop, colvarproxy_smp::smp_biases_script_loop, colvarbias_restraint::update, colvarbias_meta::update, colvarbias_reweightaMD::update, and colvarbias_histogram::update. |
|
Access the i-th variable.
Definition at line 52 of file colvarbias.h. References colvars. |
|
|
Write any output files that this bias may have (e.g. PMF files).
Reimplemented in colvarbias_ti. Definition at line 190 of file colvarbias.h. |
|
Write the bias configuration to a state file or other stream.
Definition at line 495 of file colvarbias.C. References colvarmodule::debug, get_state_params, colvarmodule::log, name, state_keyword, and write_state_data. Referenced by colvarbias_meta::write_replica_state_file, write_state_prefix, and write_state_string. |
|
Write all mutable data not already written by get_state_params().
Reimplemented in colvarbias_ti. Definition at line 140 of file colvarbias.h. Referenced by write_state. |
|
Write the bias state to a file with the given prefix.
Definition at line 568 of file colvarbias.C. References COLVARS_FILE_ERROR, colvarmodule::state_file_prefix, and write_state. |
|
Write the bias state to a string.
Definition at line 585 of file colvarbias.C. References COLVARS_FILE_ERROR, colvarmodule::error, name, and write_state. |
|
If this bias is communicating with other replicas through files, send it to them.
Reimplemented in colvarbias_meta. Definition at line 199 of file colvarbias.h. |
|
Output quantities such as the bias energy to the trajectory file.
Reimplemented in colvarbias_alb. Definition at line 668 of file colvarbias.C. References bias_energy. Referenced by colvarbias_restraint::write_traj. |
|
Write a label to the trajectory file (comment line).
Reimplemented in colvarbias_alb. Definition at line 658 of file colvarbias.C. References colvarmodule::wrap_string. Referenced by colvarbias_restraint::write_traj_label. |
|
Whether to write the current bias energy from this bias to the trajectory file.
Definition at line 248 of file colvarbias.h. Referenced by colvarbias, and init. |
|
\brief Current energy of this bias (colvar_forces should be obtained by deriving this).
Definition at line 245 of file colvarbias.h. Referenced by colvarbias_meta::calc_energy, calc_energy, colvarbias_restraint_linear::energy_difference, colvarbias_restraint_harmonic::energy_difference, get_energy, reset, colvarbias_restraint_histogram::update, colvarbias_restraint::update, colvarbias_alb::update, colvarbias_restraint_histogram::write_traj, colvarbias_alb::write_traj, and write_traj. |
|
Keyword indicating the type of this bias.
Definition at line 28 of file colvarbias.h. Referenced by colvarbias, init, read_state, read_state_data_key, set_state_params, and update. |
|
\brief The biasing forces will be scaled by the factor in this grid if b_bias_force_scaled is true.
Definition at line 262 of file colvarbias.h. Referenced by clear, colvarbias, communicate_forces, and init. |
|
Definition at line 263 of file colvarbias.h. Referenced by clear, communicate_forces, and init. |
|
\brief Current forces from this bias to the variables.
Definition at line 239 of file colvarbias.h. Referenced by add_colvar, colvarbias_meta::calc_forces, calc_forces, communicate_forces, init, reset, colvarbias_restraint_histogram::update, colvarbias_restraint::update, colvarbias_alb::update, colvarbias_abf::update, colvarbias_restraint_centers_moving::update_acc_work, and colvarbias_meta::update_replicas_registry. |
|
\brief Up to date value of each colvar.
Definition at line 236 of file colvarbias.h. Referenced by colvarbias_meta::calc_hills, colvarbias_meta::calc_hills_force, init, update, and colvarbias_meta::update_bias. |
|
\brief Pointers to collective variables to which the bias is applied; current values and metric functions will be obtained through each colvar object.
Definition at line 233 of file colvarbias.h. Referenced by add_colvar, clear, colvarbias_meta::init, colvarbias_reweightaMD::init, colvarbias_histogram::init, colvarbias_alb::init, colvarbias_abf::init, init, colvarbias_meta::init_ebmeta_params, colvarbias_ti::init_grids, num_variables, colvarbias_meta::read_state_data, colvarbias_alb::update, colvarbias_abf::update, update, colvarbias_meta::update_replicas_registry, variables, and colvarbias_alb::write_traj_label. |
|
\brief Implementation of the feature list for colvarbias.
Definition at line 938 of file colvarbias.C. Referenced by delete_features, features, and modify_features. |
|
\brief Whether this bias has already accumulated information (for history-dependent biases).
Definition at line 252 of file colvarbias.h. Referenced by colvarbias_meta::add_hill, colvarbias, colvarbias_meta::read_hill, colvarbias_meta::read_state_data, update, colvarbias_ti::update_system_forces, colvarbias_histogram::write_output_files, and colvarbias_ti::write_output_files. |
|
Flag used to tell if the state string being read is for this bias.
Definition at line 258 of file colvarbias.h. Referenced by colvarbias, read_state, and set_state_params. |
|
|
Frequency for writing output files.
Definition at line 187 of file colvarbias.h. Referenced by colvarbias, colvarbias_abf::init, and init. |
|
Use this prefix for all output files.
Definition at line 196 of file colvarbias.h. Referenced by init, and colvarbias_meta::setup_output. |
|
\brief Forces last applied by this bias to the variables.
Definition at line 242 of file colvarbias.h. Referenced by add_colvar, communicate_forces, init, and colvarbias_ti::update_system_forces. |
|
Track how many times a bias of this type was defined.
Definition at line 34 of file colvarbias.h. Referenced by colvarbias, and init. |
|
\brief Step number read from the last state file.
Definition at line 255 of file colvarbias.h. Referenced by colvarbias, colvarbias_meta::read_hill, read_state, and set_state_params. |
|
Keyword used in state files (== bias_type most of the time).
Definition at line 31 of file colvarbias.h. Referenced by colvarbias, colvarbias_restraint::colvarbias_restraint, read_state, and write_state. |