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_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
#define IMP_DECORATOR_METHODS(Name, Parent)
Model * get_model() const
Returns the Model containing the particle.
A particle with linear (XYZ) velocity.
Type get_attribute(TypeKey attribute_key, ParticleIndex particle)
Import IMP/kernel/Optimizer.h in the namespace.
void set_velocity_cap(Float velocity_cap)
Set maximum velocity in A/fs.
Simple molecular dynamics optimizer.
int degrees_of_freedom_
Number of degrees of freedom in the system.
#define IMP_DECORATOR_SETUP_0(Name)
void set_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
Simple molecular dynamics optimizer.
Classes to handle individual model particles. (Note that implementation of inline functions in in int...
virtual bool get_is_simulation_particle(kernel::ParticleIndex p) const =0
Return true if the passed particle is appropriate for the simulation.
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.
virtual void setup(const kernel::ParticleIndexes &)
double Float
Basic floating-point value (could be float, double...)
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
virtual double do_step(const kernel::ParticleIndexes &sc, double dt)=0
Perform a single time step.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
Key< 0, true > FloatKey
The type used to identify float attributes in the Particles.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for storing model, its restraints, constraints, and particles.