OpenMM

This is a VirtualSite that uses the locations of three other particles to compute a local coordinate system, then places the virtual site at a fixed location in that coordinate system. More...
#include <VirtualSite.h>
Public Member Functions  
LocalCoordinatesSite (int particle1, int particle2, int particle3, const Vec3 &originWeights, const Vec3 &xWeights, const Vec3 &yWeights, const Vec3 &localPosition)  
Create a new LocalCoordinatesSite virtual site. More...  
const Vec3 &  getOriginWeights () const 
Get the weight factors for the three particles when computing the origin location. More...  
const Vec3 &  getXWeights () const 
Get the weight factors for the three particles when computing xdir. More...  
const Vec3 &  getYWeights () const 
Get the weight factors for the three particles when computing ydir. More...  
const Vec3 &  getLocalPosition () const 
Get the position of the virtual site in the local coordinate system. 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 uses the locations of three other particles to compute a local coordinate system, then places the virtual site at a fixed location in that coordinate system.
The origin of the coordinate system and the directions of its x and y axes are each specified as a weighted sum of the locations of the three particles:
origin = w^{o}_{1}r_{1} + w^{o}_{2}r_{2} + w^{o}_{3}r_{3}
xdir = w^{x}_{1}r_{1} + w^{x}_{2}r_{2} + w^{x}_{3}r_{3}
ydir = w^{y}_{1}r_{1} + w^{y}_{2}r_{2} + w^{y}_{3}r_{3}
For the origin, the three weights must add to one. For example if (w^{o}_{1}, w^{o}_{2}, w^{o}_{3}) = (1.0, 0.0, 0.0), the origin of the local coordinate system is at the location of particle 1. For xdir and ydir, the weights must add to zero. For excample, if (w^{x}_{1}, w^{x}_{2}, w^{x}_{3}) = (1.0, 0.5, 0.5), the x axis points from particle 1 toward the midpoint between particles 2 and 3.
The z direction is computed as zdir = xdir x ydir. To ensure the axes are all orthogonal, ydir is then recomputed as ydir = zdir x xdir. All three axis vectors are then normalized, and the virtual site location is set to
origin + x*xdir + y*ydir + z*zdir
LocalCoordinatesSite  (  int  particle1, 
int  particle2,  
int  particle3,  
const Vec3 &  originWeights,  
const Vec3 &  xWeights,  
const Vec3 &  yWeights,  
const Vec3 &  localPosition  
) 
Create a new LocalCoordinatesSite virtual site.
particle1  the index of the first particle 
particle2  the index of the second particle 
particle3  the index of the third particle 
originWeights  the weight factors for the three particles when computing the origin location 
xWeights  the weight factors for the three particles when computing xdir 
yWeights  the weight factors for the three particles when computing ydir 
localPosition  the position of the virtual site in the local coordinate system 
const Vec3& getLocalPosition  (  )  const 
Get the position of the virtual site in the local coordinate system.
const Vec3& getOriginWeights  (  )  const 
Get the weight factors for the three particles when computing the origin location.
const Vec3& getXWeights  (  )  const 
Get the weight factors for the three particles when computing xdir.
const Vec3& getYWeights  (  )  const 
Get the weight factors for the three particles when computing ydir.