diff --git a/modules/atom/include/BrownianDynamics.h b/modules/atom/include/BrownianDynamics.h index 32147821a0..372fc484dc 100644 --- a/modules/atom/include/BrownianDynamics.h +++ b/modules/atom/include/BrownianDynamics.h @@ -68,6 +68,10 @@ class SimulationParameters; If the skt (stochastic Runge Kutta) flag is true, the simulation is altered slightly to apply the SKT scheme. + _Time step_ + The time step is always equal precisely to Simulater::get_maximum_time_step() + when using either Simulator::simulate() or Optimizer::optimize() + \see Diffusion \see RigidBodyDiffusion */ @@ -114,13 +118,13 @@ class IMPATOMEXPORT BrownianDynamics : public Simulator { /** Calls do_advance_chunk() to advance ps in chunks @param sc particles to simulate in this step - @param dt maximal step size in femtoseconds + @param dt_fs step size in femtoseconds @return the time step actually simulated (for this class, - it is always equal to the inut dt) + it is always equal to the input dt_fs) */ virtual double do_step(const ParticleIndexes &sc, - double dt) IMP_OVERRIDE; + double dt_fs) IMP_OVERRIDE; virtual bool get_is_simulation_particle(ParticleIndex p) const IMP_OVERRIDE; diff --git a/modules/atom/include/BrownianDynamicsTAMD.h b/modules/atom/include/BrownianDynamicsTAMD.h index 3a0502b726..7ff4b13890 100644 --- a/modules/atom/include/BrownianDynamicsTAMD.h +++ b/modules/atom/include/BrownianDynamicsTAMD.h @@ -62,6 +62,10 @@ class SimulationParameters; If the skt (stochastic runge kutta) flag is true, the simulation is altered slightly to apply the SKT scheme. + _Time step_ + The time step is always equal precisely to Simulater::get_maximum_time_step() + when using either Simulator::simulate() or Optimizer::optimize() + \see Diffusion \see RigidBodyDiffusion */ diff --git a/modules/atom/src/BrownianDynamics.cpp b/modules/atom/src/BrownianDynamics.cpp index b5accd5ede..500ae62568 100644 --- a/modules/atom/src/BrownianDynamics.cpp +++ b/modules/atom/src/BrownianDynamics.cpp @@ -276,9 +276,8 @@ BrownianDynamics::reset_random_pool() */ double BrownianDynamics::do_step -(const ParticleIndexes &ps, double dt) +(const ParticleIndexes &ps, double dt_fs) { - double dtfs(dt); double ikT = 1.0 / get_kt(); get_scoring_function()->evaluate(true); // Ek = 0.0; // DEBUG: monitor kinetic energy @@ -286,8 +285,8 @@ BrownianDynamics::do_step const unsigned int chunk_size = 5000; for (unsigned int b = 0; b < ps.size(); b += chunk_size) { IMP_TASK_SHARED( - (dtfs, ikT, b), (ps), - do_advance_chunk(dtfs, ikT, ps, b, + (dt_fs, ikT, b), (ps), + do_advance_chunk(dt_fs, ikT, ps, b, std::min(b + chunk_size, ps.size())); , "brownian"); } @@ -302,10 +301,10 @@ BrownianDynamics::do_step if (srk_) { get_scoring_function()->evaluate(true); for (unsigned int i = 0; i < ps.size(); ++i) { - advance_coordinates_1(ps[i], i, dtfs, ikT); + advance_coordinates_1(ps[i], i, dt_fs, ikT); } } - return dt; + return dt_fs; } namespace {