10#ifndef IMPNPCTRANSPORT_RELAXING_SPRING_H
11#define IMPNPCTRANSPORT_RELAXING_SPRING_H
13#include "npctransport_config.h"
18IMPNPCTRANSPORT_BEGIN_NAMESPACE
25class IMPNPCTRANSPORTEXPORT
26RelaxingSpring :
public Decorator
43 double equilibrium_rest_length_factor,
44 double rest_length_diffusion_coefficient);
66 double, equilibrium_rest_length_factor,
67 double, rest_length_diffusion_coefficient);
89 Particle* get_bonded_particle_0()
const{
91 return this_p->get_value(get_bonded_particle_0_key());
94 Particle* get_bonded_particle_1()
const{
96 return this_p->get_value(get_bonded_particle_1_key());
100 return get_bonded_particle_0()->get_index();
103 ParticleIndex get_bonded_particle_index_1()
const{
104 return get_bonded_particle_1()->get_index();
109 get_equilibrium_rest_length_factor_key(),
120 void add_to_rest_length_derivative
129 double get_rest_length_derivative()
131 return get_model()->get_derivative( get_rest_length_key(),
132 get_particle_index() );
141IMPNPCTRANSPORT_END_NAMESPACE
The base class for decorators.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
Model * get_model() const
Returns the Model containing the particle.
Particle * get_particle() const
Returns the particle decorated by this decorator.
Class for adding derivatives from restraints to the model.
Class for storing model, its restraints, constraints, and particles.
Class to handle individual particles of a Model object.
static FloatKey get_equilibrium_rest_length_factor_key()
get decorator key for spring equilibrium rest length factor
static FloatKey get_rest_length_key()
get decorator key for spring rest length
static FloatKey get_rest_length_diffusion_coefficient_key()
get decorator key for diffusion coefficient of rest length
static bool get_is_setup(Model *m, ParticleIndex pi)
Return true if the particle is an instance of an Transporting.
Helper macros for implementing Decorators.
#define IMP_DECORATOR_GET_SET(name, AttributeKey, Type, ReturnType)
Define methods for getting and setting a particular simple field.
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
#define IMP_DECORATOR_SETUP_4(Name, FirstArgumentType, first_argument_name, SecondArgumentType, second_argument_name, ThirdArgumentType, third_argument_name, FourthArgumentType, fourth_argument_name)
#define IMP_DECORATOR_METHODS(Name, Parent)
Index< ParticleIndexTag > ParticleIndex
double Float
Basic floating-point value (could be float, double...).
Key< 0 > FloatKey
The type used to identify float attributes in the Particles.
Key< 3 > ParticleIndexKey
The type used to identify a particle attribute in the Particles.