Commit e9dc1983 authored by Peter Eastman's avatar Peter Eastman
Browse files

Modified some parameter names and doxygen comments to reduce confusion

parent 95d1c382
...@@ -43,7 +43,9 @@ namespace OpenMM { ...@@ -43,7 +43,9 @@ namespace OpenMM {
/** /**
* This class implements nonbonded interactions between particles, including a Coulomb force to represent * This class implements nonbonded interactions between particles, including a Coulomb force to represent
* electrostatics and a Lennard-Jones force to represent van der Waals interactions. It optionally supports * electrostatics and a Lennard-Jones force to represent van der Waals interactions. It optionally supports
* periodic boundary conditions and cutoffs for long range interactions. * periodic boundary conditions and cutoffs for long range interactions. Lennard-Jones interactions are
* calculated with the Lorentz-Bertelot combining rule: it uses the arithmetic mean of the sigmas and the
* geometric mean of the epsilons for the two interacting particles.
* *
* If the System also contains a HarmonicBondForce, nonbonded interactions are automatically excluded between * If the System also contains a HarmonicBondForce, nonbonded interactions are automatically excluded between
* particles which are separated by three or fewer bonds. Most molecular force fields omit Coulomb and * particles which are separated by three or fewer bonds. Most molecular force fields omit Coulomb and
...@@ -149,41 +151,43 @@ public: ...@@ -149,41 +151,43 @@ public:
* *
* @param index the index of the particle for which to get parameters * @param index the index of the particle for which to get parameters
* @param charge the charge of the particle, measured in units of the proton charge * @param charge the charge of the particle, measured in units of the proton charge
* @param radius the van der Waals radius of the particle, measured in nm * @param sigma the van der Waals radius of the particle (sigma in the Lennard Jones potential), measured in nm
* @param depth the well depth of the van der Waals interaction, measured in kJ/mol * @param epsilon the well depth of the van der Waals interaction (epsilon in the Lennard Jones potential), measured in kJ/mol
*/ */
void getParticleParameters(int index, double& charge, double& radius, double& depth) const; void getParticleParameters(int index, double& charge, double& sigma, double& epsilon) const;
/** /**
* Set the nonbonded force parameters for a particle. * Set the nonbonded force parameters for a particle. When calculating the Lennard-Jones interaction between two particles,
* it uses the arithmetic mean of the sigmas and the geometric mean of the epsilons for the two interacting particles
* (the Lorentz-Bertelot combining rule).
* *
* @param index the index of the particle for which to set parameters * @param index the index of the particle for which to set parameters
* @param charge the charge of the particle, measured in units of the proton charge * @param charge the charge of the particle, measured in units of the proton charge
* @param radius the van der Waals radius of the particle (sigma in the Lennard Jones potential), measured in nm * @param sigma the van der Waals radius of the particle (sigma in the Lennard Jones potential), measured in nm
* @param depth the well depth of the van der Waals interaction (epsilon in the Lennard Jones potential), measured in kJ/mol * @param epsilon the well depth of the van der Waals interaction (epsilon in the Lennard Jones potential), measured in kJ/mol
*/ */
void setParticleParameters(int index, double charge, double radius, double depth); void setParticleParameters(int index, double charge, double sigma, double epsilon);
/** /**
* Get the force field parameters for a nonbonded 1-4 term. * Get the force field parameters for a nonbonded 1-4 term.
* *
* @param index the index of the interaction for which to get parameters * @param index the index of the interaction for which to get parameters
* @param particle1 the index of the first particle involved in the interaction * @param particle1 the index of the first particle involved in the interaction
* @param particle2 the index of the second particle involved in the interaction * @param particle2 the index of the second particle involved in the interaction
* @param charge the scaled product of the atomic charges (i.e. the strength of the Coulomb interaction), measured in units of the proton charge * @param chargeProd the scaled product of the atomic charges (i.e. the strength of the Coulomb interaction), measured in units of the proton charge squared
* @param radius the van der Waals radius of the particle (sigma in the Lennard Jones potential), measured in nm * @param sigma the van der Waals radius of the particle (sigma in the Lennard Jones potential), measured in nm
* @param depth the well depth of the van der Waals interaction (epsilon in the Lennard Jones potential), measured in kJ/mol * @param epsilon the well depth of the van der Waals interaction (epsilon in the Lennard Jones potential), measured in kJ/mol
*/ */
void getNonbonded14Parameters(int index, int& particle1, int& particle2, double& charge, double& radius, double& depth) const; void getNonbonded14Parameters(int index, int& particle1, int& particle2, double& chargeProd, double& sigma, double& epsilon) const;
/** /**
* Set the force field parameters for a nonbonded 1-4 term. * Set the force field parameters for a nonbonded 1-4 term.
* *
* @param index the index of the interaction for which to get parameters * @param index the index of the interaction for which to get parameters
* @param particle1 the index of the first particle involved in the interaction * @param particle1 the index of the first particle involved in the interaction
* @param particle2 the index of the second particle involved in the interaction * @param particle2 the index of the second particle involved in the interaction
* @param charge the scaled product of the atomic charges (i.e. the strength of the Coulomb interaction), measured in units of the proton charge * @param chargeProd the scaled product of the atomic charges (i.e. the strength of the Coulomb interaction), measured in units of the proton charge squared
* @param radius the van der Waals radius of the particle (sigma in the Lennard Jones potential), measured in nm * @param sigma the van der Waals radius of the particle (sigma in the Lennard Jones potential), measured in nm
* @param depth the well depth of the van der Waals interaction (epsilon in the Lennard Jones potential), measured in kJ/mol * @param epsilon the well depth of the van der Waals interaction (epsilon in the Lennard Jones potential), measured in kJ/mol
*/ */
void setNonbonded14Parameters(int index, int particle1, int particle2, double charge, double radius, double depth); void setNonbonded14Parameters(int index, int particle1, int particle2, double chargeProd, double sigma, double epsilon);
protected: protected:
ForceImpl* createImpl(); ForceImpl* createImpl();
private: private:
...@@ -210,19 +214,19 @@ private: ...@@ -210,19 +214,19 @@ private:
class NonbondedForce::ParticleInfo { class NonbondedForce::ParticleInfo {
public: public:
double charge, radius, depth; double charge, sigma, epsilon;
ParticleInfo() { ParticleInfo() {
charge = radius = depth = 0.0; charge = sigma = epsilon = 0.0;
} }
}; };
class NonbondedForce::NB14Info { class NonbondedForce::NB14Info {
public: public:
int particle1, particle2; int particle1, particle2;
double charge, radius, depth; double chargeProd, sigma, epsilon;
NB14Info() { NB14Info() {
particle1 = particle2 = -1; particle1 = particle2 = -1;
charge = radius = depth = 0.0; chargeProd = sigma = epsilon = 0.0;
} }
}; };
......
...@@ -77,32 +77,32 @@ void NonbondedForce::setPeriodicBoxVectors(Vec3 a, Vec3 b, Vec3 c) { ...@@ -77,32 +77,32 @@ void NonbondedForce::setPeriodicBoxVectors(Vec3 a, Vec3 b, Vec3 c) {
periodicBoxVectors[2] = c; periodicBoxVectors[2] = c;
} }
void NonbondedForce::getParticleParameters(int index, double& charge, double& radius, double& depth) const { void NonbondedForce::getParticleParameters(int index, double& charge, double& sigma, double& epsilon) const {
charge = particles[index].charge; charge = particles[index].charge;
radius = particles[index].radius; sigma = particles[index].sigma;
depth = particles[index].depth; epsilon = particles[index].epsilon;
} }
void NonbondedForce::setParticleParameters(int index, double charge, double radius, double depth) { void NonbondedForce::setParticleParameters(int index, double charge, double sigma, double epsilon) {
particles[index].charge = charge; particles[index].charge = charge;
particles[index].radius = radius; particles[index].sigma = sigma;
particles[index].depth = depth; particles[index].epsilon = epsilon;
} }
void NonbondedForce::getNonbonded14Parameters(int index, int& particle1, int& particle2, double& charge, double& radius, double& depth) const { void NonbondedForce::getNonbonded14Parameters(int index, int& particle1, int& particle2, double& chargeProd, double& sigma, double& epsilon) const {
particle1 = nb14s[index].particle1; particle1 = nb14s[index].particle1;
particle2 = nb14s[index].particle2; particle2 = nb14s[index].particle2;
charge = nb14s[index].charge; chargeProd = nb14s[index].chargeProd;
radius = nb14s[index].radius; sigma = nb14s[index].sigma;
depth = nb14s[index].depth; epsilon = nb14s[index].epsilon;
} }
void NonbondedForce::setNonbonded14Parameters(int index, int particle1, int particle2, double charge, double radius, double depth) { void NonbondedForce::setNonbonded14Parameters(int index, int particle1, int particle2, double chargeProd, double sigma, double epsilon) {
nb14s[index].particle1 = particle1; nb14s[index].particle1 = particle1;
nb14s[index].particle2 = particle2; nb14s[index].particle2 = particle2;
nb14s[index].charge = charge; nb14s[index].chargeProd = chargeProd;
nb14s[index].radius = radius; nb14s[index].sigma = sigma;
nb14s[index].depth = depth; nb14s[index].epsilon = epsilon;
} }
ForceImpl* NonbondedForce::createImpl() { ForceImpl* NonbondedForce::createImpl() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment