Package ffx.openmm
Class TwoParticleAverageSite
java.lang.Object
ffx.openmm.VirtualSite
ffx.openmm.TwoParticleAverageSite
This is a VirtualSite that computes the particle location as a weighted average
of two other particle's locations. This means the virtual site is on the
line passing through the two particles.
-
Field Summary
Fields inherited from class ffx.openmm.VirtualSite
pointer
-
Constructor Summary
ConstructorsConstructorDescriptionTwoParticleAverageSite
(int particle1, int particle2, double weight1, double weight2) Create a new TwoParticleAverageSite virtual site. -
Method Summary
Methods inherited from class ffx.openmm.VirtualSite
getNumParticles, getParticle, getPointer
-
Constructor Details
-
TwoParticleAverageSite
public 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.- Parameters:
particle1
- the index of the first particleparticle2
- the index of the second particleweight1
- the weight factor (typically between 0 and 1) for the first particleweight2
- the weight factor (typically between 0 and 1) for the second particle
-
-
Method Details
-
destroy
public void destroy()Destroy the virtual site.- Specified by:
destroy
in classVirtualSite
-
getWeight
public double getWeight(int particle) Get the weight factor used for a particle this virtual site depends on.- Parameters:
particle
- the particle to get (between 0 and getNumParticles())- Returns:
- the weight factor used for that particle
-