colvarmodule::atom_group Class Reference
\brief Group of
atom objects, mostly used by a
colvar::cvc object to gather all atomic data.
More...
#include <colvaratoms.h>
Inheritance diagram for colvarmodule::atom_group:
List of all members.
Public Methods
\brief Default constructor. More...
\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...
\brief Set default values for common flags. More...
\brief Initialize dependency tree. More...
\brief Update data required to calculate cvc's. More...
\brief Initialize the group by looking up its configuration string in conf and parsing it. More...
\brief Add an atom ID to this group (the actual atomicdata will be not be handled by the group). More...
Set this group as a dummy group (no actual atoms). More...
If this group is dummy, set the corresponding position. More...
\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...
\brief Implementation of the feature list accessor for atom group. More...
cvm::atom const &
operator[] (size_t const i) const
std::vector< int > const &
ids () const
Internal atom IDs (populated during initialization). More...
Allocates and populates sorted_ids and sorted_ids_map. More...
Sorted internal atom IDs (populated on-demand by create_sorted_ids); used to read coordinate files. More...
Map entries of sorted_atoms_ids onto the original positions in the group. More...
Update the total mass of the group. More...
\brief Get the current positions. More...
\brief (Re)calculate the optimal roto-translation. More...
\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...
\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...
\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...
\brief Recompute all mutable quantities that are required to compute CVCs. More...
\brief Return a copy of the current atom positions. More...
\brief Calculate the center of geometry of the atomic positions, assuming that they are already pbc-wrapped. More...
\brief Return the center of geometry of the atomic positions. More...
\brief Calculate the center of mass of the atomic positions, assuming that they are already pbc-wrapped. More...
\brief Return the center of mass (COM) of the atomic positions. More...
\brief Return previously gradient of scalar variable with respect to the COM. More...
\brief Return a copy of the current atom positions, shifted by a constant vector. More...
\brief Return a copy of the current atom velocities. More...
\brief Calculate the dipole of the atom group around the specified center. More...
\brief Return the (previously calculated) dipole of the atom group. More...
\brief Return a copy of the total forces. More...
\brief Return a copy of the aggregated total force on the group. More...
\brief Shorthand: save the specified gradient on each atom, weighting with the atom mass (mostly used in combination with center_of_mass). More...
\brief Calculate the derivatives of the fitting transformation. More...
\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...
\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...
Implements possible actions to be carried out when a given feature is enabled This overloads the base function in colvardeps. More...
Static Public Methods
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
\brief Optional name to reuse properties of this in other groups. More...
\brief Keyword used to define the group. More...
\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...
\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...
\brief use reference coordinates for f_ag_center or f_ag_rotate. More...
\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...
\brief If f_ag_center or f_ag_rotate is true, use this group to define the transformation (default: this group itself). More...
\brief Don't apply any force on this group (use its coordinates only to calculate a colvar). More...
\brief Derivatives of the fitting transformation. More...
Static Public Attributes
\brief Implementation of the feature list for atom group. More...
Protected Attributes
std::vector< cvm::atom >
atoms
Sorted list of internal atom IDs (populated on-demand by create_sorted_ids); used to read coordinate files. More...
Map entries of sorted_atoms_ids onto the original positions in the group. More...
Detailed Description
\brief Group of
atom objects, mostly used by a
colvar::cvc object to gather all atomic data.
Definition at line 154 of file colvaratoms.h.
Constructor & Destructor Documentation
atom_group::atom_group
(
)
\brief Default constructor.
atom_group::atom_group
(
char const *
key
)
\brief Create a group object, assign a name to it.
atom_group::atom_group
(
std::vector< cvm::atom > const &
atoms_in
)
\brief Initialize the group after a (temporary) vector of atoms.
atom_group::~atom_group
(
)
Member Function Documentation
int atom_group::add_atom
(
cvm::atom const &
a
)
\brief Add an atom object to this group.
int atom_group::add_atom_id
(
int
aid
)
\brief Add an atom ID to this group (the actual atomicdata will be not be handled by the group).
int atom_group::add_atom_name_residue_range
(
std::string const &
psf_segid,
)
int atom_group::add_atom_numbers
(
std::string const &
numbers_conf
)
int atom_group::add_atom_numbers_range
(
std::string const &
range_conf
)
int atom_group::add_atoms_of_group
(
atom_group const *
ag
)
int atom_group::add_index_group
(
std::string const &
index_group_name
)
void atom_group::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.
void atom_group::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.
void atom_group::apply_translation
(
cvm::rvector const &
t
)
\brief Move all positions.
void atom_group::calc_apply_roto_translation
(
)
\brief (Re)calculate the optimal roto-translation.
int atom_group::calc_center_of_geometry
(
)
\brief Calculate the center of geometry of the atomic positions, assuming that they are already pbc-wrapped.
int atom_group::calc_center_of_mass
(
)
\brief Calculate the center of mass of the atomic positions, assuming that they are already pbc-wrapped.
int atom_group::calc_dipole
(
cvm::atom_pos const &
dipole_center
)
\brief Calculate the dipole of the atom group around the specified center.
void atom_group::calc_fit_gradients
(
)
\brief Calculate the derivatives of the fitting transformation.
int atom_group::calc_required_properties
(
)
\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.
cvm::rvector atom_group::center_of_mass_scalar_gradient
(
)
const [inline]
\brief Return previously gradient of scalar variable with respect to the COM.
Definition at line 453 of file colvaratoms.h.
void atom_group::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).
int atom_group::create_sorted_ids
(
)
Allocates and populates sorted_ids and sorted_ids_map.
void atom_group::delete_features
(
)
[inline, static]
cvm::rvector atom_group::dipole
(
)
const [inline]
\brief Return the (previously calculated) dipole of the atom group.
Definition at line 475 of file colvaratoms.h.
void atom_group::do_feature_side_effects
(
int
id
)
[virtual]
Implements possible actions to be carried out when a given feature is enabled This overloads the base function in colvardeps.
Reimplemented from colvardeps.
virtual const std::vector<
feature *>& atom_group::features
(
)
const
[inline, virtual]
std::vector<int> const& atom_group::ids
(
)
const [inline]
\brief Set default values for common flags.
virtual int atom_group::init_dependencies
(
)
[virtual]
\brief Initialize dependency tree.
Implements colvardeps.
virtual std::vector<
feature *>& atom_group::modify_features
(
)
[inline, virtual]
cvm::atom const& atom_group::operator[]
(
size_t const
i
)
const [inline]
cvm::atom& atom_group::operator[]
(
size_t const
i
)
[inline]
int atom_group::overlap
(
const atom_group &
g1,
const atom_group &
g2
)
[static]
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.
int atom_group::parse_fitting_options
(
std::string const &
group_conf
)
\brief Return a copy of the current atom positions.
std::vector<
cvm::atom_pos> atom_group::positions_shifted
(
cvm::rvector const &
shift
)
const
\brief Return a copy of the current atom positions, shifted by a constant vector.
void atom_group::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.
void atom_group::read_positions
(
)
\brief Get the current positions.
void atom_group::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.
void atom_group::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.
\brief Remove an atom object from this group.
void atom_group::reset_atoms_data
(
)
[inline]
int atom_group::set_dummy
(
)
Set this group as a dummy group (no actual atoms).
If this group is dummy, set the corresponding position.
void atom_group::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).
int atom_group::setup
(
)
\brief Update data required to calculate cvc's.
size_t atom_group::size
(
)
const [inline]
std::vector<int> const& atom_group::sorted_ids
(
)
const [inline]
Sorted internal atom IDs (populated on-demand by create_sorted_ids); used to read coordinate files.
Definition at line 315 of file colvaratoms.h.
std::vector<int> const& atom_group::sorted_ids_map
(
)
const [inline]
Map entries of sorted_atoms_ids onto the original positions in the group.
Definition at line 321 of file colvaratoms.h.
cvm::rvector atom_group::total_force
(
)
const
\brief Return a copy of the aggregated total force on the group.
std::vector<cvm::rvector> atom_group::total_forces
(
)
const
\brief Return a copy of the total forces.
void atom_group::update_total_charge
(
)
Update the total mass of the group.
void atom_group::update_total_mass
(
)
Update the total mass of the atom group.
std::vector<cvm::rvector> atom_group::velocities
(
)
const
\brief Return a copy of the current atom velocities.
Member Data Documentation
std::vector<
feature *> colvarmodule::atom_group::ag_features
[static]
\brief Implementation of the feature list for atom group.
Definition at line 221 of file colvaratoms.h.
std::vector<cvm::atom> colvarmodule::atom_group::atoms [protected]
std::vector<int> colvarmodule::atom_group::atoms_ids [protected]
bool colvarmodule::atom_group::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.
Definition at line 300 of file colvaratoms.h.
bool colvarmodule::atom_group::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.
Definition at line 336 of file colvaratoms.h.
cvm::atom_pos colvarmodule::atom_group::dummy_atom_pos
[protected]
std::vector<
cvm::atom_pos> colvarmodule::atom_group::fit_gradients
\brief Derivatives of the fitting transformation.
Definition at line 496 of file colvaratoms.h.
atom_group* colvarmodule::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).
Definition at line 348 of file colvaratoms.h.
int colvarmodule::atom_group::index [protected]
\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.
bool colvarmodule::atom_group::noforce
\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.
cvm::rotation colvarmodule::atom_group::rot
std::vector<int> colvarmodule::atom_group::sorted_atoms_ids [protected]
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.
std::vector<int> colvarmodule::atom_group::sorted_atoms_ids_map [protected]
Map entries of sorted_atoms_ids onto the original positions in the group.
Definition at line 252 of file colvaratoms.h.
cvm::real colvarmodule::atom_group::total_charge
cvm::real colvarmodule::atom_group::total_mass
The documentation for this class was generated from the following file:
Generated on Mon Nov 17 02:48:00 2025 for VMD (current) by
doxygen1.2.14 written by Dimitri van Heesch,
© 1997-2002