| version 1.23 | version 1.24 |
|---|
| |
| // -*- c++ -*- | // -*- 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 "colvarmodule.h" | #include "colvarmodule.h" |
| #include "colvarparse.h" | #include "colvarparse.h" |
| #include "colvaratoms.h" | #include "colvaratoms.h" |
| |
| | |
| cvm::atom_group::~atom_group() | cvm::atom_group::~atom_group() |
| { | { |
| if (is_enabled(f_ag_scalable)) { | if (is_enabled(f_ag_scalable) && !b_dummy) { |
| (cvm::proxy)->clear_atom_group(index); | (cvm::proxy)->clear_atom_group(index); |
| index = -1; | index = -1; |
| } | } |
| |
| | |
| int cvm::atom_group::add_index_group(std::string const &index_group_name) | int cvm::atom_group::add_index_group(std::string const &index_group_name) |
| { | { |
| std::list<std::string>::iterator names_i = cvm::index_group_names.begin(); | colvarmodule *cv = cvm::main(); |
| std::list<std::vector<int> >::iterator index_groups_i = cvm::index_groups.begin(); | |
| for ( ; names_i != cvm::index_group_names.end() ; ++names_i, ++index_groups_i) { | std::list<std::string>::iterator names_i = cv->index_group_names.begin(); |
| | std::list<std::vector<int> >::iterator index_groups_i = cv->index_groups.begin(); |
| | for ( ; names_i != cv->index_group_names.end() ; ++names_i, ++index_groups_i) { |
| if (*names_i == index_group_name) | if (*names_i == index_group_name) |
| break; | break; |
| } | } |
| | |
| if (names_i == cvm::index_group_names.end()) { | if (names_i == cv->index_group_names.end()) { |
| cvm::error("Error: could not find index group "+ | cvm::error("Error: could not find index group "+ |
| index_group_name+" among those provided by the index file.\n", | index_group_name+" among those provided by the index file.\n", |
| INPUT_ERROR); | INPUT_ERROR); |