OpenMM
|
This is a VirtualSite that computes the particle location as a weighted average of two other particle's locations. More...
#include <VirtualSite.h>
Public Member Functions | |
TwoParticleAverageSite (int particle1, int particle2, double weight1, double weight2) | |
Create a new TwoParticleAverageSite virtual site. More... | |
double | getWeight (int particle) const |
Get the weight factor used for a particle this virtual site depends on. More... | |
Public Member Functions inherited from VirtualSite | |
virtual | ~VirtualSite () |
int | getNumParticles () const |
Get the number of particles this virtual site depends on. More... | |
int | getParticle (int particle) const |
Get the index of a particle this virtual site depends on. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from VirtualSite | |
VirtualSite () | |
void | setParticles (const std::vector< int > &particleIndices) |
This is a VirtualSite that computes the particle location as a weighted average of two other particle's locations.
Assuming the weights add up to 1, this means the virtual site is on the line passing through the two particles.
TwoParticleAverageSite | ( | int | particle1, |
int | particle2, | ||
double | weight1, | ||
double | weight2 | ||
) |
Create a new TwoParticleAverageSite virtual site.
Normally weight1 and weight2 should add up to 1, although this is not strictly required.
particle1 | the index of the first particle |
particle2 | the index of the second particle |
weight1 | the weight factor (between 0 and 1) for the first particle |
weight2 | the weight factor (between 0 and 1) for the second particle |
double getWeight | ( | int | particle | ) | const |
Get the weight factor used for a particle this virtual site depends on.
particle | the particle to get (between 0 and getNumParticles()) |