IMP  2.0.1
The Integrative Modeling Platform
RemoveRigidMotionOptimizerState.h
Go to the documentation of this file.
1 /**
2  * \file IMP/atom/RemoveRigidMotionOptimizerState.h
3  * \brief Remove rigid rotation and translation during molecular dynamics.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPATOM_REMOVE_RIGID_MOTION_OPTIMIZER_STATE_H
10 #define IMPATOM_REMOVE_RIGID_MOTION_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>
17 
18 IMPATOM_BEGIN_NAMESPACE
19 
20 //! Removes rigid translation and rotation from the particles.
21 class IMPATOMEXPORT RemoveRigidMotionOptimizerState : public OptimizerState
22 {
23  public:
24  RemoveRigidMotionOptimizerState(const ParticlesTemp &pis,
25  unsigned skip_steps);
26 
27  //! Set the number of update calls to skip between removals.
28  void set_skip_steps(unsigned skip_steps) {
29  skip_steps_ = skip_steps;
30  }
31 
32  //! get the number of update calls to skip between rescaling.
33  unsigned int get_skip_steps() {
34  return skip_steps_;
35  }
36 
37 
38  //! Set the particles to use.
39  void set_particles(const Particles &pis) {
40  pis_=pis;
41  }
42 
43  //! Remove rigid motion now
44  void remove_rigid_motion() const;
45 
47 
48 private:
49  void remove_linear() const;
50  void remove_angular() const;
51  Particles pis_;
52  unsigned skip_steps_;
53  unsigned call_number_;
54 
55  //! Keys of the xyz velocities
56  FloatKey vs_[3];
57 };
58 
60 
61 IMPATOM_END_NAMESPACE
62 
63 #endif /* IMPATOM_REMOVE_RIGID_MOTION_OPTIMIZER_STATE_H */