#include <colvarcomp.h>
Inheritance diagram for colvar::coordnum:
Public Types | |||||||||||||||
enum | { ef_null = 0, ef_gradients = 1, ef_anisotropic = (1<<8), ef_use_pairlist = (1<<9), ef_rebuild_pairlist = (1<<10) } | ||||||||||||||
Public Methods | |||||||||||||||
coordnum (std::string const &conf) | |||||||||||||||
~coordnum () | |||||||||||||||
virtual void | calc_value () | ||||||||||||||
\brief Calculate the variable. More... | |||||||||||||||
virtual void | calc_gradients () | ||||||||||||||
\brief Calculate the atomic gradients, to be reused later in order to apply forces. More... | |||||||||||||||
virtual void | apply_force (colvarvalue const &force) | ||||||||||||||
\brief Apply the collective variable force, by communicating the atomic forces to the simulation program (Note: the ft member is not altered by this function) Note: multiple calls to this function within the same simulation step will add the forces altogether
| |||||||||||||||
virtual cvm::real | dist2 (colvarvalue const &x1, colvarvalue const &x2) const | ||||||||||||||
\brief Square distance between x1 and x2 (can be redefined to transparently implement constraints, symmetries and periodicities) colvar::cvc::dist2() and the related functions are declared as "const" functions, but not "static", because additional parameters defining the metrics (e.g. the periodicity) may be specific to each colvar::cvc object. If symmetries or periodicities are present, the colvar::cvc::dist2() should be redefined to return the "closest distance" value and colvar::cvc::dist2_lgrad(), colvar::cvc::dist2_rgrad() to return its gradients. If constraints are present (and not already implemented by any of the colvarvalue types), the colvar::cvc::dist2_lgrad() and colvar::cvc::dist2_rgrad() functions should be redefined to provide a gradient which is compatible with the constraint, i.e. already deprived of its component normal to the constraint hypersurface. Finally, another useful application, if you are performing very many operations with these functions, could be to override the colvarvalue member functions and access directly its member data. For instance: to define dist2(x1,x2) as (x2.real_value-x1.real_value)*(x2.real_value-x1.real_value) in case of a scalar colvarvalue type. More... | |||||||||||||||
virtual colvarvalue | dist2_lgrad (colvarvalue const &x1, colvarvalue const &x2) const | ||||||||||||||
\brief Gradient(with respect to x1) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities). More... | |||||||||||||||
virtual colvarvalue | dist2_rgrad (colvarvalue const &x1, colvarvalue const &x2) const | ||||||||||||||
\brief Gradient(with respect to x2) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities). More... | |||||||||||||||
template<int flags> int | compute_coordnum () | ||||||||||||||
Workhorse function. More... | |||||||||||||||
template<int flags> void | main_loop (bool **pairlist_elem) | ||||||||||||||
Workhorse function. More... | |||||||||||||||
Static Public Methods | |||||||||||||||
template<int flags> cvm::real | switching_function (cvm::real const &r0, cvm::rvector const &r0_vec, int en, int ed, cvm::atom &A1, cvm::atom &A2, bool **pairlist_elem, cvm::real tolerance) | ||||||||||||||
\brief Calculate a coordination number through the function (1-x**n)/(1-x**m), where x = |A1-A2|/r0
| |||||||||||||||
Protected Attributes | |||||||||||||||
cvm::atom_group * | group1 | ||||||||||||||
First atom group. More... | |||||||||||||||
cvm::atom_group * | group2 | ||||||||||||||
Second atom group. More... | |||||||||||||||
cvm::real | r0 | ||||||||||||||
\brief "Cutoff" for isotropic calculation (default). More... | |||||||||||||||
cvm::rvector | r0_vec | ||||||||||||||
\brief "Cutoff vector" for anisotropic calculation. More... | |||||||||||||||
bool | b_anisotropic | ||||||||||||||
\brief Whether r/r0 or \vec{r}*\vec{1/r0_vec} should be used. More... | |||||||||||||||
int | en | ||||||||||||||
Integer exponent of the function numerator. More... | |||||||||||||||
int | ed | ||||||||||||||
Integer exponent of the function denominator. More... | |||||||||||||||
bool | b_group2_center_only | ||||||||||||||
If true, group2 will be treated as a single atom. More... | |||||||||||||||
cvm::real | tolerance | ||||||||||||||
Tolerance for the pair list. More... | |||||||||||||||
int | pairlist_freq | ||||||||||||||
Frequency of update of the pair list. More... | |||||||||||||||
bool * | pairlist | ||||||||||||||
Pair list. More... |
Definition at line 895 of file colvarcomp.h.
|
Definition at line 941 of file colvarcomp.h. |
|
|
Definition at line 187 of file colvarcomp_coordnums.C. |
|
\brief Apply the collective variable force, by communicating the atomic forces to the simulation program (Note: the ft member is not altered by this function) Note: multiple calls to this function within the same simulation step will add the forces altogether
Implements colvar::cvc. Definition at line 288 of file colvarcomp_coordnums.C. References force, group1, group2, and colvarvalue::real_value. |
|
\brief Calculate the atomic gradients, to be reused later in order to apply forces.
Reimplemented from colvar::cvc. Definition at line 282 of file colvarcomp_coordnums.C. |
|
\brief Calculate the variable.
Implements colvar::cvc. Definition at line 271 of file colvarcomp_coordnums.C. References colvardeps::f_cvc_gradient, colvardeps::is_enabled, colvarvalue::real_value, and colvar::cvc::x. |
|
Workhorse function.
Definition at line 222 of file colvarcomp_coordnums.C. References ef_anisotropic, ef_rebuild_pairlist, ef_use_pairlist, NULL, pairlist, pairlist_freq, and colvarmodule::step_relative. |
|
\brief Square distance between x1 and x2 (can be redefined to transparently implement constraints, symmetries and periodicities) colvar::cvc::dist2() and the related functions are declared as "const" functions, but not "static", because additional parameters defining the metrics (e.g. the periodicity) may be specific to each colvar::cvc object. If symmetries or periodicities are present, the colvar::cvc::dist2() should be redefined to return the "closest distance" value and colvar::cvc::dist2_lgrad(), colvar::cvc::dist2_rgrad() to return its gradients. If constraints are present (and not already implemented by any of the colvarvalue types), the colvar::cvc::dist2_lgrad() and colvar::cvc::dist2_rgrad() functions should be redefined to provide a gradient which is compatible with the constraint, i.e. already deprived of its component normal to the constraint hypersurface. Finally, another useful application, if you are performing very many operations with these functions, could be to override the colvarvalue member functions and access directly its member data. For instance: to define dist2(x1,x2) as (x2.real_value-x1.real_value)*(x2.real_value-x1.real_value) in case of a scalar colvarvalue type.
Reimplemented from colvar::cvc. |
|
\brief Gradient(with respect to x1) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities).
Reimplemented from colvar::cvc. |
|
\brief Gradient(with respect to x2) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities).
Reimplemented from colvar::cvc. |
|
Workhorse function.
Definition at line 195 of file colvarcomp_coordnums.C. References ed, en, group1, group2, r0, r0_vec, colvarvalue::real_value, tolerance, and colvar::cvc::x. |
|
\brief Calculate a coordination number through the function (1-x**n)/(1-x**m), where x = |A1-A2|/r0
Definition at line 20 of file colvarcomp_coordnums.C. References ed, ef_anisotropic, ef_gradients, ef_rebuild_pairlist, ef_use_pairlist, en, colvarmodule::integer_power, colvarmodule::position_distance, r0, and r0_vec. |
|
\brief Whether r/r0 or \vec{r}*\vec{1/r0_vec} should be used.
Definition at line 908 of file colvarcomp.h. Referenced by coordnum. |
|
If true, group2 will be treated as a single atom.
Definition at line 915 of file colvarcomp.h. Referenced by coordnum. |
|
Integer exponent of the function denominator.
Definition at line 912 of file colvarcomp.h. Referenced by coordnum, main_loop, and switching_function. |
|
Integer exponent of the function numerator.
Definition at line 910 of file colvarcomp.h. Referenced by coordnum, main_loop, and switching_function. |
|
First atom group.
Definition at line 900 of file colvarcomp.h. Referenced by apply_force, coordnum, and main_loop. |
|
Second atom group.
Definition at line 902 of file colvarcomp.h. Referenced by apply_force, coordnum, and main_loop. |
|
Pair list.
Definition at line 924 of file colvarcomp.h. Referenced by compute_coordnum, coordnum, and ~coordnum. |
|
Frequency of update of the pair list.
Definition at line 921 of file colvarcomp.h. Referenced by compute_coordnum, and coordnum. |
|
\brief "Cutoff" for isotropic calculation (default).
Definition at line 904 of file colvarcomp.h. Referenced by coordnum, main_loop, and switching_function. |
|
\brief "Cutoff vector" for anisotropic calculation.
Definition at line 906 of file colvarcomp.h. Referenced by coordnum, main_loop, and switching_function. |
|
Tolerance for the pair list.
Definition at line 918 of file colvarcomp.h. |