IMP logo
IMP Reference Guide  2.6.1
The Integrative Modeling Platform
BrownianDynamicsTAMD.h
Go to the documentation of this file.
1 /**
2  * \file IMP/atom/BrownianDynamicsTAMD.h
3  * \brief Simple molecular dynamics optimizer.
4  *
5  * Copyright 2007-2016 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPATOM_BROWNIAN_DYNAMICS_TAMD_H
10 #define IMPATOM_BROWNIAN_DYNAMICS_TAMD_H
11 
12 #include <IMP/atom/atom_config.h>
13 #include "Diffusion.h"
14 #include "atom_macros.h"
16 #include <IMP/Particle.h>
17 #include <IMP/Optimizer.h>
18 #include <IMP/internal/units.h>
19 #include <IMP/algebra/Vector3D.h>
20 
21 IMPATOM_BEGIN_NAMESPACE
22 
23 // for swig
24 class SimulationParameters;
25 
26 //! Simple Brownian dynamics simulator.
27 /** This is an implementation of a Brownian Dynamics simulator.
28 
29  _Input particles and score_
30 
31  Each optimized particle must have x,y,z attributes
32  that are optimizable. In addition, each optimized particle must be
33  decorated with the Diffusion decorator. Optionally, the
34  RigidBodyDiffusion decorator can be used to specify a rotational
35  diffusion coefficient for core::RigidBody particles. The
36  optimizer assumes the scoring function to be energy in kcal/mol, and the xyz
37  coordinates to be in angstroms and the diffusion coefficient of
38  each particle be in \f$A^2/fs\f$ (or \f$Radian^2/fs\f$ for rotational
39  diffusion coefficient). Particles without optimized x,y,z
40  and nonoptimized D are skipped.
41 
42  The optimizer can either automatically determine which particles
43  to use from the model or be passed a SingletonContainer for the
44  particles. If such a container is passed, particles added to it
45  during optimization state updates are handled properly.
46 
47  _Simulation_
48 
49  At each simulation time step, each particle is translated in the
50  direction of the sum of a random diffusion vector and the gradient
51  of the scoring function (force field) at the particle
52  coordinates. The translation is proportional to the particle
53  diffusion coefficient, the time step size, and the inverse of kT.
54  Note that particles masses are not considered, only their
55  diffusion coefficients.
56 
57  Similarly, rigid bodies are rotated by the sum of a random torque and a
58  force field torque, proportionally to the rotational diffusion
59  coefficient, the time step size, and inversely proportional kT.
60 
61  If the skt (stochastic runge kutta) flag is true, the simulation is
62  altered slightly to apply the SKT scheme.
63 
64  \see Diffusion
65  \see RigidBodyDiffusion
66  */
67 class IMPATOMEXPORT BrownianDynamicsTAMD : public BrownianDynamics {
68  public:
69  //! Create the optimizer
70  /** If sc is not null, that container will be used to find particles
71  to move, otherwise the model will be searched.
72  @param m model associated with bd
73  @param name name of bd object
74  @param wave_factor for wave step function, see Simulator object,
75  if >1.001 or so, creates a wave of time steps
76  that are larger by up to wave_factor from
77  formal maximal time step
78 
79  @note wave_factor is an advanced feature - if you're not sure, just use
80  its default, see also Simulator::simulate_wave()
81  */
83  std::string name = "BrownianDynamicsTAMD%1%",
84  double wave_factor = 1.0);
85 
86  protected:
87  /** advances a chunk of ps from index begin to end
88 
89  @param dtfs time step in femtoseconds
90  @param ikt inverse kT for current chunk step
91  @param ps particle indexes to advance
92  @param begin beginning index of chunk of ps
93  @param end end index of chunk of ps
94  */
95  void do_advance_chunk(double dtfs, double ikt,
96  const ParticleIndexes &ps,
97  unsigned int begin, unsigned int end)
99 
100  private:
101  void advance_coordinates_1(ParticleIndex pi, unsigned int i,
102  double dtfs, double ikT);
103  void advance_coordinates_0(ParticleIndex pi, unsigned int i,
104  double dtfs, double ikT);
105  void advance_orientation_0(ParticleIndex pi, double dtfs, double ikT);
106 };
107 
108 IMPATOM_END_NAMESPACE
109 
110 #endif /* IMPATOM_BROWNIAN_DYNAMICS_TAMD_H */
A decorator for a diffusing particle.
Simple molecular dynamics optimizer.
Simple Brownian dynamics simulator.
Base class for all optimizers.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
Simple Brownian dynamics simulator.
virtual void do_advance_chunk(double dtfs, double ikt, const ParticleIndexes &ps, unsigned int begin, unsigned int end)
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Various important macros for implementing decorators.
Simple 3D vector class.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.