IMP logo
IMP Reference Guide  2.22.0
The Integrative Modeling Platform
IMP::atom::CenterOfMass Class Reference

A particle that is the center of mass of other particles. More...

#include <IMP/atom/CenterOfMass.h>

+ Inheritance diagram for IMP::atom::CenterOfMass:

Detailed Description

A particle that is the center of mass of other particles.

A decorator which constrains a particle to be the center of mass of a set of other particles, and whose mass is the sum of their masses. The c.o.m. is updated before model evaluation and its derivatives are copied to its children, using a constraint that is created at setup time. The derivatives propagated to each particle are scaled based on its mass relative to the total mass.

Note
The maintenance of the invariant is done by an associated IMP::Constraint. As a result, the state is only guaranteed to be correct either during model evaluation, or immediately following model evaluation before any particles have been changed.

Definition at line 33 of file CenterOfMass.h.

Public Member Functions

 CenterOfMass (::IMP::Model *m,::IMP::ParticleIndex id)
 
 CenterOfMass (const IMP::ParticleAdaptor &d)
 
Constraintget_constraint () const
 
Float get_coordinate (int i) const
 
const algebra::Vector3Dget_coordinates () const
 
Float get_mass () const
 
void show (std::ostream &out=std::cout) const
 
- Public Member Functions inherited from IMP::Decorator
bool get_is_valid () const
 Returns true if constructed with a non-default constructor. More...
 
Modelget_model () const
 Returns the Model containing the particle. More...
 
Particleget_particle () const
 Returns the particle decorated by this decorator. More...
 
ParticleIndex get_particle_index () const
 Returns the particle index decorated by this decorator. More...
 
 operator Particle * () const
 
 operator ParticleIndex () const
 
Particleoperator-> () const
 

Static Public Member Functions

static bool get_is_setup (const IMP::ParticleAdaptor &p)
 
static bool get_is_setup (Model *m, ParticleIndex pi)
 
static CenterOfMass setup_particle (Model *m, ParticleIndex pi, ParticleIndexesAdaptor members)
 
static CenterOfMass setup_particle (IMP::ParticleAdaptor pa, ParticleIndexesAdaptor members)
 
static CenterOfMass setup_particle (Model *m, ParticleIndex pi, Refiner *refiner)
 
static CenterOfMass setup_particle (IMP::ParticleAdaptor pa, Refiner *refiner)
 
static void teardown_particle (CenterOfMass com)
 Make the particle no longer a center of mass. More...
 

Additional Inherited Members

- Protected Member Functions inherited from IMP::Decorator
 Decorator (Model *m, ParticleIndex pi)
 
 Decorator (ParticleAdaptor p)
 

Member Function Documentation

static CenterOfMass IMP::atom::CenterOfMass::setup_particle ( IMP::ParticleAdaptor  pa,
ParticleIndexesAdaptor  members 
)
static
Returns
a CenterOfMass object that decorates the particle specified by pa
See Also
setup_particle(m, pi, members )

Definition at line 81 of file CenterOfMass.h.

static CenterOfMass IMP::atom::CenterOfMass::setup_particle ( Model m,
ParticleIndex  pi,
ParticleIndexesAdaptor  members 
)
static

Sets up CenterOfMass over members, and constrains CenterOfMass to be computed before model evaluation and to propagate derivatives following model evaluation.

pi is decorated with core::XYZ and atom::Mass decorators, its coordinates are set to the current center of mass of pis, and its mass is set to the sum of their masses.

Returns
a CenterOfMass object that decorates particle pi

Definition at line 81 of file CenterOfMass.h.

static CenterOfMass IMP::atom::CenterOfMass::setup_particle ( IMP::ParticleAdaptor  pa,
Refiner refiner 
)
static
Returns
a CenterOfMass object that decorates the particle specified by pa
See Also
setup_particle(m, pi, refiner )

Definition at line 93 of file CenterOfMass.h.

static CenterOfMass IMP::atom::CenterOfMass::setup_particle ( Model m,
ParticleIndex  pi,
Refiner refiner 
)
static

Sets up CenterOfMass over particles passed by applying the refiner over the particle pi, and constrains CenterOfMass to be computed before model evaluation and to propagate derivatives following model evaluation.

pi is decorated with the core::XYZ and atom::Mass decorators, its coordinates are set to the current center of mass of refiner->get_refined_indexes(m, pi), and its mass is set to the sum of their masses.

Returns
a CenterOfMass object that decorates particle pi

Definition at line 93 of file CenterOfMass.h.

static void IMP::atom::CenterOfMass::teardown_particle ( CenterOfMass  com)
static

Make the particle no longer a center of mass.


The documentation for this class was generated from the following file: