# CMMotionRemover Class Reference

This class prevents the center of mass of a System from drifting. More...

`#include <CMMotionRemover.h>`

Inheritance diagram for CMMotionRemover:

List of all members.

## 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 () const
| When a Context is created, it invokes this method on each Force in the System.

## Detailed Description

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.

## Constructor & Destructor Documentation

CMMotionRemover | ( | int | frequency = `1` | ) | `[explicit]`

Create a CMMotionRemover.

## Member Function Documentation

ForceImpl* createImpl | ( |  | ) | const`[protected, virtual]`

When a Context is created, it invokes this method on each Force in the System.

It should create a new ForceImpl object which can be used by the context for calculating forces. The ForceImpl will be deleted automatically when the Context is deleted.

Implements Force.

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.

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

- CMMotionRemover.h