This class prevents the center of mass of a System from drifting. More...
#include <CMMotionRemover.h>
Public Member Functions | |
CMMotionRemover (int frequency=1) | |
Create a CMMotionRemover. | |
int | getFrequency () const |
Get the frequency (in time steps) at which center of mass motion should be removed. | |
void | setFrequency (int freq) |
Set the frequency (in time steps) at which center of mass motion should be removed. | |
Protected Member Functions | |
ForceImpl * | createImpl () |
When a Context is created, it invokes this method on each Force in the System. |
This class prevents the center of mass of a System from drifting.
At each time step, it calculates the center of mass momentum, then adjusts the individual particle velocities to make it zero.
CMMotionRemover | ( | int | frequency = 1 |
) |
Create a CMMotionRemover.
ForceImpl* createImpl | ( | ) | [protected, virtual] |
int getFrequency | ( | ) | const [inline] |
Get the frequency (in time steps) at which center of mass motion should be removed.
void setFrequency | ( | int | freq | ) | [inline] |
Set the frequency (in time steps) at which center of mass motion should be removed.