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

colvar::cvc Class Reference

\brief Colvar component (base class for collective variables) A colvar::cvc object (or an object of a cvc-derived class) implements the calculation of a collective variable, its gradients and any other related physical quantities that depend on microscopic degrees of freedom. No restriction is set to what kind of calculation a colvar::cvc object performs (usually an analytical function of atomic coordinates). The only constraints are that:
- The value is calculated by the \link calc_value() \endlink method, and is an object of \link colvarvalue \endlink class. This provides a transparent way to treat scalar and non-scalar variables alike, and allows an automatic selection of the applicable algorithms. - The object provides an implementation \link apply_force() \endlink to apply forces to atoms. Typically, one or more \link colvarmodule::atom_group \endlink objects are used, but this is not a requirement for as long as the \link colvar::cvc \endlink object communicates with the simulation program. <b> If you wish to implement a new collective variable component, you should write your own class by inheriting directly from \link colvar::cvc \endlink, or one of its derived classes (for instance, \link colvar::distance \endlink is frequently used, because it provides useful data and function members for any colvar based on two atom groups).</b> The steps are: \par 1. Declare the new class as a derivative of \link colvar::cvc \endlink in the file \link colvarcomp.h \endlink 2. Implement the new class in a file named colvarcomp_<something>.cpp 3. Declare the name of the new class inside the \link colvar \endlink class in \link colvar.h \endlink (see "list of available components") 4. Add a call for the new class in colvar::init_components()/ (file:
colvar.cpp).
More...

#include <colvarcomp.h>

Inheritance diagram for colvar::cvc:

colvarparse colvardeps colvarparams colvar::alch_Flambda colvar::alch_lambda colvar::alpha_angles colvar::angle colvar::cartesian colvar::componentDisabled colvar::coordnum colvar::dihedPC colvar::dihedral colvar::dipole_angle colvar::dipole_magnitude colvar::distance colvar::distance_inv colvar::distance_pairs colvar::distance_z colvar::eigenvector colvar::gyration colvar::h_bond colvar::map_total colvar::orientation colvar::polar_phi colvar::polar_theta colvar::rmsd colvar::selfcoordnum List of all members.

Public Methods

 cvc (std::string const &conf)
 \brief Constructor Calls the init() function of the class. More...

int set_function_type (std::string const &type)
 Set the value of function_type and its dependencies. More...

virtual int init (std::string const &conf)
 An init function should be defined for every class inheriting from cvc
Parameters:
conf  Contents of the configuration file pertaining to this cvc.
More...


virtual int init_dependencies ()
 \brief Initialize dependency tree. More...

cvm::atom_group * parse_group (std::string const &conf, char const *group_key, bool optional=false)
 \brief Within the constructor, make a group parse its own options from the provided configuration string Returns reference to new group. More...

virtual int init_total_force_params (std::string const &conf)
 \brief Parse options pertaining to total force calculation. More...

int setup ()
 \brief After construction, set data related to dependency handling. More...

 cvc ()
 \brief Default constructor (used when colvar::cvc objects are declared within other ones). More...

virtual ~cvc ()
 Destructor. More...

virtual const std::vector<
feature * > & 
features () const
 \brief Implementation of the feature list accessor for colvar. More...

virtual std::vector< feature * > & modify_features ()
virtual std::vector< std::vector<
int > > 
get_atom_lists ()
 \brief Get vector of vectors of atom IDs for all atom groups. More...

virtual void read_data ()
 \brief Obtain data needed for the calculation for the backend. More...

virtual void calc_value ()=0
 \brief Calculate the variable. More...

virtual void calc_gradients ()
 \brief Calculate the atomic gradients, to be reused later in order to apply forces. More...

void calc_fit_gradients ()
 \brief Calculate the atomic fit gradients. More...

virtual void debug_gradients ()
 \brief Calculate finite-difference gradients alongside the analytical ones, for each Cartesian component. More...

virtual void collect_gradients (std::vector< int > const &atom_ids, std::vector< cvm::rvector > &atomic_gradients)
 \brief Calculate atomic gradients and add them to the corresponding item in gradient vector May be overridden by CVCs that do not store their gradients in the classic way, see dihedPC. 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...

