Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

colvar::coordnum Class Reference

\brief Colvar component: coordination number between two groups (colvarvalue::type_scalar type, range [0:N1*N2]). More...

#include <colvarcomp.h>

Inheritance diagram for colvar::coordnum:

colvar::cvc colvarparse colvardeps colvarparams List of all members.

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
Parameters:
cvforce  The collective variable force, usually coming from the biases and eventually manipulated by the parent colvar object.
More...


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
Parameters:
r0, r0_vec  "cutoff" for the coordination number (scalar or vector depending on user choice)
en  Numerator exponent
ed  Denominator exponent
First  atom
Second  atom
pairlist_elem  pointer to pair flag for this pair
tolerance  A pair is defined as having a larger coordination than this number.
More...



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...


Detailed Description

\brief Colvar component: coordination number between two groups (colvarvalue::type_scalar type, range [0:N1*N2]).

Definition at line 895 of file colvarcomp.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
ef_null 
ef_gradients 
ef_anisotropic 
ef_use_pairlist 
ef_rebuild_pairlist 

Definition at line 941 of file colvarcomp.h.


Constructor & Destructor Documentation

colvar::coordnum::coordnum std::string const &    conf
 

Definition at line 93 of file colvarcomp_coordnums.C.

References colvarproxy_system::angstrom_to_internal, b_anisotropic, b_group2_center_only, colvarmodule::cite_feature, COLVARS_INPUT_ERROR, conf, ed, en, colvarmodule::error, colvardeps::f_cvc_pbc_minimum_image, colvarparse::get_keyval, group1, group2, colvar::cvc::init_scalar_boundaries, colvardeps::is_enabled, colvarmodule::log, colvarmodule::main, NULL, pairlist, pairlist_freq, colvar::cvc::parse_group, colvarmodule::proxy, r0, r0_vec, colvar::cvc::set_function_type, tolerance, colvarvalue::type, colvarvalue::type_scalar, and colvar::cvc::x.

colvar::coordnum::~coordnum  
 

Definition at line 187 of file colvarcomp_coordnums.C.

References NULL, and pairlist.


Member Function Documentation

void colvar::coordnum::apply_force colvarvalue const &    force [virtual]
 

\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

Parameters:
cvforce  The collective variable force, usually coming from the biases and eventually manipulated by the parent colvar object.

Implements colvar::cvc.

Definition at line 288 of file colvarcomp_coordnums.C.

References force, group1, group2, and colvarvalue::real_value.

void colvar::coordnum::calc_gradients   [virtual]
 

\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.

void colvar::coordnum::calc_value   [virtual]
 

\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.

template<int compute_flags>
int colvar::coordnum::compute_coordnum  
 

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.

virtual cvm::real colvar::coordnum::dist2 colvarvalue const &    x1,
colvarvalue const &    x2
const [virtual]
 

\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.

virtual colvarvalue colvar::coordnum::dist2_lgrad colvarvalue const &    x1,
colvarvalue const &    x2
const [virtual]
 

\brief Gradient(with respect to x1) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities).

Reimplemented from colvar::cvc.

virtual colvarvalue colvar::coordnum::dist2_rgrad colvarvalue const &    x1,
colvarvalue const &    x2
const [virtual]
 

\brief Gradient(with respect to x2) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities).

Reimplemented from colvar::cvc.

template<int flags>
void colvar::coordnum::main_loop bool **    pairlist_elem
 

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.

template<int flags>
cvm::real colvar::coordnum::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
[static]
 

\brief Calculate a coordination number through the function (1-x**n)/(1-x**m), where x = |A1-A2|/r0

Parameters:
r0, r0_vec  "cutoff" for the coordination number (scalar or vector depending on user choice)
en  Numerator exponent
ed  Denominator exponent
First  atom
Second  atom
pairlist_elem  pointer to pair flag for this pair
tolerance  A pair is defined as having a larger coordination than this number.

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.


Member Data Documentation

bool colvar::coordnum::b_anisotropic [protected]
 

\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.

bool colvar::coordnum::b_group2_center_only [protected]
 

If true, group2 will be treated as a single atom.

Definition at line 915 of file colvarcomp.h.

Referenced by coordnum.

int colvar::coordnum::ed [protected]
 

Integer exponent of the function denominator.

Definition at line 912 of file colvarcomp.h.

Referenced by coordnum, main_loop, and switching_function.

int colvar::coordnum::en [protected]
 

Integer exponent of the function numerator.

Definition at line 910 of file colvarcomp.h.

Referenced by coordnum, main_loop, and switching_function.

cvm::atom_group* colvar::coordnum::group1 [protected]
 

First atom group.

Definition at line 900 of file colvarcomp.h.

Referenced by apply_force, coordnum, and main_loop.

cvm::atom_group* colvar::coordnum::group2 [protected]
 

Second atom group.

Definition at line 902 of file colvarcomp.h.

Referenced by apply_force, coordnum, and main_loop.

bool* colvar::coordnum::pairlist [protected]
 

Pair list.

Definition at line 924 of file colvarcomp.h.

Referenced by compute_coordnum, coordnum, and ~coordnum.

int colvar::coordnum::pairlist_freq [protected]
 

Frequency of update of the pair list.

Definition at line 921 of file colvarcomp.h.

Referenced by compute_coordnum, and coordnum.

cvm::real colvar::coordnum::r0 [protected]
 

\brief "Cutoff" for isotropic calculation (default).

Definition at line 904 of file colvarcomp.h.

Referenced by coordnum, main_loop, and switching_function.

cvm::rvector colvar::coordnum::r0_vec [protected]
 

\brief "Cutoff vector" for anisotropic calculation.

Definition at line 906 of file colvarcomp.h.

Referenced by coordnum, main_loop, and switching_function.

cvm::real colvar::coordnum::tolerance [protected]
 

Tolerance for the pair list.

Definition at line 918 of file colvarcomp.h.

Referenced by coordnum, and main_loop.


The documentation for this class was generated from the following files:
Generated on Thu Mar 28 02:45:17 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002