#include <colvarcomp.h>
Inheritance diagram for colvar::distance_inv:
Public Methods  
distance_inv (std::string const &conf)  
virtual  ~distance_inv ()  
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_valuex1.real_value)*(x2.real_valuex1.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...  
Protected Attributes  
cvm::atom_group *  group1  
First atom group. More...  
cvm::atom_group *  group2  
Second atom group. More...  
int  exponent  
Components of the distance vector orthogonal to the axis. More... 
Definition at line 559 of file colvarcomp.h.

Definition at line 560 of file colvarcomp_distances.C. References conf, colvarmodule::error, exponent, colvardeps::f_cvc_debug_gradient, colvarparse::get_keyval, group1, group2, colvar::cvc::init_as_distance, colvardeps::is_enabled, colvarmodule::log, colvar::cvc::parse_group, and colvar::cvc::set_function_type. 

Definition at line 571 of file colvarcomp.h. 

\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 645 of file colvarcomp_distances.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 640 of file colvarcomp_distances.C. 

\brief Calculate the variable.
Implements colvar::cvc. Definition at line 596 of file colvarcomp_distances.C. References exponent, colvardeps::f_cvc_pbc_minimum_image, group1, group2, colvarmodule::integer_power, colvardeps::is_enabled, colvarmodule::position_distance, colvarmodule::pow, colvarmodule::real, colvarvalue::real_value, and colvar::cvc::x. 

\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_valuex1.real_value)*(x2.real_valuex1.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. 

Components of the distance vector orthogonal to the axis.
Definition at line 568 of file colvarcomp.h. Referenced by calc_value, and distance_inv. 

First atom group.
Definition at line 564 of file colvarcomp.h. Referenced by apply_force, calc_value, and distance_inv. 

Second atom group.
Definition at line 566 of file colvarcomp.h. Referenced by apply_force, calc_value, and distance_inv. 