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

colvar::distance_z Class Reference

\brief Colvar component: projection of the distance vector along an axis(colvarvalue::type_scalar type, range (-*:*)). More...

#include <colvarcomp.h>

Inheritance diagram for colvar::distance_z:

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

Public Methods

 distance_z (std::string const &conf)
 distance_z ()
virtual ~distance_z ()
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 calc_force_invgrads ()
 \brief Calculate the total force from the system using the inverse atomic gradients. More...

virtual void calc_Jacobian_derivative ()
 \brief Calculate the divergence of the inverse atomic gradients. 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...

virtual void wrap (colvarvalue &x_unwrapped) const
 \brief Redefined to make use of the user-provided period. More...


Protected Attributes

cvm::atom_group * main
 Main atom group. More...

cvm::atom_group * ref1
 Reference atom group. More...

cvm::atom_group * ref2
 Optional, second ref atom group. More...

cvm::rvector axis
 Vector on which the distance vector is projected. More...

cvm::real axis_norm
 Norm of the axis. More...

cvm::rvector dist_v
 Vector distance, cached to be recycled. More...

bool fixed_axis
 Flag: using a fixed axis vector? More...


Detailed Description

\brief Colvar component: projection of the distance vector along an axis(colvarvalue::type_scalar type, range (-*:*)).

Definition at line 433 of file colvarcomp.h.


Constructor & Destructor Documentation

colvar::distance_z::distance_z std::string const &    conf
 

Definition at line 171 of file colvarcomp_distances.C.

References conf, colvardeps::enable, colvarmodule::error, colvardeps::f_cvc_com_based, colvardeps::f_cvc_inv_gradient, colvardeps::f_cvc_Jacobian, colvardeps::f_cvc_periodic, fixed_axis, colvarparse::get_keyval, colvar::cvc::init_total_force_params, colvardeps::is_enabled, colvarparse::key_lookup, colvarmodule::log, main, colvar::cvc::parse_group, colvar::cvc::period, colvardeps::provide, ref1, ref2, colvar::cvc::set_function_type, colvarvalue::type, colvarvalue::type_scalar, colvar::cvc::wrap_center, and colvar::cvc::x.

Referenced by colvar::distance_xy::distance_xy.

colvar::distance_z::distance_z  
 

Definition at line 221 of file colvarcomp_distances.C.

References colvardeps::enable, colvardeps::f_cvc_com_based, colvardeps::f_cvc_inv_gradient, colvardeps::f_cvc_Jacobian, colvardeps::provide, colvar::cvc::set_function_type, colvarvalue::type, colvarvalue::type_scalar, and colvar::cvc::x.

virtual colvar::distance_z::~distance_z   [inline, virtual]
 

Definition at line 454 of file colvarcomp.h.


Member Function Documentation

void colvar::distance_z::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.

Reimplemented in colvar::distance_xy.

Definition at line 306 of file colvarcomp_distances.C.

References force, main, colvarvalue::real_value, ref1, and ref2.

void colvar::distance_z::calc_force_invgrads   [virtual]
 

\brief Calculate the total force from the system using the inverse atomic gradients.

Reimplemented from colvar::cvc.

Reimplemented in colvar::distance_xy.

Definition at line 287 of file colvarcomp_distances.C.

References colvardeps::f_cvc_one_site_total_force, fixed_axis, colvar::cvc::ft, colvardeps::is_enabled, main, colvarvalue::real_value, and ref1.

void colvar::distance_z::calc_gradients   [virtual]
 

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

Reimplemented from colvar::cvc.

Reimplemented in colvar::distance_xy.

Definition at line 261 of file colvarcomp_distances.C.

References axis_norm, colvardeps::f_cvc_pbc_minimum_image, colvardeps::is_enabled, main, colvarvalue::real_value, ref1, ref2, and colvar::cvc::x.

void colvar::distance_z::calc_Jacobian_derivative   [virtual]
 

\brief Calculate the divergence of the inverse atomic gradients.

Reimplemented from colvar::cvc.

Reimplemented in colvar::distance_xy.