colvarvalue const & value () const
 \brief Return the previously calculated value. More...

colvarvalue const & total_force () const
 \brief Return the previously calculated total force. More...

colvarvalue const & Jacobian_derivative () const
 \brief Return the previously calculated divergence of the inverse atomic gradients. More...

virtual void apply_force (colvarvalue const &cvforce)=0
 \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 Wrap value (for periodic/symmetric cvcs). More...

void register_atom_group (cvm::atom_group *ag)
 \brief Store a pointer to new atom group, and list as child for dependencies. More...

virtual colvarvalue const * get_param_grad (std::string const &param_name)
 Pointer to the gradient of parameter param_name. More...

virtual int set_param (std::string const &param_name, void const *new_value)
 Set the named parameter to the given value. More...

void set_value (colvarvalue const &new_value)
 Forcibly set value of CVC - useful for driving an external coordinate, eg. lambda dynamics. More...


Static Public Methods

void delete_features ()

Public Attributes

std::string name
 \brief The name of the object (helps to identify this cvc instance when debugging). More...

std::string function_type
 \brief Description of the type of collective variable Normally this string is set by the parent colvar object within its constructor, when all colvar::cvc objects are initialized; therefore the main "config string" constructor does not need to define it. If a colvar::cvc is initialized and/or a different constructor is used, this variable definition should be set within the constructor. More...

std::string config_key
 Keyword used in the input to denote this CVC. More...

cvm::real sup_coeff
 \brief Coefficient in the polynomial combination (default: 1.0). More...

int sup_np
 \brief Exponent in the polynomial combination (default: 1). More...

cvm::real period
 \brief Period of the values of this CVC (default: 0.0, non periodic). More...

cvm::real wrap_center
 \brief If the component is periodic, wrap around this value (default: 0.0). More...

std::vector< cvm::atom_group * > atom_groups
 \brief Pointers to all atom groups, to let colvars collect info e.g. atomic gradients. More...

bool b_try_scalable
 \brief Whether or not this CVC will be computed in parallel whenever possible. More...


Static Public Attributes

std::vector< feature * > cvc_features
 \brief Implementation of the feature list for colvar. More...


Protected Methods

void init_as_distance ()
 \brief Set data types for a scalar distance (convenience function). More...

void init_as_angle ()
 \brief Set data types for a bounded angle (0° to 180°). More...

void init_as_periodic_angle ()
 \brief Set data types for a periodic angle (-180° to 180°). More...

void init_scalar_boundaries (cvm::real lb, cvm::real ub)
 \brief Set two scalar boundaries (convenience function). More...


Protected Attributes

std::vector< std::stringfunction_types
 Record the type of this class as well as those it is derived from. More...

colvarvalue x
 \brief Cached value. More...

colvarvalue x_old
 \brief Value at the previous step. More...

colvarvalue ft
 \brief Calculated total force (Note: this is calculated from the total atomic forces read from the program, subtracting fromt the "internal" forces of the system the "external" forces from the colvar biases). More...

colvarvalue jd
 \brief Calculated Jacobian derivative (divergence of the inverse gradients): serves to calculate the phase space correction. More...

colvarvalue lower_boundary
 \brief Location of the lower boundary (not defined by user choice). More...

colvarvalue upper_boundary
 \brief Location of the upper boundary (not defined by user choice). More...

cvm::real width
 \brief CVC-specific default colvar width. More...


Detailed Description

