IMP  2.1.0
The Integrative Modeling Platform
LangevinThermostatOptimizerState.h
Go to the documentation of this file.
1 /**
2  * \file IMP/atom/LangevinThermostatOptimizerState.h
3  * \brief Maintains temperature during molecular dynamics using
4  * a Langevin thermostat.
5  *
6  * Copyright 2007-2013 IMP Inventors. All rights reserved.
7  *
8  */
9 
10 #ifndef IMPATOM_LANGEVIN_THERMOSTAT_OPTIMIZER_STATE_H
11 #define IMPATOM_LANGEVIN_THERMOSTAT_OPTIMIZER_STATE_H
12 
13 #include <IMP/atom/atom_config.h>
14 #include <IMP/kernel/Particle.h>
15 #include <IMP/base_types.h>
16 #include <IMP/OptimizerState.h>
18 
19 IMPATOM_BEGIN_NAMESPACE
20 
21 //! Maintains temperature during molecular dynamics.
22 /** The thermostat scales velocities using the algorithm described in
23  G. Bussi and M. Parrinello "Accurate sampling using Langevin dynamics",
24  Phys. Rev. E 75, 056707 (2007)
25  */
26 class IMPATOMEXPORT LangevinThermostatOptimizerState : public OptimizerState {
27  public:
28  /** \deprecated_at{2.1} Use constructor that takes indexes. */
29  IMPATOM_DEPRECATED_FUNCTION_DECL(2.1)
31  double temperature, double gamma);
32 
33  LangevinThermostatOptimizerState(Model *m, ParticleIndexesAdaptor pis,
34  double temperature, double gamma);
35 
36  //! Set the particles to use.
37  void set_particles(const kernel::Particles &pis) { pis_ = pis; }
38 
39  double get_temperature() { return temperature_; }
40 
41  double get_gamma() { return gamma_; }
42 
43  void set_temperature(double temperature) { temperature_ = temperature; }
44 
45  void set_gamma(double gamma) { gamma_ = gamma; }
46 
47  //! Rescale the velocities now
48  void rescale_velocities() const;
49 
51 
52  protected:
53  virtual void do_update(unsigned int) IMP_OVERRIDE;
54 
55  private:
56  kernel::Particles pis_;
57  double temperature_;
58  double gamma_;
59 
60  //! Keys of the xyz velocities
61  FloatKey vs_[3];
62 };
63 
66 
67 IMPATOM_END_NAMESPACE
68 
69 #endif /* IMPATOM_LANGEVIN_THERMOSTAT_OPTIMIZER_STATE_H */
Maintains temperature during molecular dynamics.
Import IMP/kernel/base_types.h in the namespace.
virtual void do_update(unsigned int)
void set_particles(const kernel::Particles &pis)
Set the particles to use.
Shared optimizer state that is invoked upon commitment of new coordinates.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Import IMP/kernel/optimizer_state_macros.h in the namespace.
Classes to handle individual model particles.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
Import IMP/kernel/OptimizerState.h in the namespace.
Class for storing model, its restraints, constraints, and particles.