#include <colvardeps.h>
Inheritance diagram for colvardeps:
Public Types | |||||
enum | features_biases { f_cvb_active, f_cvb_awake, f_cvb_step_zero_data, f_cvb_apply_force, f_cvb_bypass_ext_lagrangian, f_cvb_get_total_force, f_cvb_output_acc_work, f_cvb_history_dependent, f_cvb_time_dependent, f_cvb_scalar_variables, f_cvb_calc_pmf, f_cvb_calc_ti_samples, f_cvb_write_ti_samples, f_cvb_write_ti_pmf, f_cvb_scale_biasing_force, f_cvb_ntot } | ||||
enum | features_colvar { f_cv_active, f_cv_awake, f_cv_gradient, f_cv_collect_gradient, f_cv_collect_atom_ids, f_cv_fdiff_velocity, f_cv_total_force, f_cv_total_force_calc, f_cv_subtract_applied_force, f_cv_Jacobian, f_cv_hide_Jacobian, f_cv_extended_Lagrangian, f_cv_external, f_cv_Langevin, f_cv_output_energy, f_cv_output_value, f_cv_output_velocity, f_cv_output_applied_force, f_cv_output_total_force, f_cv_lower_boundary, f_cv_upper_boundary, f_cv_hard_lower_boundary, f_cv_hard_upper_boundary, f_cv_reflecting_lower_boundary, f_cv_reflecting_upper_boundary, f_cv_grid, f_cv_runave, f_cv_corrfunc, f_cv_scripted, f_cv_custom_function, f_cv_periodic, f_cv_single_cvc, f_cv_scalar, f_cv_linear, f_cv_homogeneous, f_cv_multiple_ts, f_cv_ntot } | ||||
enum | features_cvc { f_cvc_active, f_cvc_scalar, f_cvc_periodic, f_cvc_width, f_cvc_lower_boundary, f_cvc_upper_boundary, f_cvc_gradient, f_cvc_explicit_gradient, f_cvc_inv_gradient, f_cvc_Jacobian, f_cvc_one_site_total_force, f_cvc_debug_gradient, f_cvc_pbc_minimum_image, f_cvc_com_based, f_cvc_scalable, f_cvc_scalable_com, f_cvc_collect_atom_ids, f_cvc_ntot } | ||||
enum | features_atomgroup { f_ag_active, f_ag_center, f_ag_center_origin, f_ag_rotate, f_ag_fitting_group, f_ag_explicit_gradient, f_ag_fit_gradients, f_ag_atom_forces, f_ag_scalable, f_ag_scalable_com, f_ag_collect_atom_ids, f_ag_ntot } | ||||
Public Methods | |||||
colvardeps () | |||||
virtual | ~colvardeps () | ||||
int | get_time_step_factor () const | ||||
\brief returns time_step_factor. More... | |||||
void | init_feature (int feature_id, const char *description, feature_type type) | ||||
Pair a numerical feature ID with a description and type. More... | |||||
bool | is_not_set (int id) | ||||
bool | is_dynamic (int id) | ||||
bool | is_static (int id) | ||||
bool | is_user (int id) | ||||
virtual const std::vector< feature * > & | features () const=0 | ||||
virtual std::vector< feature * > & | modify_features ()=0 | ||||
void | add_child (colvardeps *child) | ||||
void | remove_child (colvardeps *child) | ||||
void | remove_all_children () | ||||
Used before deleting an object, if not handled by that object's destructor (useful for cvcs because their children are member objects). More... | |||||
bool | is_enabled (int f=f_cv_active) const | ||||
bool | is_available (int f=f_cv_active) const | ||||
void | provide (int feature_id, bool truefalse=true) | ||||
Set the feature's available flag, without checking To be used for dynamic properties dependencies will be checked by enable(). More... | |||||
void | set_enabled (int feature_id, bool truefalse=true) | ||||
Enable or disable, depending on flag value. More... | |||||
int | enable (int f, bool dry_run=false, bool toplevel=true) | ||||
Enable a feature and recursively solve its dependencies. For accurate reference counting, do not add spurious calls to enable()
| |||||
int | disable (int f) | ||||
Disable a feature, decrease the reference count of its dependencies and recursively disable them as applicable. More... | |||||
void | free_children_deps () | ||||
disable all enabled features to free their dependencies to be done when deleting the object Cannot be in the base class destructor because it needs the derived class features(). More... | |||||
void | restore_children_deps () | ||||
re-enable children features (to be used when object becomes active). More... | |||||
int | decr_ref_count (int f) | ||||
Decrement the reference count of a feature disabling it if it's dynamic and count reaches zero. More... | |||||
virtual void | do_feature_side_effects (int) | ||||
Implements possible actions to be carried out when a given feature is enabled Base function does nothing, can be overloaded. More... | |||||
virtual int | init_dependencies ()=0 | ||||
Initialize dependency tree for object of a derived class. More... | |||||
void | require_feature_self (int f, int g) | ||||
Make feature f require feature g within the same object. More... | |||||
void | exclude_feature_self (int f, int g) | ||||
Make features f and g mutually exclusive within the same object. More... | |||||
void | require_feature_children (int f, int g) | ||||
Make feature f require feature g within children. More... | |||||
void | require_feature_alt (int f, int g, int h) | ||||
Make feature f require either g or h within the same object. More... | |||||
void | require_feature_alt (int f, int g, int h, int i) | ||||
Make feature f require any of g, h, or i within the same object. More... | |||||
void | require_feature_alt (int f, int g, int h, int i, int j) | ||||
Make feature f require any of g, h, i, or j within the same object. More... | |||||
void | print_state () | ||||
\brief print all enabled features and those of children, for debugging. More... | |||||
void | check_enabled (int f, std::string const &reason) const | ||||
\brief Check that a feature is enabled, raising COLVARS_BUG_ERROR if not. More... | |||||
Public Attributes | |||||
std::string | description | ||||
Protected Types | |||||
enum | feature_type { f_type_not_set, f_type_dynamic, f_type_user, f_type_static } | ||||
Enum of possible feature types. More... | |||||
Protected Methods | |||||
bool | get_keyval_feature (colvarparse *cvp, std::string const &conf, char const *key, int feature_id, bool const &def_value, colvarparse::Parse_Mode const parse_mode=colvarparse::parse_normal) | ||||
Parse a keyword and enable a feature accordingly. More... | |||||
Protected Attributes | |||||
int | time_step_factor | ||||
Time step multiplier (for coarse-timestep biases & colvars) Biases and colvars will only be calculated at those times (f_cvb_awake and f_cv_awake); a Biases use this to apply "impulse" biasing forces at the outer timestep Unused by lower-level objects (cvcs and atom groups). More... | |||||
std::vector< feature_state > | feature_states | ||||
List of the states of all features. More... |
Definition at line 34 of file colvardeps.h.
|
Enum of possible feature types.
Definition at line 83 of file colvardeps.h. |
|
Definition at line 385 of file colvardeps.h. |
|
Definition at line 225 of file colvardeps.h. |
|
Definition at line 259 of file colvardeps.h. |
|
Definition at line 345 of file colvardeps.h. |
|
Definition at line 16 of file colvardeps.C. References time_step_factor. |
|
Definition at line 22 of file colvardeps.C. References description, colvarmodule::log, and remove_all_children. |
|
Definition at line 450 of file colvardeps.C. References colvarmodule::debug, colvarmodule::decrease_depth, enable, feature_states, features, colvarmodule::increase_depth, is_enabled, colvarmodule::log, and parents. Referenced by colvarbias::add_colvar, colvar::init_components, and colvar::cvc::register_atom_group. |
|
\brief Check that a feature is enabled, raising COLVARS_BUG_ERROR if not.
Definition at line 430 of file colvardeps.h. References COLVARS_BUG_ERROR, description, colvarmodule::error, features, and is_enabled. Referenced by colvar::add_bias_force. |
|
Decrement the reference count of a feature disabling it if it's dynamic and count reaches zero.
Definition at line 357 of file colvardeps.C. References COLVARS_ERROR, colvarmodule::debug, description, disable, colvarmodule::error, feature, feature_states, features, and colvarmodule::log. Referenced by disable. |
|
Disable a feature, decrease the reference count of its dependencies and recursively disable them as applicable.
Definition at line 294 of file colvardeps.C. References COLVARS_ERROR, colvarmodule::debug, decr_ref_count, colvarmodule::decrease_depth, description, colvarmodule::error, feature, feature_states, features, free_children_deps, colvarmodule::increase_depth, is_enabled, and colvarmodule::log. Referenced by colvar::alch_lambda::alch_lambda, decr_ref_count, colvar::distance_dir::distance_dir, colvar::distance_pairs::distance_pairs, colvar::distance_vec::distance_vec, colvar::cvc::init, colvar::init_grid_parameters, colvar::orientation::orientation, colvar::cvc::parse_group, set_enabled, and simple_scalar_dist_functions. |
|
Implements possible actions to be carried out when a given feature is enabled Base function does nothing, can be overloaded.
Reimplemented in colvar. Definition at line 222 of file colvardeps.h. Referenced by enable. |
|
|
Make features f and g mutually exclusive within the same object.
Definition at line 396 of file colvardeps.C. References features. Referenced by colvar::cvc::init_dependencies, colvarbias::init_dependencies, and colvar::init_dependencies. |
|
Implemented in colvar. Referenced by add_child, check_enabled, decr_ref_count, disable, enable, exclude_feature_self, free_children_deps, get_keyval_feature, is_dynamic, is_not_set, is_static, is_user, print_state, require_feature_alt, require_feature_children, require_feature_self, and restore_children_deps. |
|
disable all enabled features to free their dependencies to be done when deleting the object Cannot be in the base class destructor because it needs the derived class features().
Definition at line 43 of file colvardeps.C. References colvarmodule::debug, colvarmodule::decrease_depth, description, feature_states, features, colvarmodule::increase_depth, is_enabled, and colvarmodule::log. Referenced by colvarbias::clear, disable, and colvar::cvc::~cvc. |
|
Parse a keyword and enable a feature accordingly.
Definition at line 107 of file colvardeps.C. References conf, description, colvarmodule::error, features, colvarparse::get_keyval, is_user, colvarparse::Parse_Mode, and set_enabled. Referenced by colvar::cvc::init, colvarbias_restraint_moving::init, colvarbias_abf::init, colvarbias_ti::init, colvarbias::init, colvar::init_extended_Lagrangian, colvar::init_grid_parameters, colvar::init_output_flags, and colvar::cvc::init_total_force_params. |
|
\brief returns time_step_factor.
Definition at line 92 of file colvardeps.h. References time_step_factor. Referenced by colvarbias_abf::init. |
|
Initialize dependency tree for object of a derived class.
Implemented in colvar. |
|
Pair a numerical feature ID with a description and type.
Definition at line 383 of file colvardeps.C. References modify_features. Referenced by colvar::cvc::init_dependencies, colvarbias::init_dependencies, and colvar::init_dependencies. |
|
Definition at line 173 of file colvardeps.h. References f_cv_active, and feature_states. Referenced by colvar::cvc::parse_group. |
|
Definition at line 133 of file colvardeps.h. References f_type_dynamic, and features. Referenced by enable, and colvar::cvc::init_dependencies. |
|
Definition at line 167 of file colvardeps.h. References f_cv_active, and feature_states. Referenced by add_child, colvar::analyze, colvar::applied_force, colvar::distance_pairs::apply_force, colvar::calc, colvar::calc_colvar_properties, colvar::calc_cvc_Jacobians, colvar::calc_cvc_total_force, colvar::distance_xy::calc_force_invgrads, colvar::distance_z::calc_force_invgrads, colvar::distance::calc_force_invgrads, colvar::dihedral::calc_force_invgrads, colvar::angle::calc_force_invgrads, colvar::distance_xy::calc_gradients, colvar::distance_z::calc_gradients, colvar::map_total::calc_value, colvar::orientation::calc_value, colvar::distance_pairs::calc_value, colvar::distance_inv::calc_value, colvar::distance_dir::calc_value, colvar::distance_xy::calc_value, colvar::distance_z::calc_value, colvar::distance_vec::calc_value, colvar::distance::calc_value, colvar::selfcoordnum::calc_value, colvar::coordnum::calc_value, colvar::dihedral::calc_value, colvar::dipole_angle::calc_value, colvar::angle::calc_value, colvarbias::can_accumulate_data, check_enabled, colvar::collect_cvc_gradients, colvar::collect_cvc_Jacobians, colvar::collect_cvc_total_forces, colvar::collect_cvc_values, colvarbias_restraint_harmonic_walls::colvar_distance, colvarbias::communicate_forces, colvar::communicate_forces, colvar::coordnum::coordnum, colvar::cvc_param_exists, disable, colvar::distance_z::dist2, colvar::dist2, colvar::distance_z::dist2_lgrad, colvar::dist2_lgrad, colvar::distance_z::dist2_rgrad, colvar::dist2_rgrad, colvar::distance_inv::distance_inv, colvar::distance_z::distance_z, enable, colvar::end_of_step, free_children_deps, colvar::get_cvc_param, colvar::get_cvc_param_grad, colvar::get_cvc_param_ptr, colvarbias_restraint_k_moving::get_state_params, colvarbias_restraint_centers_moving::get_state_params, colvar::cvc::init, colvarbias_restraint_moving::init, colvarbias_histogram::init, colvarbias_abf::init, colvarbias_ti::init, colvarbias::init, colvar::init, colvar::init_extended_Lagrangian, colvar::init_grid_parameters, colvarbias_ti::init_grids, colvar::cvc::init_total_force_params, colvar::cvc::parse_group, colvar::periodic_boundaries, print_state, colvar::read_state, colvarbias_ti::read_state_data, colvar::read_traj, restore_children_deps, colvar::set_cvc_param, colvar::cvc::set_param, colvarbias_restraint_k_moving::set_state_params, colvarbias_restraint_centers_moving::set_state_params, simple_scalar_dist_functions, colvarbias_abf::update, colvarbias_restraint_k_moving::update_acc_work, colvarbias_restraint_centers_moving::update_acc_work, colvarbias_meta::update_bias, colvar::update_extended_Lagrangian, colvar::update_forces_energy, colvarbias_meta::update_replicas_registry, colvarbias_ti::update_system_forces, colvar::distance_z::wrap, colvar::wrap, colvarbias_ti::write_output_files, colvar::write_output_files, colvar::write_state, colvarbias_ti::write_state_data, colvarbias_restraint_k_moving::write_traj, colvarbias_restraint_centers_moving::write_traj, colvar::write_traj, colvarbias_restraint_k_moving::write_traj_label, colvarbias_restraint_centers_moving::write_traj_label, and colvar::write_traj_label. |
|
Definition at line 132 of file colvardeps.h. References f_type_not_set, and features. Referenced by colvar::cvc::init_dependencies, colvarbias::init_dependencies, and colvar::init_dependencies. |
|
Definition at line 134 of file colvardeps.h. References f_type_static, and features. Referenced by enable. |
|
Definition at line 135 of file colvardeps.h. References f_type_user, and features. Referenced by enable, and get_keyval_feature. |
|
Implemented in colvar. Referenced by init_feature. |
|
\brief print all enabled features and those of children, for debugging.
Definition at line 431 of file colvardeps.C. References colvarmodule::decrease_depth, description, feature_states, features, colvarmodule::increase_depth, is_enabled, colvarmodule::log, and colvarmodule::to_str. Referenced by colvarbias::init. |
|
Set the feature's available flag, without checking To be used for dynamic properties dependencies will be checked by enable().
Definition at line 93 of file colvardeps.C. References feature_states. Referenced by colvar::angle::angle, colvarbias_histogram::colvarbias_histogram, colvarbias_restraint_harmonic_walls::colvarbias_restraint_harmonic_walls, colvarbias_ti::colvarbias_ti, colvar::dihedral::dihedral, colvar::distance::distance, colvar::distance_xy::distance_xy, colvar::distance_z::distance_z, and colvar::cvc::init_total_force_params. |
|
Used before deleting an object, if not handled by that object's destructor (useful for cvcs because their children are member objects).
Definition at line 502 of file colvardeps.C. References description, and colvarmodule::error. Referenced by colvar::~colvar, ~colvardeps, and colvar::cvc::~cvc. |
|
Definition at line 474 of file colvardeps.C. References description, colvarmodule::error, and parents. |
|
Make feature f require any of g, h, i, or j within the same object.
Definition at line 422 of file colvardeps.C. References features. |
|
Make feature f require any of g, h, or i within the same object.
Definition at line 414 of file colvardeps.C. References features. |
|
Make feature f require either g or h within the same object.
Definition at line 407 of file colvardeps.C. References features. Referenced by colvar::init_dependencies. |
|
Make feature f require feature g within children.
Definition at line 402 of file colvardeps.C. References features. Referenced by colvar::cvc::init_dependencies, colvarbias::init_dependencies, and colvar::init_dependencies. |
|
Make feature f require feature g within the same object.
Definition at line 390 of file colvardeps.C. References features. Referenced by colvar::cvc::init_dependencies, colvarbias::init_dependencies, and colvar::init_dependencies. |
|
re-enable children features (to be used when object becomes active).
Definition at line 73 of file colvardeps.C. References colvarmodule::debug, colvarmodule::decrease_depth, description, feature_states, features, colvarmodule::increase_depth, is_enabled, and colvarmodule::log. Referenced by enable. |
|
Enable or disable, depending on flag value.
Definition at line 98 of file colvardeps.C. References disable, and enable. Referenced by colvarbias_restraint_harmonic_walls::colvarbias_restraint_harmonic_walls, get_keyval_feature, and colvar::init. |
|
Definition at line 42 of file colvardeps.h. Referenced by check_enabled, colvar::colvar, colvarbias::colvarbias, colvar::cvc::cvc, colvar::cvc::debug_gradients, decr_ref_count, disable, enable, free_children_deps, get_keyval_feature, colvar::cvc::init, colvarbias_abf::init, colvarbias::init, colvar::init, colvar::cvc::init_dependencies, colvarbias::init_dependencies, colvar::init_dependencies, print_state, remove_all_children, remove_child, restore_children_deps, colvar::cvc::setup, colvar::update_extended_Lagrangian, and ~colvardeps. |
|
List of the states of all features.
Definition at line 80 of file colvardeps.h. Referenced by add_child, colvarbias_abf::colvarbias_abf, colvarbias_ti::colvarbias_ti, decr_ref_count, disable, enable, free_children_deps, colvar::cvc::init_dependencies, colvarbias::init_dependencies, colvar::init_dependencies, is_available, is_enabled, print_state, provide, and restore_children_deps. |
|
Time step multiplier (for coarse-timestep biases & colvars) Biases and colvars will only be calculated at those times (f_cvb_awake and f_cv_awake); a Biases use this to apply "impulse" biasing forces at the outer timestep Unused by lower-level objects (cvcs and atom groups).
Definition at line 77 of file colvardeps.h. Referenced by colvarbias::colvarbias, colvardeps, colvarbias::communicate_forces, get_time_step_factor, colvarbias_abf::init, colvarbias::init, colvar::init, colvar::init_extended_Lagrangian, colvar::init_grid_parameters, colvar::update_extended_Lagrangian, and colvar::update_forces_energy. |