\brief Colvar component (base class for collective variables) A colvar::cvc object (or an object of a cvc-derived class) implements the calculation of a collective variable, its gradients and any other related physical quantities that depend on microscopic degrees of freedom. No restriction is set to what kind of calculation a colvar::cvc object performs (usually an analytical function of atomic coordinates). The only constraints are that:
- The value is calculated by the \link calc_value() \endlink method, and is an object of \link colvarvalue \endlink class. This provides a transparent way to treat scalar and non-scalar variables alike, and allows an automatic selection of the applicable algorithms. - The object provides an implementation \link apply_force() \endlink to apply forces to atoms. Typically, one or more \link colvarmodule::atom_group \endlink objects are used, but this is not a requirement for as long as the \link colvar::cvc \endlink object communicates with the simulation program. <b> If you wish to implement a new collective variable component, you should write your own class by inheriting directly from \link colvar::cvc \endlink, or one of its derived classes (for instance, \link colvar::distance \endlink is frequently used, because it provides useful data and function members for any colvar based on two atom groups).</b> The steps are: \par 1. Declare the new class as a derivative of \link colvar::cvc \endlink in the file \link colvarcomp.h \endlink 2. Implement the new class in a file named colvarcomp_<something>.cpp 3. Declare the name of the new class inside the \link colvar \endlink class in \link colvar.h \endlink (see "list of available components") 4. Add a call for the new class in colvar::init_components()/ (file:
colvar.cpp).

Definition at line 76 of file colvarcomp.h.


Constructor & Destructor Documentation

colvar::cvc::cvc std::string const &    conf
 

\brief Constructor Calls the init() function of the class.

Definition at line 32 of file colvarcomp.C.

References b_try_scalable, conf, colvardeps::description, init, init_dependencies, period, sup_coeff, sup_np, width, and wrap_center.

colvar::cvc::cvc  
 

\brief Default constructor (used when colvar::cvc objects are declared within other ones).

Definition at line 19 of file colvarcomp.C.

References b_try_scalable, colvardeps::description, period, sup_coeff, sup_np, width, and wrap_center.

colvar::cvc::~cvc   [virtual]
 

Destructor.

Definition at line 322 of file colvarcomp.C.

References atom_groups, colvardeps::free_children_deps, NULL, and colvardeps::remove_all_children.


Member Function Documentation

