OpenMM
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends
ThreeParticleAverageSite Class Reference

This is a VirtualSite that computes the particle location as a weighted average of three other particle's locations. More...

#include <VirtualSite.h>

+ Inheritance diagram for ThreeParticleAverageSite:

Public Member Functions

 ThreeParticleAverageSite (int particle1, int particle2, int particle3, double weight1, double weight2, double weight3)
 Create a new ThreeParticleAverageSite virtual site.
 
double getWeight (int particle) const
 Get the weight factor used for a particle this virtual site depends on.
 
- Public Member Functions inherited from VirtualSite
virtual ~VirtualSite ()
 
int getNumParticles () const
 Get the number of particles this virtual site depends on.
 
int getParticle (int particle) const
 Get the index of a particle this virtual site depends on.
 

Additional Inherited Members

- Protected Member Functions inherited from VirtualSite
 VirtualSite ()
 
void setParticles (const std::vector< int > &particleIndices)
 

Detailed Description

This is a VirtualSite that computes the particle location as a weighted average of three other particle's locations.

Assuming the weights add up to 1, this means the virtual site is in the plane of the three particles.

Constructor & Destructor Documentation

ThreeParticleAverageSite ( int  particle1,
int  particle2,
int  particle3,
double  weight1,
double  weight2,
double  weight3 
)

Create a new ThreeParticleAverageSite virtual site.

Normally the weights should add up to 1, although this is not strictly required.

Parameters
particle1the index of the first particle
particle2the index of the second particle
particle3the index of the third particle
weight1the weight factor (between 0 and 1) for the first particle
weight2the weight factor (between 0 and 1) for the second particle
weight2the weight factor (between 0 and 1) for the third particle

Member Function Documentation

double getWeight ( int  particle) const

Get the weight factor used for a particle this virtual site depends on.

Parameters
particlethe particle to get (between 0 and getNumParticles())
Returns
the weight factor used for that particle

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