IMP logo
IMP Reference Guide  develop.abbcc53e0c,2026/02/18
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-2026 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/Particle.h>
15 #include <IMP/base_types.h>
16 #include <IMP/OptimizerState.h>
17 
18 IMPATOM_BEGIN_NAMESPACE
19 
20 //! Maintains temperature during molecular dynamics.
21 /** The thermostat scales velocities using the algorithm described in
22  G. Bussi and M. Parrinello "Accurate sampling using Langevin dynamics",
23  Phys. Rev. E 75, 056707 (2007)
24  */
25 class IMPATOMEXPORT LangevinThermostatOptimizerState : public OptimizerState {
26  public:
28  double temperature, double gamma);
29 
30  //! Set the particles to use.
31  void set_particles(const Particles &pis) { pis_ = pis; }
32 
33  Particles get_particles() const { return pis_; }
34 
35  double get_temperature() const { return temperature_; }
36 
37  double get_gamma() const { return gamma_; }
38 
39  void set_temperature(double temperature) { temperature_ = temperature; }
40 
41  void set_gamma(double gamma) { gamma_ = gamma; }
42 
43  //! Rescale the velocities now
44  void rescale_velocities() const;
45 
47 
48  protected:
49  virtual void do_update(unsigned int) override;
50 
51  private:
52  Particles pis_;
53  double temperature_;
54  double gamma_;
55 };
56 
59 
60 IMPATOM_END_NAMESPACE
61 
62 #endif /* IMPATOM_LANGEVIN_THERMOSTAT_OPTIMIZER_STATE_H */
void set_particles(const Particles &pis)
Set the particles to use.
Maintains temperature during molecular dynamics.
Basic types used by IMP.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
virtual void do_update(unsigned int)
ParticlesTemp get_particles(Model *m, const ParticleIndexes &ps)
Get the particles from a list of indexes.
Take Decorator, Particle or ParticleIndex.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
Definition: object_macros.h:44
Shared optimizer state that is invoked upon commitment of new coordinates.
Shared optimizer state.