9 #ifndef IMPATOM_MOLECULAR_DYNAMICS_H
10 #define IMPATOM_MOLECULAR_DYNAMICS_H
12 #include <IMP/atom/atom_config.h>
18 IMPATOM_BEGIN_NAMESPACE
32 static FloatKey get_velocity_key(
unsigned int i) {
40 return m->get_has_attribute(get_velocity_key(0), pi)
41 && m->get_has_attribute(get_velocity_key(1), pi)
42 && m->get_has_attribute(get_velocity_key(2), pi);
81 static FloatKey get_velocity_key(
unsigned int i) {
89 return m->get_has_attribute(get_velocity_key(0), pi)
90 && m->get_has_attribute(get_velocity_key(1), pi)
91 && m->get_has_attribute(get_velocity_key(2), pi)
92 && m->get_has_attribute(get_velocity_key(3), pi);
138 virtual Float get_kinetic_energy()
const;
143 Float get_kinetic_temperature(
Float ekinetic)
const;
158 virtual void assign_velocities(
Float temperature);
183 vel = std::min(vel, velocity_cap_);
185 vel = std::max(vel, -velocity_cap_);
196 IMPATOM_END_NAMESPACE
A particle with angular velocity.
The base class for simulators.
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Model * get_model() const
Returns the Model containing the particle.
virtual bool get_is_simulation_particle(ParticleIndex p) const =0
Return true if the passed particle is appropriate for the simulation.
A particle with linear (XYZ) velocity.
Base class for all optimizers.
virtual double do_step(const ParticleIndexes &sc, double dt)=0
Perform a single time step.
Class for storing model, its restraints, constraints, and particles.
virtual void setup(const ParticleIndexes &)
void set_velocity_cap(Float velocity_cap)
Set maximum velocity in A/fs.
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
Simple molecular dynamics optimizer.
int degrees_of_freedom_
Number of degrees of freedom in the system.
Key< 0, true > FloatKey
The type used to identify float attributes in the Particles.
void set_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
Simple molecular dynamics optimizer.
#define IMP_DECORATOR_SETUP_0(Name)
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
void cap_velocity_component(Float &vel)
Cap a velocity component to the maximum value.
Various important macros for implementing decorators.
Float velocity_cap_
Maximum absolute value of a single velocity component.
#define IMP_DECORATOR_METHODS(Name, Parent)
double Float
Basic floating-point value (could be float, double...)
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Type get_attribute(TypeKey attribute_key, ParticleIndex particle)
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.