virtual void colvar::cvc::apply_force colvarvalue const &    cvforce [pure 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.

Implemented in colvar::distance.

void colvar::cvc::calc_fit_gradients  
 

\brief Calculate the atomic fit gradients.

Definition at line 510 of file colvarcomp.C.

References atom_groups.

void colvar::cvc::calc_force_invgrads   [virtual]
 

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

Reimplemented in colvar::distance.

Definition at line 494 of file colvarcomp.C.

References COLVARS_NOT_IMPLEMENTED, colvarmodule::error, and function_type.

virtual void colvar::cvc::calc_gradients   [inline, virtual]
 

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

Reimplemented in colvar::distance.

Definition at line 175 of file colvarcomp.h.

void colvar::cvc::calc_Jacobian_derivative   [virtual]
 

\brief Calculate the divergence of the inverse atomic gradients.

Reimplemented in colvar::distance.

Definition at line 502 of file colvarcomp.C.

References COLVARS_NOT_IMPLEMENTED, colvarmodule::error, and function_type.

virtual void colvar::cvc::calc_value   [pure virtual]
 

\brief Calculate the variable.

Implemented in colvar::distance.

Referenced by debug_gradients.

void colvar::cvc::collect_gradients std::vector< int > const &    atom_ids,
std::vector< cvm::rvector > &    atomic_gradients
[virtual]
 

\brief Calculate atomic gradients and add them to the corresponding item in gradient vector May be overridden by CVCs that do not store their gradients in the classic way, see dihedPC.

Reimplemented in colvar::alpha_angles.

Definition at line 452 of file colvarcomp.C.

References atom_groups, colvar::atom_ids, colvar::atomic_gradients, colvardeps::f_ag_fit_gradients, colvardeps::f_ag_fitting_group, colvardeps::f_ag_rotate, colvarmodule::integer_power, colvarmodule::real, sup_coeff, sup_np, and value.

void colvar::cvc::debug_gradients   [virtual]
 

\brief Calculate finite-difference gradients alongside the analytical ones, for each Cartesian component.

Definition at line 518 of file colvarcomp.C.

References atom_groups, calc_value, colvardeps::description, colvardeps::f_ag_center, colvardeps::f_ag_fit_gradients, colvardeps::f_ag_rotate, colvarmodule::log, NULL, colvarvalue::real_value, colvarvalue::size, colvarmodule::to_str, colvarvalue::type, colvarvalue::type_vector, and x.

void colvar::cvc::delete_features   [inline, static]
 

Definition at line 157 of file colvarcomp.h.

Referenced by colvarmodule::~colvarmodule.

cvm::real colvar::cvc::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 in colvar::distance.

Definition at line 637 of file colvarcomp.C.

References colvarvalue::dist2.

colvarvalue colvar::cvc::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 in colvar::distance.

Definition at line 644 of file colvarcomp.C.

References colvarvalue::dist2_grad.

colvarvalue colvar::cvc::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 in colvar::distance.

Definition at line 651 of file colvarcomp.C.

References colvarvalue::dist2_grad.

virtual const std::vector<feature *>& colvar::cvc::features   const [inline, virtual]
 

\brief Implementation of the feature list accessor for colvar.

Implements colvardeps.

Definition at line 149 of file colvarcomp.h.

Referenced by init_dependencies.

std::vector< std::vector< int > > colvar::cvc::get_atom_lists   [virtual]
 

\brief Get vector of vectors of atom IDs for all atom groups.

Definition at line 434 of file colvarcomp.C.

References atom_groups, colvardeps::f_ag_fit_gradients, and colvardeps::f_ag_fitting_group.

colvarvalue const * colvar::cvc::get_param_grad std::string const &    param_name [virtual]
 

Pointer to the gradient of parameter param_name.

Definition at line 378 of file colvarcomp.C.

References colvarparams::get_param_grad_ptr, and NULL.

int colvar::cvc::init std::string const &    conf [virtual]
 

An init function should be defined for every class inheriting from cvc

Parameters:
conf  Contents of the configuration file pertaining to this cvc.

Reimplemented in colvar::orientation.

Definition at line 65 of file colvarcomp.C.

References b_try_scalable, colvarmodule::cite_feature, COLVARS_INPUT_ERROR, conf, colvarmodule::debug, colvardeps::description, colvardeps::disable, colvardeps::enable, colvarmodule::error, colvardeps::f_cvc_debug_gradient, colvardeps::f_cvc_pbc_minimum_image, function_type, colvarmodule::get_error, colvarparse::get_keyval, colvardeps::get_keyval_feature, colvardeps::is_enabled, colvarmodule::log, colvarmodule::main, name, colvarparse::parse_silent, period, colvarparams::register_param, sup_coeff, sup_np, and wrap_center.

Referenced by cvc.

void colvar::cvc::init_as_angle   [protected]
 

\brief Set data types for a bounded angle (0° to 180°).

Definition at line 342 of file colvarcomp.C.

References init_scalar_boundaries, colvarvalue::type, colvarvalue::type_scalar, and x.

Referenced by colvar::angle::angle, colvar::dipole_angle::dipole_angle, colvar::euler_theta::euler_theta, and colvar::orientation_angle::orientation_angle.

void colvar::cvc::init_as_distance   [protected]
 

\brief Set data types for a scalar distance (convenience function).

Definition at line 332 of file colvarcomp.C.

References colvardeps::enable, colvardeps::f_cvc_lower_boundary, lower_boundary, colvarvalue::real_value, colvarparams::register_param, colvarvalue::type, colvarvalue::type_scalar, and x.

Referenced by colvar::distance::distance, colvar::distance_inv::distance_inv, and colvar::distance_xy::distance_xy.

void colvar::cvc::init_as_periodic_angle   [protected]
 

\brief Set data types for a periodic angle (-180° to 180°).

Definition at line 349 of file colvarcomp.C.

References colvardeps::enable, colvardeps::f_cvc_periodic, init_scalar_boundaries, period, colvarvalue::type, colvarvalue::type_scalar, and x.

Referenced by colvar::dihedral::dihedral, colvar::euler_phi::euler_phi, colvar::euler_psi::euler_psi, and colvar::polar_phi::polar_phi.

int colvar::cvc::init_dependencies   [virtual]
 

\brief Initialize dependency tree.

Implements colvardeps.

Definition at line 209 of file colvarcomp.C.

References colvardeps::description, colvardeps::enable, colvarmodule::error, colvardeps::exclude_feature_self, colvardeps::f_ag_collect_atom_ids, colvardeps::f_ag_explicit_gradient, colvardeps::f_cvc_active, colvardeps::f_cvc_collect_atom_ids, colvardeps::f_cvc_com_based, colvardeps::f_cvc_debug_gradient, colvardeps::f_cvc_explicit_gradient, colvardeps::f_cvc_gradient, colvardeps::f_cvc_inv_gradient, colvardeps::f_cvc_Jacobian, colvardeps::f_cvc_lower_boundary, colvardeps::f_cvc_ntot, colvardeps::f_cvc_one_site_total_force, colvardeps::f_cvc_pbc_minimum_image, colvardeps::f_cvc_periodic, colvardeps::f_cvc_scalable, colvardeps::f_cvc_scalable_com, colvardeps::f_cvc_scalar, colvardeps::f_cvc_upper_boundary, colvardeps::f_cvc_width, colvardeps::f_type_dynamic, colvardeps::f_type_static, colvardeps::f_type_user, feature, colvardeps::feature_states, features, colvardeps::init_feature, colvardeps::is_dynamic, colvardeps::is_not_set, modify_features, colvardeps::require_feature_children, and colvardeps::require_feature_self.

Referenced by cvc.

void colvar::cvc::init_scalar_boundaries cvm::real    lb,
cvm::real    ub
[protected]
 

\brief Set two scalar boundaries (convenience function).

Definition at line 358 of file colvarcomp.C.

References colvardeps::enable, colvardeps::f_cvc_lower_boundary, colvardeps::f_cvc_upper_boundary, lower_boundary, colvarvalue::real_value, colvarparams::register_param, colvarvalue::type, colvarvalue::type_scalar, and upper_boundary.

Referenced by colvar::coordnum::coordnum, colvar::h_bond::h_bond, init_as_angle, and init_as_periodic_angle.

int colvar::cvc::init_total_force_params std::string const &    conf [virtual]
 

\brief Parse options pertaining to total force calculation.

Definition at line 126 of file colvarcomp.C.

References atom_groups, COLVARS_ERROR, conf, colvardeps::f_cvc_inv_gradient, colvardeps::f_cvc_Jacobian, colvardeps::f_cvc_one_site_total_force, colvarmodule::get_error, colvardeps::get_keyval_feature, colvardeps::is_enabled, colvarmodule::log, and colvardeps::provide.

Referenced by colvar::angle::angle, colvar::dipole_magnitude::dipole_magnitude, colvar::distance::distance, colvar::distance_z::distance_z, and colvar::polar_theta::polar_theta.

colvarvalue const & colvar::cvc::Jacobian_derivative   const [inline]
 

\brief Return the previously calculated divergence of the inverse atomic gradients.

Definition at line 340 of file colvarcomp.h.

References jd.

virtual std::vector<feature *>& colvar::cvc::modify_features   [inline, virtual]
 

Implements colvardeps.

Definition at line 153 of file colvarcomp.h.

Referenced by init_dependencies.

cvm::atom_group * colvar::cvc::parse_group std::string const &    conf,
char const *    group_key,
bool    optional = false
 

\brief Within the constructor, make a group parse its own options from the provided configuration string Returns reference to new group.

Definition at line 156 of file colvarcomp.C.

References colvarmodule::atom_group, COLVARS_INPUT_ERROR, conf, colvarmodule::decrease_depth, colvardeps::disable, colvardeps::enable, colvarmodule::error, colvardeps::f_ag_scalable_com, colvardeps::f_cvc_com_based, colvardeps::f_cvc_debug_gradient, colvardeps::f_cvc_explicit_gradient, colvardeps::f_cvc_scalable_com, colvarmodule::get_error, colvarmodule::increase_depth, colvardeps::is_available, colvardeps::is_enabled, colvarparse::key_lookup, NULL, and register_atom_group.

Referenced by colvar::angle::angle, colvar::coordnum::coordnum, colvar::dipole_magnitude::dipole_magnitude, colvar::distance::distance, colvar::distance_inv::distance_inv, colvar::distance_z::distance_z, colvar::map_total::init, colvar::orientation::init, and colvar::polar_theta::polar_theta.

void colvar::cvc::read_data   [virtual]
 

\brief Obtain data needed for the calculation for the backend.

Definition at line 412 of file colvarcomp.C.

References atom_groups, and atoms.

void colvar::cvc::register_atom_group cvm::atom_group *    ag
 

\brief Store a pointer to new atom group, and list as child for dependencies.

Definition at line 371 of file colvarcomp.C.

References colvardeps::add_child, and atom_groups.

Referenced by colvar::alpha_angles::alpha_angles, colvar::angle::angle, colvar::dihedral::dihedral, colvar::dipole_angle::dipole_angle, colvar::dipole_magnitude::dipole_magnitude, colvar::h_bond::h_bond, and parse_group.

int colvar::cvc::set_function_type std::string const &    type
 

Set the value of function_type and its dependencies.

Definition at line 46 of file colvarcomp.C.

References colvarmodule::cite_feature, function_type, function_types, and colvarmodule::main.

Referenced by colvar::alch_lambda::alch_lambda, colvar::alpha_angles::alpha_angles, colvar::angle::angle, colvar::coordnum::coordnum, colvar::dihedPC::dihedPC, colvar::dihedral::dihedral, colvar::dipole_angle::dipole_angle, colvar::dipole_magnitude::dipole_magnitude, colvar::distance::distance, colvar::distance_dir::distance_dir, colvar::distance_inv::distance_inv, colvar::distance_pairs::distance_pairs, colvar::distance_vec::distance_vec, colvar::distance_xy::distance_xy, colvar::distance_z::distance_z, colvar::euler_phi::euler_phi, colvar::euler_psi::euler_psi, colvar::euler_theta::euler_theta, colvar::h_bond::h_bond, colvar::map_total::map_total, colvar::orientation::orientation, colvar::orientation_angle::orientation_angle, colvar::polar_phi::polar_phi, colvar::polar_theta::polar_theta, and colvar::spin_angle::spin_angle.

int colvar::cvc::set_param std::string const &    param_name,
void const *    new_value
[virtual]
 

Set the named parameter to the given value.

Reimplemented from colvarparams.

Definition at line 386 of file colvarcomp.C.

References colvardeps::f_cvc_periodic, colvardeps::is_enabled, colvarparams::param_map, period, colvarparams::set_param, sup_coeff, sup_np, and wrap_center.

void colvar::cvc::set_value colvarvalue const &    new_value [inline]
 

Forcibly set value of CVC - useful for driving an external coordinate, eg. lambda dynamics.

Definition at line 280 of file colvarcomp.h.

References colvar::x.

int colvar::cvc::setup  
 

\brief After construction, set data related to dependency handling.

Definition at line 315 of file colvarcomp.C.

References colvardeps::description, and name.

colvarvalue const & colvar::cvc::total_force   const [inline]
 

\brief Return the previously calculated total force.

Definition at line 334 of file colvarcomp.h.

References ft.

colvarvalue const & colvar::cvc::value   const [inline]
 

\brief Return the previously calculated value.

Definition at line 328 of file colvarcomp.h.

References x.

Referenced by colvar::rmsd::calc_value, colvar::dihedPC::collect_gradients, colvar::alpha_angles::collect_gradients, and collect_gradients.

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

\brief Wrap value (for periodic/symmetric cvcs).

Reimplemented in colvar::distance_z.

Definition at line 658 of file colvarcomp.C.


Member Data Documentation

std::vector<cvm::atom_group *> colvar::cvc::atom_groups
 

\brief Pointers to all atom groups, to let colvars collect info e.g. atomic gradients.

Definition at line 264 of file colvarcomp.h.

Referenced by colvar::h_bond::apply_force, calc_fit_gradients, colvar::h_bond::calc_gradients, colvar::h_bond::calc_value, collect_gradients, debug_gradients, get_atom_lists, colvar::h_bond::h_bond, init_total_force_params, read_data, register_atom_group, colvar::alpha_angles::~alpha_angles, ~cvc, and colvar::dihedPC::~dihedPC.

bool colvar::cvc::b_try_scalable
 

\brief Whether or not this CVC will be computed in parallel whenever possible.

Definition at line 276 of file colvarcomp.h.

Referenced by cvc, and init.

std::string colvar::cvc::config_key
 

Keyword used in the input to denote this CVC.

Definition at line 96 of file colvarcomp.h.

std::vector< colvardeps::feature * > colvar::cvc::cvc_features [static]
 

\brief Implementation of the feature list for colvar.

Definition at line 667 of file colvarcomp.C.

colvarvalue colvar::cvc::ft [protected]
 

\brief Calculated total force (Note: this is calculated from the total atomic forces read from the program, subtracting fromt the "internal" forces of the system the "external" forces from the colvar biases).

Definition at line 299 of file colvarcomp.h.

Referenced by colvar::eigenvector::calc_force_invgrads, colvar::rmsd::calc_force_invgrads, colvar::gyration::calc_force_invgrads, colvar::distance_xy::calc_force_invgrads, colvar::distance_z::calc_force_invgrads, colvar::distance::calc_force_invgrads, colvar::dihedral::calc_force_invgrads, colvar::angle::calc_force_invgrads, colvar::alch_lambda::calc_value, and total_force.

std::string colvar::cvc::function_type
 

\brief Description of the type of collective variable Normally this string is set by the parent colvar object within its constructor, when all colvar::cvc objects are initialized; therefore the main "config string" constructor does not need to define it. If a colvar::cvc is initialized and/or a different constructor is used, this variable definition should be set within the constructor.

Definition at line 93 of file colvarcomp.h.

Referenced by calc_force_invgrads, calc_Jacobian_derivative, init, and set_function_type.

std::vector<std::string> colvar::cvc::function_types [protected]
 

Record the type of this class as well as those it is derived from.

Definition at line 287 of file colvarcomp.h.

Referenced by set_function_type.

colvarvalue colvar::cvc::jd [protected]
 

\brief Calculated Jacobian derivative (divergence of the inverse gradients): serves to calculate the phase space correction.

Definition at line 303 of file colvarcomp.h.

Referenced by colvar::eigenvector::calc_Jacobian_derivative, colvar::rmsd::calc_Jacobian_derivative, colvar::gyration::calc_Jacobian_derivative, colvar::distance_xy::calc_Jacobian_derivative, colvar::distance_z::calc_Jacobian_derivative, colvar::distance::calc_Jacobian_derivative, colvar::dihedral::calc_Jacobian_derivative, colvar::angle::calc_Jacobian_derivative, and Jacobian_derivative.

colvarvalue colvar::cvc::lower_boundary [protected]
 

\brief Location of the lower boundary (not defined by user choice).

Definition at line 318 of file colvarcomp.h.

Referenced by init_as_distance, and init_scalar_boundaries.

std::string colvar::cvc::name
 

\brief The name of the object (helps to identify this cvc instance when debugging).

Definition at line 83 of file colvarcomp.h.

Referenced by colvar::compare_cvc, init, and setup.

cvm::real colvar::cvc::period
 

\brief Period of the values of this CVC (default: 0.0, non periodic).

Definition at line 104 of file colvarcomp.h.

Referenced by cvc, colvar::distance_z::dist2, colvar::distance_z::dist2_lgrad, colvar::distance_z::dist2_rgrad, colvar::distance_z::distance_z, init, init_as_periodic_angle, set_param, colvar::spin_angle::spin_angle, and colvar::distance_z::wrap.

cvm::real colvar::cvc::sup_coeff
 

\brief Coefficient in the polynomial combination (default: 1.0).

Definition at line 99 of file colvarcomp.h.

Referenced by colvar::dihedPC::collect_gradients, colvar::alpha_angles::collect_gradients, collect_gradients, cvc, init, and set_param.

int colvar::cvc::sup_np
 

\brief Exponent in the polynomial combination (default: 1).

Definition at line 101 of file colvarcomp.h.

Referenced by colvar::dihedPC::collect_gradients, colvar::alpha_angles::collect_gradients, collect_gradients, cvc, init, and set_param.

colvarvalue colvar::cvc::upper_boundary [protected]
 

\brief Location of the upper boundary (not defined by user choice).

Definition at line 321 of file colvarcomp.h.

Referenced by init_scalar_boundaries.

cvm::real colvar::cvc::width [protected]
 

\brief CVC-specific default colvar width.

Definition at line 324 of file colvarcomp.h.

Referenced by cvc.

cvm::real colvar::cvc::wrap_center
 

\brief If the component is periodic, wrap around this value (default: 0.0).

Definition at line 107 of file colvarcomp.h.

Referenced by cvc, colvar::distance_z::distance_z, init, set_param, colvar::euler_psi::wrap, colvar::euler_phi::wrap, colvar::spin_angle::wrap, colvar::distance_z::wrap, colvar::polar_phi::wrap, and colvar::dihedral::wrap.

colvarvalue colvar::cvc::x [protected]
 

\brief Cached value.

Definition at line 290 of file colvarcomp.h.

Referenced by colvar::alch_lambda::alch_lambda, colvar::alpha_angles::alpha_angles, colvar::distance_dir::apply_force, colvar::alch_lambda::apply_force, colvar::gyration::calc_force_invgrads, colvar::distance_xy::calc_force_invgrads, colvar::rmsd::calc_gradients, colvar::gyration::calc_gradients, colvar::distance_xy::calc_gradients, colvar::distance_z::calc_gradients, colvar::rmsd::calc_Jacobian_derivative, colvar::gyration::calc_Jacobian_derivative, colvar::distance_xy::calc_Jacobian_derivative, colvar::distance::calc_Jacobian_derivative, colvar::angle::calc_Jacobian_derivative, colvar::map_total::calc_value, colvar::euler_theta::calc_value, colvar::euler_psi::calc_value, colvar::euler_phi::calc_value, colvar::spin_angle::calc_value, colvar::tilt::calc_value, colvar::orientation_proj::calc_value, colvar::orientation_angle::calc_value, colvar::orientation::calc_value, colvar::dihedPC::calc_value, colvar::alpha_angles::calc_value, colvar::cartesian::calc_value, colvar::eigenvector::calc_value, colvar::rmsd::calc_value, colvar::inertia_z::calc_value, colvar::inertia::calc_value, colvar::gyration::calc_value, colvar::dipole_magnitude::calc_value, colvar::distance_pairs::calc_value, colvar::distance_inv::calc_value, colvar::distance_dir::calc_value, colvar::distance_xy::calc_value, colvar::distance_z::calc_value, colvar::distance_vec::calc_value, colvar::distance::calc_value, colvar::groupcoordnum::calc_value, colvar::selfcoordnum::calc_value, colvar::h_bond::calc_value, colvar::coordnum::calc_value, colvar::polar_phi::calc_value, colvar::polar_theta::calc_value, colvar::dihedral::calc_value, colvar::dipole_angle::calc_value, colvar::angle::calc_value, colvar::alch_Flambda::calc_value, colvar::selfcoordnum::compute_selfcoordnum, colvar::coordnum::coordnum, debug_gradients, colvar::dihedPC::dihedPC, colvar::dipole_magnitude::dipole_magnitude, colvar::distance_dir::distance_dir, colvar::distance_pairs::distance_pairs, colvar::distance_vec::distance_vec, colvar::distance_z::distance_z, colvar::h_bond::h_bond, init_as_angle, init_as_distance, init_as_periodic_angle, colvar::coordnum::main_loop, colvar::map_total::map_total, colvar::orientation::orientation, colvar::polar_theta::polar_theta, colvar::spin_angle::spin_angle, and value.

colvarvalue colvar::cvc::x_old [protected]
 

\brief Value at the previous step.

Definition at line 293 of file colvarcomp.h.


The documentation for this class was generated from the following files:
Generated on Tue Apr 23 04:25:08 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002