IMP
2.1.0
The Integrative Modeling Platform
|
A decorator for a rigid body. More...
#include <IMP/core/rigid_bodies.h>
Public Member Functions | |
RigidBody (::IMP::kernel::Model *m,::IMP::kernel::ParticleIndex id) | |
RigidBody (const IMP::kernel::ParticleAdaptor &d) | |
void | add_member (kernel::ParticleIndexAdaptor p) |
void | add_non_rigid_member (kernel::ParticleIndex pi) |
const kernel::ParticleIndexes & | get_body_member_particle_indexes () const |
algebra::Vector3D | get_coordinates () const |
Get the coordinates of the particle. | |
bool | get_coordinates_are_optimized () const |
const kernel::ParticleIndexes & | get_member_particle_indexes () const |
Return the members as particle pointers. More... | |
RigidMembers | get_members () const |
IMP::algebra::ReferenceFrame3D | get_reference_frame () const |
Get the reference frame for the local coordinates. | |
algebra::VectorD< 4 > | get_rotational_derivatives () const |
Get the derivatives of the quaternion. | |
algebra::Vector3D | get_torque () const |
void | normalize_rotation () |
Normalized the quaternion. | |
void | set_coordinates_are_optimized (bool tf) |
Set whether the rigid body coordinates are optimized. | |
void | set_is_rigid_member (kernel::ParticleIndex pi, bool tf) |
void | set_reference_frame (const IMP::algebra::ReferenceFrame3D &tr) |
Set the current reference frame. More... | |
void | set_reference_frame_from_members (const kernel::ParticleIndexes &members) |
void | set_reference_frame_lazy (const IMP::algebra::ReferenceFrame3D &tr) |
Change the reference, delay updating the members until evaluate. More... | |
void | show (std::ostream &out=std::cout) const |
void | update_members () |
Update the coordinates of the members. | |
Public Member Functions inherited from IMP::core::XYZ | |
XYZ (::IMP::kernel::Model *m,::IMP::kernel::ParticleIndex id) | |
XYZ (const IMP::kernel::ParticleAdaptor &d) | |
void | add_to_derivative (int i, Float v, DerivativeAccumulator &d) |
Add something to the derivative of the ith coordinate. | |
void | add_to_derivatives (const algebra::Vector3D &v, DerivativeAccumulator &d) |
Add something to the derivative of the coordinates. | |
Float | get_coordinate (int i) const |
Get the ith coordinate. | |
const algebra::Vector3D & | get_coordinates () const |
Convert it to a vector. More... | |
bool | get_coordinates_are_optimized () const |
Get whether the coordinates are optimized. More... | |
Float | get_derivative (int i) const |
Get the ith coordinate derivative. | |
algebra::Vector3D | get_derivatives () const |
Get the vector of derivatives. More... | |
algebra::Vector3D | get_vector_to (const XYZ &b) const |
Get the vector from this particle to another. | |
Float | get_x () const |
Float | get_y () const |
Float | get_z () const |
void | set_coordinate (unsigned int i, Float v) |
set the ith coordinate | |
void | set_coordinates (const algebra::Vector3D &v) |
set all coordinates from a vector | |
void | set_coordinates_are_optimized (bool tf) const |
Set whether the coordinates are optimized. | |
void | set_x (Float t) |
void | set_y (Float t) |
void | set_z (Float t) |
void | show (std::ostream &out=std::cout) const |
Public Member Functions inherited from IMP::kernel::Decorator | |
ParticleIndex | get_particle_index () const |
Particle * | get_particle () const |
Model * | get_model () const |
Returns the Model containing the particle. | |
Decorator (Particle *p) | |
Decorator () | |
Additional Inherited Members | |
Protected Member Functions inherited from IMP::kernel::Decorator | |
Decorator (kernel::Model *m, ParticleIndex pi) | |
Decorator (ParticleAdaptor p) | |
A rigid body particle describes a set of particles, known as the members, which move rigidly together. The rigid body is represented as an algebra::ReferenceFrame3D coupled with local coordinates (RigidMember::get_internal_coordinates()) for the members expressed in that reference frame. The global coordinates of the members are accessed, as with other global coordinates, via the XYZ::get_coordinates().
Since the members are simply a set of particles which move together they don't (necessarily) define a shape. For example, the members of the rigid body made from a molecular hierarchy would include particles corresponding to intermediate levels of the hierarchy. As a result, methods that use rigid bodies usually should simply take the list of particles they are interested in and then check for rigid bodies internally.
The initial reference of the rigid body is computed from the coordinates, masses and radii of the particles passed to the constructor, based on diagonalizing the inertial tensor (which is not stored, currently).
RigidBodies can be nested (that is, a RigidBody can have another RigidBody as a member). This can be useful for organizational reasons as well as for accelerating computations since since operations are affected by the total number of children contained in the rigid body being operated on. Examples of this include collision detection where if you have multiple representations of geometry at different resolutions it is faster to put each of them in a separate rigid body and then creat one rigid body containing all of them.
It is often desirable to randomize the orientation of a rigid body:
Definition at line 75 of file rigid_bodies.h.
void IMP::core::RigidBody::add_member | ( | kernel::ParticleIndexAdaptor | p | ) |
Add a member, properly handle rigid bodies and XYZ particles.
void IMP::core::RigidBody::add_non_rigid_member | ( | kernel::ParticleIndex | pi | ) |
Add a NonRigidMember. Currently RigidBody non-rigid members are not handler properly.
|
static |
Definition at line 124 of file rigid_bodies.h.
|
static |
Return true of the particle is a rigid body
Definition at line 137 of file rigid_bodies.h.
const kernel::ParticleIndexes& IMP::core::RigidBody::get_member_particle_indexes | ( | ) | const |
This member function is here for efficiency.
Definition at line 102 of file rigid_bodies.h.
algebra::Vector3D IMP::core::RigidBody::get_torque | ( | ) | const |
The units are kCal/Mol/Radian
Definition at line 210 of file rigid_bodies.h.
|
static |
Definition at line 124 of file rigid_bodies.h.
|
static |
Definition at line 124 of file rigid_bodies.h.
void IMP::core::RigidBody::set_is_rigid_member | ( | kernel::ParticleIndex | pi, |
bool | tf | ||
) |
Set whether a particular member is a rigid member or a non-rigid member.
void IMP::core::RigidBody::set_reference_frame | ( | const IMP::algebra::ReferenceFrame3D & | tr | ) |
All members of the rigid body will have their coordinates updated immediately.
void IMP::core::RigidBody::set_reference_frame_from_members | ( | const kernel::ParticleIndexes & | members | ) |
Update the reference frame of the rigid body based on the current coordinates of the passed members (nonpassed members are ignored). This can be used to update the rigid body after new coordinates were loaded for the members. The members are passed explictily since, typically, some are desired to just move along with the newly loaded rigid body.
void IMP::core::RigidBody::set_reference_frame_lazy | ( | const IMP::algebra::ReferenceFrame3D & | tr | ) |
|
static |
Setup the particle so it can be used with this decorator.
Definition at line 125 of file rigid_bodies.h.
|
static |
Create a rigid body with the passed reference frame as its initial position. Setup the particle so it can be used with this decorator.
Definition at line 128 of file rigid_bodies.h.