#include <colvaratoms.h>
Inheritance diagram for colvarmodule::atom_group:
Public Methods | |
atom_group () | |
\brief Default constructor. More... | |
atom_group (char const *key) | |
\brief Create a group object, assign a name to it. More... | |
atom_group (std::vector< cvm::atom > const &atoms_in) | |
\brief Initialize the group after a (temporary) vector of atoms. More... | |
~atom_group () | |
\brief Destructor. More... | |
int | init () |
\brief Set default values for common flags. More... | |
virtual int | init_dependencies () |
\brief Initialize dependency tree. More... | |
int | setup () |
\brief Update data required to calculate cvc's. More... | |
int | parse (std::string const &conf) |
\brief Initialize the group by looking up its configuration string in conf and parsing it. More... | |
int | add_atom_numbers (std::string const &numbers_conf) |
int | add_atoms_of_group (atom_group const *ag) |
int | add_index_group (std::string const &index_group_name) |
int | add_atom_numbers_range (std::string const &range_conf) |
int | add_atom_name_residue_range (std::string const &psf_segid, std::string const &range_conf) |
int | parse_fitting_options (std::string const &group_conf) |
int | add_atom (cvm::atom const &a) |
\brief Add an atom object to this group. More... | |
int | add_atom_id (int aid) |
\brief Add an atom ID to this group (the actual atomicdata will be not be handled by the group). More... | |
int | remove_atom (cvm::atom_iter ai) |
\brief Remove an atom object from this group. More... | |
int | set_dummy () |
Set this group as a dummy group (no actual atoms). More... | |
int | set_dummy_pos (cvm::atom_pos const &pos) |
If this group is dummy, set the corresponding position. More... | |
void | print_properties (std::string const &colvar_name, int i, int j) |
\brief Print the updated the total mass and charge of a group. This is needed in case the hosting MD code has an option to change atom masses after their initialization. More... | |
virtual const std::vector< feature * > & | features () const |
\brief Implementation of the feature list accessor for atom group. More... | |
virtual std::vector< feature * > & | modify_features () |
cvm::atom & | operator[] (size_t const i) |
cvm::atom const & | operator[] (size_t const i) const |
cvm::atom_iter | begin () |
cvm::atom_const_iter | begin () const |
cvm::atom_iter | end () |
cvm::atom_const_iter | end () const |
size_t | size () const |
std::vector< int > const & | ids () const |
Internal atom IDs (populated during initialization). More... | |
std::string const | print_atom_ids () const |
int | create_sorted_ids () |
Allocates and populates sorted_ids and sorted_ids_map. More... | |
std::vector< int > const & | sorted_ids () const |
Sorted internal atom IDs (populated on-demand by create_sorted_ids); used to read coordinate files. More... | |
std::vector< int > const & | sorted_ids_map () const |
Map entries of sorted_atoms_ids onto the original positions in the group. More... | |
void | update_total_mass () |
Update the total mass of the atom group. More... | |
void | update_total_charge () |
Update the total mass of the group. More... | |
void | read_positions () |
\brief Get the current positions. More... | |
void | calc_apply_roto_translation () |
\brief (Re)calculate the optimal roto-translation. More... | |
void | center_ref_pos () |
\brief Save aside the center of geometry of the reference positions, then subtract it from them In this way it will be possible to use ref_pos also for the rotational fit. This is called either by atom_group::parse or by CVCs that assign reference positions (eg. RMSD, eigenvector). More... | |
void | apply_translation (cvm::rvector const &t) |
\brief Move all positions. More... | |
void | read_velocities () |
\brief Get the current velocities; this must be called always *after* read_positions(); if f_ag_rotate is defined, the same rotation applied to the coordinates will be used. More... | |
void | read_total_forces () |
\brief Get the current total_forces; this must be called always *after* read_positions(); if f_ag_rotate is defined, the same rotation applied to the coordinates will be used. More... | |
void | reset_atoms_data () |
Call reset_data() for each atom. More... | |
int | calc_required_properties () |
\brief Recompute all mutable quantities that are required to compute CVCs. More... | |
std::vector< cvm::atom_pos > | positions () const |
\brief Return a copy of the current atom positions. More... | |
int | calc_center_of_geometry () |
\brief Calculate the center of geometry of the atomic positions, assuming that they are already pbc-wrapped. More... | |
cvm::atom_pos | center_of_geometry () const |
\brief Return the center of geometry of the atomic positions. More... | |
int | calc_center_of_mass () |
\brief Calculate the center of mass of the atomic positions, assuming that they are already pbc-wrapped. More... | |
cvm::atom_pos | center_of_mass () const |
\brief Return the center of mass (COM) of the atomic positions. More... | |
cvm::rvector | center_of_mass_scalar_gradient () const |
\brief Return previously gradient of scalar variable with respect to the COM. More... | |
std::vector< cvm::atom_pos > | positions_shifted (cvm::rvector const &shift) const |
\brief Return a copy of the current atom positions, shifted by a constant vector. More... | |
std::vector< cvm::rvector > | velocities () const |
\brief Return a copy of the current atom velocities. More... | |
int | calc_dipole (cvm::atom_pos const &dipole_center) |
\brief Calculate the dipole of the atom group around the specified center. More... | |
cvm::rvector | dipole () const |
\brief Return the (previously calculated) dipole of the atom group. More... | |
std::vector< cvm::rvector > | total_forces () const |
\brief Return a copy of the total forces. More... | |
cvm::rvector | total_force () const |
\brief Return a copy of the aggregated total force on the group. More... | |
void | set_weighted_gradient (cvm::rvector const &grad) |
\brief Shorthand: save the specified gradient on each atom, weighting with the atom mass (mostly used in combination with center_of_mass). More... | |
void | calc_fit_gradients () |
\brief Calculate the derivatives of the fitting transformation. More... | |
void | apply_colvar_force (cvm::real const &force) |
\brief Used by a (scalar) colvar to apply its force on its atom_group members The (scalar) force is multiplied by the colvar gradient for each atom; this should be used when a colvar with scalar colvarvalue type is used (this is the most frequent case: for colvars with a non-scalar type, the most convenient solution is to sum together the Cartesian forces from all the colvar components, and use apply_force() or apply_forces()). If the group is being rotated to a reference frame (e.g. to express the colvar independently from the solute rotation), the gradients are temporarily rotated to the original frame. More... | |
void | apply_force (cvm::rvector const &force) |
\brief Apply a force "to the center of mass", i.e. the force is distributed on each atom according to its mass If the group is being rotated to a reference frame (e.g. to express the colvar independently from the solute rotation), the force is rotated back to the original frame. Colvar gradients are not used, either because they were not defined (e.g because the colvar has not a scalar value) or the biases require to micromanage the force. This function will be phased out eventually, in favor of apply_colvar_force() once that is implemented for non-scalar values. More... | |
void | do_feature_side_effects (int id) |
Implements possible actions to be carried out when a given feature is enabled This overloads the base function in colvardeps. More... | |
Static Public Methods | |
void | delete_features () |
int | overlap (const atom_group &g1, const atom_group &g2) |
Detect whether two groups share atoms If yes, returns 1-based number of a common atom; else, returns 0. More... | |
Public Attributes | |
std::string | name |
\brief Optional name to reuse properties of this in other groups. More... | |
std::string | key |
\brief Keyword used to define the group. More... | |
bool | b_dummy |
\brief If this option is on, this group merely acts as a wrapper for a fixed position; any calls to atoms within or to functions that return disaggregated data will fail. More... | |
cvm::rotation | rot |
The rotation calculated automatically if f_ag_rotate is defined. More... | |
bool | b_user_defined_fit |
\brief Indicates that the user has explicitly set centerToReference or rotateReference, and the corresponding reference: cvc's (eg rmsd, eigenvector) will not override the user's choice. More... | |
std::vector< cvm::atom_pos > | ref_pos |
\brief use reference coordinates for f_ag_center or f_ag_rotate. More... | |
cvm::atom_pos | ref_pos_cog |
\brief Center of geometry of the reference coordinates; regardless of whether f_ag_center is true, ref_pos is centered to zero at initialization, and ref_pos_cog serves to center the positions. More... | |
atom_group * | fitting_group |
\brief If f_ag_center or f_ag_rotate is true, use this group to define the transformation (default: this group itself). More... | |
cvm::real | total_mass |
Total mass of the atom group. More... | |
cvm::real | total_charge |
Total charge of the atom group. More... | |
bool | noforce |
\brief Don't apply any force on this group (use its coordinates only to calculate a colvar). More... | |
std::vector< cvm::atom_pos > | fit_gradients |
\brief Derivatives of the fitting transformation. More... | |
Static Public Attributes | |
std::vector< feature * > | ag_features |
\brief Implementation of the feature list for atom group. More... | |
Protected Attributes | |
std::vector< cvm::atom > | atoms |
\brief Array of atom objects. More... | |
std::vector< int > | atoms_ids |
\brief Internal atom IDs for host code. More... | |
std::vector< int > | sorted_atoms_ids |
Sorted list of internal atom IDs (populated on-demand by create_sorted_ids); used to read coordinate files. More... | |
std::vector< int > | sorted_atoms_ids_map |
Map entries of sorted_atoms_ids onto the original positions in the group. More... | |
cvm::atom_pos | dummy_atom_pos |
\brief Dummy atom position. More... | |
int | index |
\brief Index in the colvarproxy arrays (if the group is scalable). More... |
Definition at line 154 of file colvaratoms.h.
|
\brief Default constructor.
|
|
\brief Create a group object, assign a name to it.
|
|
\brief Initialize the group after a (temporary) vector of atoms.
|
|
\brief Destructor.
|
|
\brief Add an atom object to this group.
|
|
\brief Add an atom ID to this group (the actual atomicdata will be not be handled by the group).
|
|
|
|
|
|
|
|
|
|
|
|
\brief Used by a (scalar) colvar to apply its force on its atom_group members The (scalar) force is multiplied by the colvar gradient for each atom; this should be used when a colvar with scalar colvarvalue type is used (this is the most frequent case: for colvars with a non-scalar type, the most convenient solution is to sum together the Cartesian forces from all the colvar components, and use apply_force() or apply_forces()). If the group is being rotated to a reference frame (e.g. to express the colvar independently from the solute rotation), the gradients are temporarily rotated to the original frame.
|
|
\brief Apply a force "to the center of mass", i.e. the force is distributed on each atom according to its mass If the group is being rotated to a reference frame (e.g. to express the colvar independently from the solute rotation), the force is rotated back to the original frame. Colvar gradients are not used, either because they were not defined (e.g because the colvar has not a scalar value) or the biases require to micromanage the force. This function will be phased out eventually, in favor of apply_colvar_force() once that is implemented for non-scalar values.
|
|
\brief Move all positions.
|
|
Definition at line 277 of file colvaratoms.h. References atoms. |
|
Definition at line 272 of file colvaratoms.h. References atoms. |
|
\brief (Re)calculate the optimal roto-translation.
|
|
\brief Calculate the center of geometry of the atomic positions, assuming that they are already pbc-wrapped.
|
|
\brief Calculate the center of mass of the atomic positions, assuming that they are already pbc-wrapped.
|
|
\brief Calculate the dipole of the atom group around the specified center.
|
|
\brief Calculate the derivatives of the fitting transformation.
|
|
\brief Recompute all mutable quantities that are required to compute CVCs.
|
|
\brief Return the center of geometry of the atomic positions.
Definition at line 424 of file colvaratoms.h. |
|
\brief Return the center of mass (COM) of the atomic positions.
Definition at line 446 of file colvaratoms.h. |
|
\brief Return previously gradient of scalar variable with respect to the COM.
Definition at line 453 of file colvaratoms.h. |
|
\brief Save aside the center of geometry of the reference positions, then subtract it from them In this way it will be possible to use ref_pos also for the rotational fit. This is called either by atom_group::parse or by CVCs that assign reference positions (eg. RMSD, eigenvector).
|
|
Allocates and populates sorted_ids and sorted_ids_map.
|
|
Definition at line 232 of file colvaratoms.h. |
|
\brief Return the (previously calculated) dipole of the atom group.
Definition at line 475 of file colvaratoms.h. |
|
Implements possible actions to be carried out when a given feature is enabled This overloads the base function in colvardeps.
Reimplemented from colvardeps. |
|
Definition at line 287 of file colvaratoms.h. References atoms. |
|
Definition at line 282 of file colvaratoms.h. References atoms. |
|
\brief Implementation of the feature list accessor for atom group.
Implements colvardeps. Definition at line 224 of file colvaratoms.h. |
|
Internal atom IDs (populated during initialization).
Definition at line 303 of file colvaratoms.h. |
|
\brief Set default values for common flags.
|
|
\brief Initialize dependency tree.
Implements colvardeps. |
|
Implements colvardeps. Definition at line 228 of file colvaratoms.h. |
|
Definition at line 267 of file colvaratoms.h. References atoms. |
|
Definition at line 262 of file colvaratoms.h. References atoms. |
|
Detect whether two groups share atoms If yes, returns 1-based number of a common atom; else, returns 0.
|
|
\brief Initialize the group by looking up its configuration string in conf and parsing it.
|
|
|
|
\brief Return a copy of the current atom positions.
|
|
\brief Return a copy of the current atom positions, shifted by a constant vector.
|
|
|
|
\brief Print the updated the total mass and charge of a group. This is needed in case the hosting MD code has an option to change atom masses after their initialization.
|
|
\brief Get the current positions.
|
|
\brief Get the current total_forces; this must be called always *after* read_positions(); if f_ag_rotate is defined, the same rotation applied to the coordinates will be used.
|
|
\brief Get the current velocities; this must be called always *after* read_positions(); if f_ag_rotate is defined, the same rotation applied to the coordinates will be used.
|
|
\brief Remove an atom object from this group.
|
|
Call reset_data() for each atom.
Definition at line 395 of file colvaratoms.h. References atoms. |
|
Set this group as a dummy group (no actual atoms).
|
|
If this group is dummy, set the corresponding position.
|
|
\brief Shorthand: save the specified gradient on each atom, weighting with the atom mass (mostly used in combination with center_of_mass).
|
|
\brief Update data required to calculate cvc's.
|
|
Definition at line 292 of file colvaratoms.h. References atoms. |
|
Sorted internal atom IDs (populated on-demand by create_sorted_ids); used to read coordinate files.
Definition at line 315 of file colvaratoms.h. |
|
Map entries of sorted_atoms_ids onto the original positions in the group.
Definition at line 321 of file colvaratoms.h. |
|
\brief Return a copy of the aggregated total force on the group.
|
|
\brief Return a copy of the total forces.
|
|
Update the total mass of the group.
|
|
Update the total mass of the atom group.
|
|
\brief Return a copy of the current atom velocities.
|
|
\brief Implementation of the feature list for atom group.
Definition at line 221 of file colvaratoms.h. |
|
\brief Array of atom objects.
Definition at line 242 of file colvaratoms.h. |
|
\brief Internal atom IDs for host code.
Definition at line 245 of file colvaratoms.h. |
|
\brief If this option is on, this group merely acts as a wrapper for a fixed position; any calls to atoms within or to functions that return disaggregated data will fail.
Definition at line 300 of file colvaratoms.h. |
|
\brief Indicates that the user has explicitly set centerToReference or rotateReference, and the corresponding reference: cvc's (eg rmsd, eigenvector) will not override the user's choice.
Definition at line 336 of file colvaratoms.h. |
|
\brief Dummy atom position.
Definition at line 255 of file colvaratoms.h. |
|
\brief Derivatives of the fitting transformation.
Definition at line 496 of file colvaratoms.h. |
|
\brief If f_ag_center or f_ag_rotate is true, use this group to define the transformation (default: this group itself).
Definition at line 348 of file colvaratoms.h. |
|
\brief Index in the colvarproxy arrays (if the group is scalable).
Definition at line 258 of file colvaratoms.h. |
|
\brief Keyword used to define the group.
Definition at line 177 of file colvaratoms.h. |
|
\brief Optional name to reuse properties of this in other groups.
Definition at line 173 of file colvaratoms.h. |
|
\brief Don't apply any force on this group (use its coordinates only to calculate a colvar).
Definition at line 364 of file colvaratoms.h. |
|
\brief use reference coordinates for f_ag_center or f_ag_rotate.
Definition at line 339 of file colvaratoms.h. |
|
\brief Center of geometry of the reference coordinates; regardless of whether f_ag_center is true, ref_pos is centered to zero at initialization, and ref_pos_cog serves to center the positions.
Definition at line 344 of file colvaratoms.h. |
|
The rotation calculated automatically if f_ag_rotate is defined.
Definition at line 331 of file colvaratoms.h. |
|
Sorted list of internal atom IDs (populated on-demand by create_sorted_ids); used to read coordinate files.
Definition at line 249 of file colvaratoms.h. |
|
Map entries of sorted_atoms_ids onto the original positions in the group.
Definition at line 252 of file colvaratoms.h. |
|
Total charge of the atom group.
Definition at line 357 of file colvaratoms.h. |
|
Total mass of the atom group.
Definition at line 351 of file colvaratoms.h. |