OpenMM
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends
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.
 
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.
 
- Public Member Functions inherited from Force
 Force ()
 
virtual ~Force ()
 
int getForceGroup () const
 Get the force group this Force belongs to.
 
void setForceGroup (int group)
 Set the force group this Force belongs to.
 

Protected Member Functions

ForceImplcreateImpl ()
 When a Context is created, it invokes this method on each Force in the System.
 
- Protected Member Functions inherited from Force
ForceImplgetImplInContext (Context &context)
 Get the ForceImpl corresponding to this Force in a Context.
 
ContextImplgetContextImpl (Context &context)
 Get the ContextImpl corresponding to a Context.
 

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 ( )
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: