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

colvar::selfcoordnum Class Reference

\brief Colvar component: self-coordination number within a group (colvarvalue::type_scalar type, range [0:N*(N-1)/2]). More...

#include <colvarcomp.h>

Inheritance diagram for colvar::selfcoordnum:

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

Public Methods

 selfcoordnum (std::string const &conf)
 ~selfcoordnum ()
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_selfcoordnum ()
 Main workhorse function. More...


Protected Attributes

cvm::atom_group * group1
 Selected atoms. More...

cvm::real r0
 \brief "Cutoff" for isotropic calculation (default). More...

int en
 Integer exponent of the function numerator. More...

int ed
 Integer exponent of the function denominator. More...

cvm::real tolerance
int pairlist_freq
bool * pairlist

Detailed Description

\brief Colvar component: self-coordination number within a group (colvarvalue::type_scalar type, range [0:N*(N-1)/2]).

Definition at line 978 of file colvarcomp.h.


Constructor & Destructor Documentation

colvar::selfcoordnum::selfcoordnum std::string const &    conf
 

colvar::selfcoordnum::~selfcoordnum  
 

Definition at line 443 of file colvarcomp_coordnums.C.

References NULL, and pairlist.


Member Function Documentation

void colvar::selfcoordnum::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 530 of file colvarcomp_coordnums.C.

References force, group1, and colvarvalue::real_value.

void colvar::selfcoordnum::calc_gradients   [virtual]
 

\brief Calculate the atomic gradients, to be reused later in order to apply forces.

Reimplemented from colvar::cvc.

Definition at line 524 of file colvarcomp_coordnums.C.

void colvar::selfcoordnum::calc_value   [virtual]
 

\brief Calculate the variable.

Implements colvar::cvc.

Definition at line 513 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::selfcoordnum::compute_selfcoordnum  
 

Main workhorse function.

Definition at line 451 of file colvarcomp_coordnums.C.

References ed, en, group1, n, NULL, pairlist, pairlist_freq, r0, colvarvalue::real_value, colvarmodule::step_relative, tolerance, and colvar::cvc::x.

virtual cvm::real colvar::selfcoordnum::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::selfcoordnum::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::selfcoordnum::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.


Member Data Documentation

int colvar::selfcoordnum::ed [protected]
 

Integer exponent of the function denominator.

Definition at line 990 of file colvarcomp.h.

Referenced by compute_selfcoordnum.

int colvar::selfcoordnum::en [protected]
 

Integer exponent of the function numerator.

Definition at line 988 of file colvarcomp.h.

Referenced by compute_selfcoordnum.

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

Selected atoms.

Definition at line 984 of file colvarcomp.h.

Referenced by apply_force, and compute_selfcoordnum.

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

Definition at line 993 of file colvarcomp.h.

Referenced by compute_selfcoordnum, and ~selfcoordnum.

int colvar::selfcoordnum::pairlist_freq [protected]
 

Definition at line 992 of file colvarcomp.h.

Referenced by compute_selfcoordnum.

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

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

Definition at line 986 of file colvarcomp.h.

Referenced by compute_selfcoordnum.

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

Definition at line 991 of file colvarcomp.h.

Referenced by compute_selfcoordnum.


The documentation for this class was generated from the following files:
Generated on Fri Apr 19 02:46:27 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002