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

Public Member Functions | |
| distance_dir (std::string const &conf) | |
| distance_dir () | |
| virtual | ~distance_dir () |
| 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). | |
Definition at line 362 of file colvarcomp.h.
|
|
Definition at line 412 of file colvarcomp_distances.C. References colvarvalue::type(). 00413 : distance (conf) 00414 { 00415 function_type = "distance_dir"; 00416 x.type (colvarvalue::type_unitvector); 00417 }
|
|
|
Definition at line 420 of file colvarcomp_distances.C. References colvarvalue::type(). 00421 : distance() 00422 { 00423 function_type = "distance_dir"; 00424 x.type (colvarvalue::type_unitvector); 00425 }
|
|
|
Definition at line 368 of file colvarcomp.h. 00368 {}
|
|
|
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
Reimplemented from colvar::distance. Definition at line 448 of file colvarcomp_distances.C. References colvarmodule::atom_group::apply_force(), colvarmodule::atom_group::noforce, and colvarvalue::rvector_value. 00449 {
00450 // remove the radial force component
00451 cvm::real const iprod = force.rvector_value * x.rvector_value;
00452 cvm::rvector const force_tang = (1.0 - iprod) * force.rvector_value;
00453
00454 if (!group1.noforce)
00455 group1.apply_force (-1.0 * force_tang);
00456
00457 if (!group2.noforce)
00458 group2.apply_force ( force_tang);
00459 }
|
|
|
Calculate the atomic gradients, to be reused later in order to apply forces.
Reimplemented from colvar::distance. Definition at line 442 of file colvarcomp_distances.C. 00443 {
00444 // gradients are computed on the fly within apply_force()
00445 }
|
|
|
Calculate the variable.
Reimplemented from colvar::distance. Definition at line 428 of file colvarcomp_distances.C. References colvarmodule::atom_group::center_of_mass(), colvarmodule::position_distance(), colvarmodule::atom_group::read_positions(), colvarmodule::atom_group::reset_atoms_data(), colvarvalue::rvector_value, and colvarmodule::rvector::unit(). 00429 {
00430 group1.reset_atoms_data();
00431 group2.reset_atoms_data();
00432
00433 group1.read_positions();
00434 group2.read_positions();
00435
00436 dist_v = cvm::position_distance (group1.center_of_mass(),
00437 group2.center_of_mass());
00438 x.rvector_value = dist_v.unit();
00439 }
|
1.3.9.1