#include <colvarbias.h>
Inheritance diagram for colvarbias:
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.
[virtual]
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.
[inline, virtual]
[virtual]
Definition at line 444 of file colvarbias.C.
References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error.
[virtual]
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.
[virtual]
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.
[virtual]
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.
[virtual]
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.
[virtual]
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.
[virtual]
\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.
[virtual]
\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.
[virtual]
Calculate the bin index for a given bias.
Definition at line 439 of file colvarbias.C.
References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error.
[inline, static]
Definition at line 221 of file colvarbias.h.
References cvb_features.
Referenced by colvarmodule::~colvarmodule.
[virtual]
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.
[inline, virtual]
\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.
[inline]
[virtual]
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.
[virtual]
\brief Parse config string and (re)initialize.
Reimplemented in colvarbias_ti.
Definition at line 43 of file colvarbias.C.
References add_colvar, b_output_energy, colvarmodule::bias_by_name, bias_type, biasing_force_scaling_factors, biasing_force_scaling_factors_bin, colvar_forces, colvar_values, colvars, COLVARS_INPUT_ERROR, conf, colvarmodule::debug, colvardeps::description, colvardeps::enable, colvarmodule::error, colvardeps::f_cvb_active, colvardeps::f_cvb_bypass_ext_lagrangian, colvardeps::f_cvb_scale_biasing_force, colvardeps::f_cvb_step_zero_data, colvarparse::get_keyval, colvardeps::get_keyval_feature, colvardeps::is_enabled, colvarmodule::log, name, NULL, num_variables, output_freq, colvarmodule::output_prefix, output_prefix, colvarparse::parse_echo, previous_colvar_forces, colvardeps::print_state, rank, colvar_grid_scalar::read_multicol, colvarparse::set_string, colvardeps::time_step_factor, and colvarmodule::to_str.
Referenced by colvarbias_restraint_histogram::init, colvarbias_restraint::init, colvarbias_meta::init, colvarbias_histogram::init, colvarbias_alb::init, and colvarbias_abf::init.
[virtual]
\brief Initialize dependency tree.
Implements colvardeps.
Definition at line 143 of file colvarbias.C.
References colvardeps::description, colvarmodule::error, colvardeps::exclude_feature_self, colvardeps::f_cv_active, colvardeps::f_cv_gradient, colvardeps::f_cv_grid, colvardeps::f_cv_scalar, colvardeps::f_cv_total_force, colvardeps::f_cvb_active, colvardeps::f_cvb_apply_force, colvardeps::f_cvb_awake, colvardeps::f_cvb_bypass_ext_lagrangian, colvardeps::f_cvb_calc_pmf, colvardeps::f_cvb_calc_ti_samples, colvardeps::f_cvb_get_total_force, colvardeps::f_cvb_history_dependent, colvardeps::f_cvb_ntot, colvardeps::f_cvb_output_acc_work, colvardeps::f_cvb_scalar_variables, colvardeps::f_cvb_scale_biasing_force, colvardeps::f_cvb_step_zero_data, colvardeps::f_cvb_time_dependent, colvardeps::f_cvb_write_ti_pmf, colvardeps::f_cvb_write_ti_samples, colvardeps::f_type_dynamic, colvardeps::f_type_static, colvardeps::f_type_user, feature, colvardeps::feature_states, features, colvardeps::init_feature, colvardeps::is_not_set, modify_features, colvardeps::require_feature_children, and colvardeps::require_feature_self.
Referenced by colvarbias.
[inline, virtual]
Implements colvardeps.
Definition at line 217 of file colvarbias.h.
References cvb_features.
Referenced by init_dependencies.
[inline]
How many variables are defined for this bias.
Definition at line 40 of file colvarbias.h.
References colvars.
Referenced by colvarbias_meta::calc_forces, calc_forces, colvarbias_meta::calc_hills, colvarbias_restraint_centers::change_configuration, communicate_forces, colvarbias_restraint_centers_moving::get_state_params, colvarbias_alb::get_state_params, colvarbias_restraint_linear::init, colvarbias_restraint_harmonic_walls::init, colvarbias_restraint_harmonic::init, colvarbias_restraint_centers_moving::init, colvarbias_restraint_centers::init, colvarbias_meta::init, colvarbias_reweightaMD::init, colvarbias_histogram::init, colvarbias_alb::init, colvarbias_abf::init, colvarbias_ti::init, init, colvarbias_ti::init_grids, colvarbias_meta::project_hills, colvarbias_meta::read_hill, reset, colvarbias_restraint_histogram::update, colvarbias_restraint_k_moving::update, colvarbias_restraint_centers_moving::update, colvarbias_restraint::update, colvarbias_reweightaMD::update, colvarbias_histogram::update, colvarbias_alb::update, colvarbias_abf::update, update, colvarbias_restraint_k_moving::update_acc_work, colvarbias_restraint_centers_moving::update_acc_work, colvarbias_restraint_centers_moving::update_centers, colvarbias_meta::update_grid_params, colvarbias_ti::update_system_forces, colvarbias_restraint_centers_moving::write_traj, colvarbias_alb::write_traj, colvarbias_restraint_centers_moving::write_traj_label, and colvarbias_alb::write_traj_label.
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.
[inline, virtual]
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.
[virtual]
Definition at line 449 of file colvarbias.C.
References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error.
Referenced by colvarbias_abf::update.
[virtual]
\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.
[virtual]
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.
[inline, virtual]
(Re)initialize the output files (does not write them yet).
Reimplemented in colvarbias_meta.
Definition at line 181 of file colvarbias.h.
[virtual]
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.
[inline]
[inline]
Access the variables vector.
Definition at line 46 of file colvarbias.h.
References colvars.
Referenced by colvarbias_meta::calc_hills, colvarbias_meta::calc_hills_force, colvarbias_restraint_centers::change_configuration, colvarbias_restraint_harmonic_walls::colvar_distance, communicate_forces, colvarbias_restraint_linear::d_restraint_potential_dk, colvarbias_restraint_harmonic_walls::d_restraint_potential_dk, colvarbias_restraint_harmonic::d_restraint_potential_dk, colvarbias_restraint_linear::init, colvarbias_restraint_harmonic_walls::init, colvarbias_restraint_harmonic::init, colvarbias_restraint_centers::init, colvarbias_meta::init, colvarbias_ti::init, colvarbias_ti::init_grids, colvarbias_meta::read_hill, colvarbias_restraint_linear::restraint_force, colvarbias_restraint_harmonic_walls::restraint_force, colvarbias_restraint_harmonic::restraint_force, colvarbias_restraint_linear::restraint_potential, colvarbias_restraint_harmonic_walls::restraint_potential, colvarbias_restraint_harmonic::restraint_potential, colvarbias_restraint_histogram::update, colvarbias_restraint::update, colvarbias_restraint_centers_moving::update_centers, colvarbias_meta::update_grid_params, colvarbias_ti::update_system_forces, colvarbias_restraint_histogram::write_output_files, and colvarbias_restraint_centers_moving::write_traj_label.
[inline, virtual]
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.
[inline, virtual]
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.
[inline, virtual]
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.
[virtual]
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.
[virtual]
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.
[protected]
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.
[protected]
\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.
[protected]
\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.
[protected]
[protected]
\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.
[protected]
\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.
[protected]
\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.
[static]
\brief Implementation of the feature list for colvarbias.
Definition at line 938 of file colvarbias.C.
Referenced by delete_features, features, and modify_features.
[protected]
\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.
[protected]
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.
Name of this bias.
Definition at line 25 of file colvarbias.h.
Referenced by get_state_params, colvarbias_ti::init, init, read_state, read_state_string, set_state_params, colvarbias_meta::setup_output, colvarproxy_smp::smp_biases_loop, colvarproxy_smp::smp_biases_script_loop, colvarbias_histogram::update, colvarbias_abf::update, colvarbias_meta::update_replicas_registry, colvarbias_restraint_histogram::write_output_files, colvarbias_reweightaMD::write_output_files, colvarbias_ti::write_output_files, colvarbias_meta::write_replica_state_file, write_state, write_state_string, and colvarbias_alb::write_traj_label.
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.
[protected]
\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.
[protected]
\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.