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