9#ifndef IMPATOM_MOLECULAR_DYNAMICS_H
10#define IMPATOM_MOLECULAR_DYNAMICS_H
12#include <IMP/atom/atom_config.h>
17#include <cereal/access.hpp>
18#include <cereal/types/base_class.hpp>
20IMPATOM_BEGIN_NAMESPACE
28 m->add_attribute(get_velocity_key(), pi, v);
33 return m->get_has_attribute(get_velocity_key(), pi);
46 m->set_attribute(get_velocity_key(), pi, v);
52 return m->get_attribute(get_velocity_key(), pi);
64 m->add_attribute(get_velocities_key(), pi, v.get_coordinates());
74 return m->get_has_attribute(get_velocities_key(), pi);
84 m->set_attribute(get_velocities_key(), pi, v.get_coordinates());
184 friend class cereal::access;
185 template<
class Archive>
void serialize(Archive &ar) {
Base class for all optimizers.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Base class for "simulators", such as molecular dynamics.
Macros for maintaining molecular hierarchies.
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
Model * get_model() const
Returns the Model containing the particle.
Class for storing model, its restraints, constraints, and particles.
A particle with angular velocity.
A particle with linear (XYZ) velocity.
Simple molecular dynamics simulator.
void set_velocity_cap(Float velocity_cap)
Set maximum velocity in A/fs.
virtual void assign_velocities(Float temperature)
Assign velocities representative of the given temperature.
void cap_velocity_component(Float &vel)
Cap a velocity component to the maximum value.
virtual double do_step(const ParticleIndexes &sc, double dt) override
Perform a single time step.
virtual void propagate_velocities(const ParticleIndexes &ps, double step_size)
Second part of velocity Verlet (update velocity).
virtual Float get_kinetic_energy() const
Return the current kinetic energy of the system, in kcal/mol.
virtual bool get_is_simulation_particle(ParticleIndex p) const override
Return true if the passed particle is appropriate for the simulation.
int degrees_of_freedom_
Number of degrees of freedom in the system.
int get_degrees_of_freedom()
Get number of degrees of freedom in the system.
Float velocity_cap_
Maximum absolute value of a single velocity component.
virtual void propagate_coordinates(const ParticleIndexes &ps, double step_size)
First part of velocity Verlet (update coordinates and half-step velocity).
MolecularDynamics(Model *m)
Float get_velocity_cap() const
Get the current value of the velocity cap.
Float get_kinetic_temperature(Float ekinetic) const
Return the current kinetic temperature of the system.
virtual void setup(const ParticleIndexes &ps) override
ParticleIndexes get_simulation_particle_indexes() const
Simulator(Model *m, std::string name="Simulator %1%", double wave_factor=1.0)
Index< ParticleIndexTag > ParticleIndex
double Float
Basic floating-point value (could be float, double...).
Key< 16 > Vector3DKey
The type used to identify 3D vector attributes in the Particles.
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Key< 10 > FloatsKey
The type used to identify float vector attributes in the Particles.
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.