There is now some code to use SingletonModifiers and a ScoreState and
ParticleRefiners to, for example, make sure that each residue defines
a sphere which contains all its atoms and that derivatives are
propagated properly. Such would probably also make a good model for
rigid bodies as all we would have to write would be four very simple
classes:
- a RigidBodyDecorator which inherits from XYZDecorator and adds a
quaternion
- a RigidBodyComponentDecorator which inherits from XYZDecorator and
adds a set of coordinates relative to its original frame
- a TorquesFromRefinedSingletonModifier (like
DerivativesFromRefinedSingletonModifier) which uses the derivatives of
the particles produced by a particle refiner to apply torques to a
rigid body
- a TransformComponentsSingletonModifier which applies the transform
in a RigidBodyDecorator particle to each of the
RigidBodyComponentDecorator particles produced by a particle refiner
Then they could be tied together just as in the residue cover example
and the rigid bodies could be trivially defined through a molecular
hierarchy or any other particle refiner you want to use.