version 1.28 | version 1.29 |
---|
| |
// TODO: put it in the restart information | // TODO: put it in the restart information |
if (cvm::step_relative() == 0) { | if (cvm::step_relative() == 0) { |
xr = x; | xr = x; |
vr = 0.0; // (already 0; added for clarity) | vr.reset(); // (already 0; added for clarity) |
} | } |
| |
// report the restraint center as "value" | // report the restraint center as "value" |
| |
if (is_enabled(f_cv_extended_Lagrangian)) { | if (is_enabled(f_cv_extended_Lagrangian)) { |
| |
cvm::real dt = cvm::dt(); | cvm::real dt = cvm::dt(); |
cvm::real f_ext; | colvarvalue f_ext(fr.type()); |
| f_ext.reset(); |
| |
// the total force is applied to the fictitious mass, while the | // the total force is applied to the fictitious mass, while the |
// atoms only feel the harmonic force | // atoms only feel the harmonic force |
| |
potential_energy = 0.5 * ext_force_k * this->dist2(xr, x); | potential_energy = 0.5 * ext_force_k * this->dist2(xr, x); |
// leap to v_(i+1/2) | // leap to v_(i+1/2) |
if (is_enabled(f_cv_Langevin)) { | if (is_enabled(f_cv_Langevin)) { |
vr -= dt * ext_gamma * vr.real_value; | vr -= dt * ext_gamma * vr; |
vr += dt * ext_sigma * cvm::rand_gaussian() / ext_mass; | colvarvalue rnd(x); |
| rnd.set_random(); |
| vr += dt * ext_sigma * rnd / ext_mass; |
} | } |
vr += (0.5 * dt) * f_ext / ext_mass; | vr += (0.5 * dt) * f_ext / ext_mass; |
xr += dt * vr; | xr += dt * vr; |