All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CMMotionRemover Class Reference

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

`#include <CMMotionRemover.h>`

Inheritance diagram for CMMotionRemover:

## Public Member Functions

| CMMotionRemover (int frequency=1)
| Create a CMMotionRemover. More...
int | getFrequency () const
| Get the frequency (in time steps) at which center of mass motion should be removed. More...
void | setFrequency (int freq)
| Set the frequency (in time steps) at which center of mass motion should be removed. More...
Public Member Functions inherited from Force
| Force ()
virtual | ~Force ()
int | getForceGroup () const
| Get the force group this Force belongs to. More...
void | setForceGroup (int group)
| Set the force group this Force belongs to. More...

## Protected Member Functions

ForceImpl * | createImpl () const
| When a Context is created, it invokes this method on each Force in the System. More...
Protected Member Functions inherited from Force
ForceImpl & | getImplInContext (Context &context)
| Get the ForceImpl corresponding to this Force in a Context. More...
ContextImpl & | getContextImpl (Context &context)
| Get the ContextImpl corresponding to a Context. More...

## 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

protectedvirtual

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