| version 1.3 | version 1.4 |
|---|
| |
| | // -*- c++ -*- |
| | |
| | // This file is part of the Collective Variables module (Colvars). |
| | // The original version of Colvars and its updates are located at: |
| | // https://github.com/colvars/colvars |
| | // Please update all Colvars source files before making any changes. |
| | // If you wish to distribute your changes, please submit them to the |
| | // Colvars repository at GitHub. |
| | |
| | |
| #include "colvardeps.h" | #include "colvardeps.h" |
| | |
| | |
| |
| } | } |
| | |
| | |
| | void colvardeps::set_available(int feature_id, bool truefalse) { |
| | feature_states[feature_id]->available = truefalse; |
| | } |
| | |
| | |
| | void colvardeps::set_enabled(int feature_id, bool truefalse) { |
| | feature_states[feature_id]->enabled = truefalse; |
| | } |
| | |
| | |
| bool colvardeps::get_keyval_feature(colvarparse *cvp, | bool colvardeps::get_keyval_feature(colvarparse *cvp, |
| std::string const &conf, char const *key, | std::string const &conf, char const *key, |
| int feature_id, bool const &def_value, | int feature_id, bool const &def_value, |
| |
| if (res != COLVARS_OK) { | if (res != COLVARS_OK) { |
| if (!dry_run) { | if (!dry_run) { |
| cvm::log("...required by \"" + f->description + "\" in " + description); | cvm::log("...required by \"" + f->description + "\" in " + description); |
| } | |
| if (toplevel) { | if (toplevel) { |
| cvm::error("Error: Failed dependency in " + description + "."); | cvm::error("Error: Failed dependency in " + description + "."); |
| } | } |
| | } |
| return res; | return res; |
| } | } |
| } | } |
| |
| | |
| f_description(f_cvb_history_dependent, "history-dependent"); | f_description(f_cvb_history_dependent, "history-dependent"); |
| | |
| | f_description(f_cvb_scalar_variables, "require scalar variables"); |
| | f_req_children(f_cvb_scalar_variables, f_cv_scalar); |
| | |
| | f_description(f_cvb_calc_pmf, "calculate a PMF"); |
| | // TODO define requirements? |
| | |
| // Initialize feature_states for each instance | // Initialize feature_states for each instance |
| feature_states.reserve(f_cvb_ntot); | feature_states.reserve(f_cvb_ntot); |
| for (i = 0; i < f_cvb_ntot; i++) { | for (i = 0; i < f_cvb_ntot; i++) { |
| |
| | |
| // some biases are not history-dependent | // some biases are not history-dependent |
| feature_states[f_cvb_history_dependent]->available = false; | feature_states[f_cvb_history_dependent]->available = false; |
| | |
| | // some biases do not compute a PMF |
| | feature_states[f_cvb_calc_pmf]->available = false; |
| | |
| | // by default, biases should work with vector variables, too |
| | feature_states[f_cvb_scalar_variables]->available = false; |
| } | } |
| | |
| | |
| |
| f_req_self(f_cv_grid, f_cv_lower_boundary); | f_req_self(f_cv_grid, f_cv_lower_boundary); |
| f_req_self(f_cv_grid, f_cv_upper_boundary); | f_req_self(f_cv_grid, f_cv_upper_boundary); |
| | |
| f_description(f_cv_lower_wall, "lower wall"); | |
| f_req_self(f_cv_lower_wall, f_cv_lower_boundary); | |
| f_req_self(f_cv_lower_wall, f_cv_gradient); | |
| | |
| f_description(f_cv_upper_wall, "upper wall"); | |
| f_req_self(f_cv_upper_wall, f_cv_upper_boundary); | |
| f_req_self(f_cv_upper_wall, f_cv_gradient); | |
| | |
| f_description(f_cv_runave, "running average"); | f_description(f_cv_runave, "running average"); |
| | |
| f_description(f_cv_corrfunc, "correlation function"); | f_description(f_cv_corrfunc, "correlation function"); |
| |
| // The features below are set programmatically | // The features below are set programmatically |
| f_description(f_cv_scripted, "scripted"); | f_description(f_cv_scripted, "scripted"); |
| f_description(f_cv_periodic, "periodic"); | f_description(f_cv_periodic, "periodic"); |
| | f_req_self(f_cv_periodic, f_cv_homogeneous); |
| f_description(f_cv_scalar, "scalar"); | f_description(f_cv_scalar, "scalar"); |
| f_description(f_cv_linear, "linear"); | f_description(f_cv_linear, "linear"); |
| f_description(f_cv_homogeneous, "homogeneous"); | f_description(f_cv_homogeneous, "homogeneous"); |