#include <colvarcomp.h>
Inheritance diagram for colvar::h_bond:

Public Member Functions | |
| h_bond (std::string const &conf) | |
| h_bond (cvm::atom const &acceptor, cvm::atom const &donor, cvm::real r0, int en, int ed) | |
| Constructor for atoms already allocated. | |
| h_bond () | |
| virtual | ~h_bond () |
| virtual void | calc_value () |
| Calculate the variable. | |
| virtual void | calc_gradients () |
| Calculate the atomic gradients, to be reused later in order to apply forces. | |
| virtual void | apply_force (colvarvalue const &force) |
| Apply the collective variable force, by communicating the atomic forces to the simulation program (Note: the member is not altered by this function). | |
| virtual cvm::real | dist2 (colvarvalue const &x1, colvarvalue const &x2) const |
| Square distance between x1 and x2 (can be redefined to transparently implement constraints, symmetries and periodicities). | |
| virtual colvarvalue | dist2_lgrad (colvarvalue const &x1, colvarvalue const &x2) const |
| Gradient (with respect to x1) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities). | |
| virtual colvarvalue | dist2_rgrad (colvarvalue const &x1, colvarvalue const &x2) const |
| Gradient (with respect to x2) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities). | |
| virtual cvm::real | compare (colvarvalue const &x1, colvarvalue const &x2) const |
| Return a positive number if x2>x1, zero if x2==x1, negative otherwise (can be redefined to transparently implement constraints, symmetries and periodicities) Note: it only works with scalar variables, otherwise raises an error. | |
Protected Attributes | |
| cvm::atom | acceptor |
| Atoms involved in the component. | |
| cvm::atom | donor |
| Atoms involved in the component. | |
| cvm::real | r0 |
| "Cutoff" distance between acceptor and donor | |
| int | en |
| Integer exponent of the function numerator. | |
| int | ed |
| Integer exponent of the function denominator. | |
Definition at line 707 of file colvarcomp.h.
|
|
Definition at line 218 of file colvarcomp_coordnums.C. References acceptor, colvarmodule::atom, donor, ed, en, colvarmodule::fatal_error(), r0, and colvarvalue::type(). 00219 : cvc (conf) 00220 { 00221 function_type = "h_bond"; 00222 x.type (colvarvalue::type_scalar); 00223 00224 int a_num, d_num; 00225 get_keyval (conf, "acceptor", a_num, -1); 00226 get_keyval (conf, "donor", d_num, -1); 00227 00228 if ( (a_num == -1) || (d_num == -1) ) { 00229 cvm::fatal_error ("Error: either acceptor or donor undefined.\n"); 00230 } 00231 00232 acceptor = cvm::atom (a_num); 00233 donor = cvm::atom (d_num); 00234 00235 get_keyval (conf, "cutoff", r0, (3.3 * cvm::unit_angstrom())); 00236 get_keyval (conf, "expNumer", en, 6); 00237 get_keyval (conf, "expDenom", ed, 8); 00238 00239 if ( (en%2) || (ed%2) ) { 00240 cvm::fatal_error ("Error: odd exponents provided, can only use even ones.\n"); 00241 } 00242 }
|
|
||||||||||||||||||||||||
|
Constructor for atoms already allocated.
Definition at line 245 of file colvarcomp_coordnums.C. References colvarvalue::type(). 00248 : acceptor (acceptor_i), 00249 donor (donor_i), 00250 r0 (r0_i), en (en_i), ed (ed_i) 00251 { 00252 function_type = "h_bond"; 00253 x.type (colvarvalue::type_scalar); 00254 }
|
|
|
Definition at line 257 of file colvarcomp_coordnums.C. References colvarvalue::type(). 00258 : cvc () 00259 { 00260 function_type = "h_bond"; 00261 x.type (colvarvalue::type_scalar); 00262 }
|
|
|
Definition at line 726 of file colvarcomp.h. 00726 {}
|
|
|
Apply the collective variable force, by communicating the atomic forces to the simulation program (Note: the 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 286 of file colvarcomp_coordnums.C. References acceptor, colvarmodule::atom::apply_force(), donor, colvarmodule::atom::grad, and colvarvalue::real_value. 00287 {
00288 acceptor.apply_force (force.real_value * acceptor.grad);
00289 donor.apply_force (force.real_value * donor.grad);
00290 }
|
|
|
Calculate the atomic gradients, to be reused later in order to apply forces.
Implements colvar::cvc. Definition at line 280 of file colvarcomp_coordnums.C. 00281 {
00282 colvar::coordnum::switching_function<true> (r0, en, ed, acceptor, donor);
00283 }
|
|
|
Calculate the variable.
Implements colvar::cvc. Definition at line 266 of file colvarcomp_coordnums.C. References acceptor, donor, colvarmodule::atom::read_position(), colvarvalue::real_value, and colvarmodule::atom::reset_data(). 00267 {
00268 // this is necessary, because switching_function() will sum the new
00269 // gradient to the current one
00270 acceptor.reset_data();
00271 donor.reset_data();
00272
00273 acceptor.read_position();
00274 donor.read_position();
00275
00276 x.real_value = colvar::coordnum::switching_function<false> (r0, en, ed, acceptor, donor);
00277 }
|
|
||||||||||||
|
Return a positive number if x2>x1, zero if x2==x1, negative otherwise (can be redefined to transparently implement constraints, symmetries and periodicities) Note: it only works with scalar variables, otherwise raises an error.
Reimplemented from colvar::cvc. |
|
||||||||||||
|
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 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 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 type. Reimplemented from colvar::cvc. |
|
||||||||||||
|
Gradient (with respect to x1) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities).
Reimplemented from colvar::cvc. |
|
||||||||||||
|
Gradient (with respect to x2) of the square distance (can be redefined to transparently implement constraints, symmetries and periodicities).
Reimplemented from colvar::cvc. |
|
|
Atoms involved in the component.
Definition at line 712 of file colvarcomp.h. Referenced by apply_force(), calc_value(), and h_bond(). |
|
|
Atoms involved in the component.
Definition at line 712 of file colvarcomp.h. Referenced by apply_force(), calc_value(), and h_bond(). |
|
|
Integer exponent of the function denominator.
Definition at line 718 of file colvarcomp.h. Referenced by h_bond(). |
|
|
Integer exponent of the function numerator.
Definition at line 716 of file colvarcomp.h. Referenced by h_bond(). |
|
|
"Cutoff" distance between acceptor and donor
Definition at line 714 of file colvarcomp.h. Referenced by h_bond(). |
1.3.9.1