Skip to content

Commit

Permalink
clearer documentation of time step used in BD clas
Browse files Browse the repository at this point in the history
  • Loading branch information
barakr committed Oct 16, 2017
1 parent ac477b3 commit 96e914f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
10 changes: 7 additions & 3 deletions modules/atom/include/BrownianDynamics.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions modules/atom/include/BrownianDynamicsTAMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
11 changes: 5 additions & 6 deletions modules/atom/src/BrownianDynamics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,17 @@ 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
// M = 0.0; // DEBUG: monitor kinetic energy
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<unsigned int>(b + chunk_size, ps.size()));
, "brownian");
}
Expand All @@ -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 {
Expand Down

0 comments on commit 96e914f

Please sign in to comment.