IMP logo
IMP Reference Guide  develop.abbcc53e0c,2026/02/18
The Integrative Modeling Platform
VelocityScalingOptimizerState.h
Go to the documentation of this file.
1 /**
2  * \file IMP/atom/VelocityScalingOptimizerState.h
3  * \brief Maintains temperature during molecular dynamics by velocity scaling.
4  *
5  * Copyright 2007-2026 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPATOM_VELOCITY_SCALING_OPTIMIZER_STATE_H
10 #define IMPATOM_VELOCITY_SCALING_OPTIMIZER_STATE_H
11 
12 #include <IMP/atom/atom_config.h>
13 #include <IMP/Particle.h>
14 #include <IMP/base_types.h>
15 #include <IMP/OptimizerState.h>
16 
17 IMPATOM_BEGIN_NAMESPACE
18 
19 //! Maintains temperature during molecular dynamics by velocity scaling.
20 /** This OptimizerState, when used with the MolecularDynamics optimizer,
21  implements a simple thermostat by periodically rescaling the velocities.
22  (Note that this results in discontinuous dynamics.)
23  \see MolecularDynamics
24  */
25 class IMPATOMEXPORT VelocityScalingOptimizerState : public OptimizerState {
26  public:
29  double temperature);
30 
31  //! Set the particles to use.
32  void set_particles(const Particles &pis) { pis_ = pis; }
33 
34  //! Set the temperature to use.
35  void set_temperature(Float temperature) { temperature_ = temperature; }
36 
37  Particles get_particles() const { return pis_; }
38 
39  Float get_temperature() const { return temperature_; }
40 
41  //! Rescale the velocities now
42  void rescale_velocities() const;
43 
45 
46  protected:
47  virtual void do_update(unsigned int call) override;
48 
49  private:
50  Particles pis_;
51  Float temperature_;
52 };
53 
55 
56 IMPATOM_END_NAMESPACE
57 
58 #endif /* IMPATOM_VELOCITY_SCALING_OPTIMIZER_STATE_H */
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
Maintains temperature during molecular dynamics by velocity scaling.
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
void set_particles(const Particles &pis)
Set the particles to use.
Shared optimizer state that is invoked upon commitment of new coordinates.
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:19
void set_temperature(Float temperature)
Set the temperature to use.
Shared optimizer state.