Definition at line 300 of file colvarcomp_distances.C.

References colvar::cvc::jd, and colvarvalue::real_value.

void colvar::distance_z::calc_value   [virtual]
 

\brief Calculate the variable.

Implements colvar::cvc.

Reimplemented in colvar::distance_xy.

Definition at line 231 of file colvarcomp_distances.C.

References axis_norm, dist_v, colvardeps::f_cvc_pbc_minimum_image, colvardeps::is_enabled, main, colvarmodule::position_distance, colvarvalue::real_value, ref1, ref2, wrap, and colvar::cvc::x.

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

Reimplemented in colvar::distance_xy.

Definition at line 320 of file colvarcomp_distances.C.

References colvardeps::f_cvc_periodic, colvarmodule::floor, colvardeps::is_enabled, colvar::cvc::period, and colvarvalue::real_value.

colvarvalue colvar::distance_z::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.

Reimplemented in colvar::distance_xy.

Definition at line 332 of file colvarcomp_distances.C.

References colvardeps::f_cvc_periodic, colvarmodule::floor, colvardeps::is_enabled, colvar::cvc::period, and colvarvalue::real_value.

colvarvalue colvar::distance_z::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.

Reimplemented in colvar::distance_xy.

Definition at line 344 of file colvarcomp_distances.C.

References colvardeps::f_cvc_periodic, colvarmodule::floor, colvardeps::is_enabled, colvar::cvc::period, and colvarvalue::real_value.

void colvar::distance_z::wrap colvarvalue   x_unwrapped const [virtual]
 

\brief Redefined to make use of the user-provided period.

Reimplemented from colvar::cvc.

Definition at line 356 of file colvarcomp_distances.C.

References colvardeps::f_cvc_periodic, colvarmodule::floor, colvardeps::is_enabled, colvar::cvc::period, colvarvalue::real_value, and colvar::cvc::wrap_center.

Referenced by calc_value.


Member Data Documentation

cvm::rvector colvar::distance_z::axis [protected]
 

Vector on which the distance vector is projected.

Definition at line 444 of file colvarcomp.h.

cvm::real colvar::distance_z::axis_norm [protected]
 

Norm of the axis.

Definition at line 446 of file colvarcomp.h.

Referenced by colvar::distance_xy::calc_gradients, calc_gradients, colvar::distance_xy::calc_value, and calc_value.

cvm::rvector colvar::distance_z::dist_v [protected]
 

Vector distance, cached to be recycled.

Definition at line 448 of file colvarcomp.h.

Referenced by colvar::distance_xy::calc_gradients, colvar::distance_xy::calc_value, and calc_value.

bool colvar::distance_z::fixed_axis [protected]
 

Flag: using a fixed axis vector?

Definition at line 450 of file colvarcomp.h.

Referenced by colvar::distance_xy::calc_force_invgrads, calc_force_invgrads, colvar::distance_xy::calc_value, and distance_z.

cvm::atom_group* colvar::distance_z::main [protected]
 

Main atom group.

Definition at line 438 of file colvarcomp.h.

Referenced by colvar::distance_xy::apply_force, apply_force, colvar::distance_xy::calc_force_invgrads, calc_force_invgrads, colvar::distance_xy::calc_gradients, calc_gradients, colvar::distance_xy::calc_value, calc_value, and distance_z.

cvm::atom_group* colvar::distance_z::ref1 [protected]
 

Reference atom group.

Definition at line 440 of file colvarcomp.h.

Referenced by colvar::distance_xy::apply_force, apply_force, colvar::distance_xy::calc_force_invgrads, calc_force_invgrads, colvar::distance_xy::calc_gradients, calc_gradients, colvar::distance_xy::calc_value, calc_value, and distance_z.

cvm::atom_group* colvar::distance_z::ref2 [protected]
 

Optional, second ref atom group.

Definition at line 442 of file colvarcomp.h.

Referenced by colvar::distance_xy::apply_force, apply_force, colvar::distance_xy::calc_gradients, calc_gradients, colvar::distance_xy::calc_value, calc_value, and distance_z.


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