CMMotionRemover

class CMMotionRemover : public OpenMM::Force

This class prevents the center of mass of a System from drifting. It periodically calculates the center of mass momentum, then adjusts the individual particle velocities to make it zero.

CMMotionRemover is an effective way to prevent the system from drifting, but it is not a rigorous constraint. The center of mass may still move slightly, and may still be observed to have a small nonzero velocity.

Public Functions

explicit CMMotionRemover(int frequency = 1)

Create a CMMotionRemover.

inline 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

inline virtual bool usesPeriodicBoundaryConditions() const

Returns whether or not this force makes use of periodic boundary conditions.

Returns:

true if force uses PBC and false otherwise