9 #ifndef IMPATOM_DIFFUSION_H
10 #define IMPATOM_DIFFUSION_H
12 #include <IMP/atom/atom_config.h>
16 #include <IMP/kernel/internal/constants.h>
21 IMPATOM_BEGIN_NAMESPACE
38 "Particle must already be an XYZ particle");
44 do_setup_particle(m, pi, D);
57 return m->get_has_attribute(get_diffusion_coefficient_key(), p);
59 void set_diffusion_coefficient(
double d) {
60 get_particle()->set_value(get_diffusion_coefficient_key(), d);
67 static FloatKey get_diffusion_coefficient_key();
70 IMPATOMEXPORT
double get_diffusion_coefficient_from_cm2_per_second(
double din);
87 (get_rotational_diffusion_coefficient_key(),
90 void set_rotational_diffusion_coefficient(
double d)
const {
91 return get_particle()->set_value(get_rotational_diffusion_coefficient_key(),
97 return m->get_has_attribute(get_rotational_diffusion_coefficient_key(), p);
101 static FloatKey get_rotational_diffusion_coefficient_key();
104 IMP_DECORATORS(RigidBodyDiffusion, RigidBodyDiffusions, Diffusions);
106 IMPATOM_END_NAMESPACE
#define IMP_DECORATOR_SETUP_2(Name, FirstArgumentType, first_argument_name,SecondArgumentType, second_argument_name)
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
Particle * get_particle() const
Returns the particle decorated by this decorator.
#define IMP_DECORATOR_METHODS(Name, Parent)
Model * get_model() const
Returns the Model containing the particle.
static XYZ setup_particle(kernel::Model *m, ParticleIndex pi)
Type get_attribute(TypeKey attribute_key, ParticleIndex particle)
static bool get_is_setup(kernel::Model *m, kernel::ParticleIndex p)
Return true if the particle is an instance of an Diffusion.
double get_rotational_diffusion_coefficient(const algebra::Rotation3Ds &displacements, double dt)
#define IMP_DECORATOR_SETUP_0(Name)
A decorator for a particle with x,y,z coordinates.
double Float
Basic floating-point value (could be float, double...)
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
static bool get_is_setup(kernel::Model *m, kernel::ParticleIndex p)
Return true if the particle is an instance of an Diffusion.
double get_diffusion_coefficient(const algebra::Vector3Ds &displacements, double dt)
A decorator for a diffusing particle with a diffusion coefficient.
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
Decorator for a sphere-like particle.
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
Key< 0, true > FloatKey
The type used to identify float attributes in the Particles.
Class for storing model, its restraints, constraints, and particles.