Collective Variables Module - Developer Documentation
|
Stores numeric id, mass and all mutable data for an atom, mostly used by a colvar::cvc. More...
#include <colvaratoms.h>
Public Member Functions | |
atom () | |
Default constructor (sets index and id both to -1) | |
atom (int atom_number) | |
Initialize an atom for collective variable calculation and get its internal identifier. More... | |
atom (cvm::residue_id const &residue, std::string const &atom_name, std::string const &segment_id) | |
Initialize an atom for collective variable calculation and get its internal identifier. More... | |
atom (atom const &a) | |
Copy constructor. | |
~atom () | |
Destructor. | |
atom & | operator= (atom const &a) |
Assignment operator (added to appease LGTM) | |
void | reset_data () |
Set mutable data (everything except id and mass) to zero. | |
void | update_mass () |
Get the latest value of the mass. | |
void | update_charge () |
Get the latest value of the charge. | |
void | read_position () |
Get the current position. | |
void | read_velocity () |
Get the current velocity. | |
void | read_total_force () |
Get the total force. | |
void | apply_force (cvm::rvector const &new_force) const |
Apply a force to the atom. More... | |
Public Attributes | |
int | id |
Identifier for the MD program (0-based) | |
cvm::real | mass |
Mass. | |
cvm::real | charge |
Charge. | |
cvm::atom_pos | pos |
Current position (copied from the program, can be modified if necessary) | |
cvm::rvector | vel |
Current velocity (copied from the program, can be modified if necessary) | |
cvm::rvector | total_force |
System force at the previous step (copied from the program, can be modified if necessary) | |
cvm::rvector | grad |
Gradient of a scalar collective variable with respect to this atom. More... | |
Protected Attributes | |
int | index |
Index in the colvarproxy arrays (NOT in the global topology!) | |
Stores numeric id, mass and all mutable data for an atom, mostly used by a colvar::cvc.
This class may be used to keep atomic data such as id, mass, position and collective variable derivatives) altogether. There may be multiple instances with identical numeric id, all acting independently: forces communicated through these instances will be summed together.
cvm::atom::atom | ( | int | atom_number | ) |
Initialize an atom for collective variable calculation and get its internal identifier.
atom_number | Atom index in the system topology (1-based) |
cvm::atom::atom | ( | cvm::residue_id const & | residue, |
std::string const & | atom_name, | ||
std::string const & | segment_id | ||
) |
Initialize an atom for collective variable calculation and get its internal identifier.
residue | Residue number |
atom_name | Name of the atom in the residue |
segment_id | For PSF topologies, the segment identifier; for other type of topologies, may not be required |
|
inline |
Apply a force to the atom.
Note: the force is not applied instantly, but will be used later by the MD integrator (the colvars module does not integrate equations of motion.
Multiple calls to this function by either the same atom object or different objects with identical id will all be added together.
cvm::rvector colvarmodule::atom::grad |
Gradient of a scalar collective variable with respect to this atom.
This can only handle a scalar collective variable (i.e. when the colvarvalue::real_value member is used from the colvarvalue class), which is also the most frequent case. For more complex types of colvarvalue objects, atomic gradients should be defined within the specific colvar::cvc implementation