"docs-source/usersguide/vscode:/vscode.git/clone" did not exist on "644dc1ecc9e95b3c8e831803bb3e2ac925999f74"
Commit 62c4fd53 authored by Peter Eastman's avatar Peter Eastman
Browse files

Renamed "atoms" to "particles"

parent ad75a390
...@@ -200,7 +200,7 @@ public: ...@@ -200,7 +200,7 @@ public:
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the NonbondedForce this kernel will be used for * @param force the NonbondedForce this kernel will be used for
* @param exclusions the i'th element lists the indices of all atoms with which the i'th atom should not interact through * @param exclusions the i'th element lists the indices of all particles with which the i'th particle should not interact through
* nonbonded forces. Bonded 1-4 pairs are also included in this list, since they should be omitted from * nonbonded forces. Bonded 1-4 pairs are also included in this list, since they should be omitted from
* the standard nonbonded calculation. * the standard nonbonded calculation.
*/ */
...@@ -331,7 +331,7 @@ public: ...@@ -331,7 +331,7 @@ public:
}; };
/** /**
* This kernel is invoked by AndersenThermostat at the start of each time step to adjust the atom velocities. * This kernel is invoked by AndersenThermostat at the start of each time step to adjust the particle velocities.
*/ */
class ApplyAndersenThermostatKernel : public KernelImpl { class ApplyAndersenThermostatKernel : public KernelImpl {
public: public:
......
...@@ -40,7 +40,7 @@ namespace OpenMM { ...@@ -40,7 +40,7 @@ namespace OpenMM {
/** /**
* This class prevents the center of mass of a System from drifting. At each time step, it calculates the * This class prevents the center of mass of a System from drifting. At each time step, it calculates the
* center of mass momentum, then adjusts the individual atom velocities to make it zero. * center of mass momentum, then adjusts the individual particle velocities to make it zero.
*/ */
class OPENMM_EXPORT CMMotionRemover : public Force { class OPENMM_EXPORT CMMotionRemover : public Force {
......
...@@ -39,15 +39,15 @@ namespace OpenMM { ...@@ -39,15 +39,15 @@ namespace OpenMM {
class ForceImpl; class ForceImpl;
/** /**
* Force objects apply forces to the atoms in a System, or alter their behavior in other * Force objects apply forces to the particles in a System, or alter their behavior in other
* ways. This is an abstract class. Subclasses define particular forces. * ways. This is an abstract class. Subclasses define particular forces.
* *
* More specifically, a Force object can do any or all of the following: * More specifically, a Force object can do any or all of the following:
* *
* <ul> * <ul>
* <li>Add a contribution to the force on each atom</li> * <li>Add a contribution to the force on each particle</li>
* <li>Add a contribution to the potential energy of the System</li> * <li>Add a contribution to the potential energy of the System</li>
* <li>Modify the positions and velocities of atoms at the start of each time step</li> * <li>Modify the positions and velocities of particles at the start of each time step</li>
* <li>Define parameters which are stored in the OpenMMContext and can be modified by the user</li> * <li>Define parameters which are stored in the OpenMMContext and can be modified by the user</li>
* <li>Change the values of parameters defined by other Force objects at the start of each time step</li> * <li>Change the values of parameters defined by other Force objects at the start of each time step</li>
* </ul> * </ul>
......
...@@ -47,33 +47,33 @@ public: ...@@ -47,33 +47,33 @@ public:
/* /*
* Create a GBSAOBCForceField. * Create a GBSAOBCForceField.
* *
* @param numAtoms the number of atoms in the system * @param numParticles the number of particles in the system
*/ */
GBSAOBCForceField(int numAtoms); GBSAOBCForceField(int numParticles);
/** /**
* Get the number of atoms in the system. * Get the number of particles in the system.
*/ */
int getNumAtoms() const { int getNumParticles() const {
return atoms.size(); return particles.size();
} }
/** /**
* Get the force field parameters for an atom. * Get the force field parameters for a particle.
* *
* @param index the index of the atom for which to get parameters * @param index the index of the particle for which to get parameters
* @param charge the charge of the atom, measured in units of the proton charge * @param charge the charge of the particle, measured in units of the proton charge
* @param radius the GBSA radius of the atom, measured in nm * @param radius the GBSA radius of the particle, measured in nm
* @param scalingFactor the OBC scaling factor for the atom * @param scalingFactor the OBC scaling factor for the particle
*/ */
void getAtomParameters(int index, double& charge, double& radius, double& scalingFactor) const; void getParticleParameters(int index, double& charge, double& radius, double& scalingFactor) const;
/** /**
* Set the force field parameters for an atom. * Set the force field parameters for a particle.
* *
* @param index the index of the atom for which to set parameters * @param index the index of the particle for which to set parameters
* @param charge the charge of the atom, measured in units of the proton charge * @param charge the charge of the particle, measured in units of the proton charge
* @param radius the GBSA radius of the atom, measured in nm * @param radius the GBSA radius of the particle, measured in nm
* @param scalingFactor the OBC scaling factor for the atom * @param scalingFactor the OBC scaling factor for the particle
*/ */
void setAtomParameters(int index, double charge, double radius, double scalingFactor); void setParticleParameters(int index, double charge, double radius, double scalingFactor);
/** /**
* Get the dielectric constant for the solvent. * Get the dielectric constant for the solvent.
*/ */
...@@ -101,7 +101,7 @@ public: ...@@ -101,7 +101,7 @@ public:
protected: protected:
ForceImpl* createImpl(); ForceImpl* createImpl();
private: private:
class AtomInfo; class ParticleInfo;
double solventDielectric, soluteDielectric; double solventDielectric, soluteDielectric;
// Retarded visual studio compiler complains about being unable to // Retarded visual studio compiler complains about being unable to
...@@ -112,7 +112,7 @@ private: ...@@ -112,7 +112,7 @@ private:
#pragma warning(disable:4251) #pragma warning(disable:4251)
#endif #endif
std::vector<AtomInfo> atoms; std::vector<ParticleInfo> particles;
#if defined(_MSC_VER) #if defined(_MSC_VER)
#pragma warning(pop) #pragma warning(pop)
...@@ -120,10 +120,10 @@ private: ...@@ -120,10 +120,10 @@ private:
}; };
class GBSAOBCForceField::AtomInfo { class GBSAOBCForceField::ParticleInfo {
public: public:
double charge, radius, scalingFactor; double charge, radius, scalingFactor;
AtomInfo() { ParticleInfo() {
charge = radius = scalingFactor = 0.0; charge = radius = scalingFactor = 0.0;
} }
}; };
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
namespace OpenMM { namespace OpenMM {
/** /**
* This class implements an interaction between groups of three atoms that varies harmonically with the angle * This class implements an interaction between groups of three particles that varies harmonically with the angle
* between them. When creating a HarmonicAngleForce, you specify the number of angle as an argument to the * between them. When creating a HarmonicAngleForce, you specify the number of angle as an argument to the
* constructor, then loop over them and call setAngleParameters() to set the force field parameters for each one. * constructor, then loop over them and call setAngleParameters() to set the force field parameters for each one.
*/ */
...@@ -64,24 +64,24 @@ public: ...@@ -64,24 +64,24 @@ public:
* Get the force field parameters for an angle term. * Get the force field parameters for an angle term.
* *
* @param index the index of the angle for which to get parameters * @param index the index of the angle for which to get parameters
* @param atom1 the index of the first atom forming the angle * @param particle1 the index of the first particle forming the angle
* @param atom2 the index of the second atom forming the angle * @param particle2 the index of the second particle forming the angle
* @param atom3 the index of the third atom forming the angle * @param particle3 the index of the third particle forming the angle
* @param length the equilibrium angle, measured in radians * @param length the equilibrium angle, measured in radians
* @param k the harmonic force constant for the angle * @param k the harmonic force constant for the angle
*/ */
void getAngleParameters(int index, int& atom1, int& atom2, int& atom3, double& angle, double& k) const; void getAngleParameters(int index, int& particle1, int& particle2, int& particle3, double& angle, double& k) const;
/** /**
* Set the force field parameters for an angle term. * Set the force field parameters for an angle term.
* *
* @param index the index of the angle for which to set parameters * @param index the index of the angle for which to set parameters
* @param atom1 the index of the first atom forming the angle * @param particle1 the index of the first particle forming the angle
* @param atom2 the index of the second atom forming the angle * @param particle2 the index of the second particle forming the angle
* @param atom3 the index of the third atom forming the angle * @param particle3 the index of the third particle forming the angle
* @param length the equilibrium angle, measured in radians * @param length the equilibrium angle, measured in radians
* @param k the harmonic force constant for the angle * @param k the harmonic force constant for the angle
*/ */
void setAngleParameters(int index, int atom1, int atom2, int atom3, double angle, double k); void setAngleParameters(int index, int particle1, int particle2, int particle3, double angle, double k);
protected: protected:
ForceImpl* createImpl(); ForceImpl* createImpl();
private: private:
...@@ -103,10 +103,10 @@ private: ...@@ -103,10 +103,10 @@ private:
class HarmonicAngleForce::AngleInfo { class HarmonicAngleForce::AngleInfo {
public: public:
int atom1, atom2, atom3; int particle1, particle2, particle3;
double angle, k; double angle, k;
AngleInfo() { AngleInfo() {
atom1 = atom2 = atom3 = -1; particle1 = particle2 = particle3 = -1;
angle = k = 0.0; angle = k = 0.0;
} }
}; };
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
namespace OpenMM { namespace OpenMM {
/** /**
* This class implements an interaction between pairs of atoms that varies harmonically with the distance * This class implements an interaction between pairs of particles that varies harmonically with the distance
* between them. When creating a HarmonicBondForce, you specify the number of bonds as an argument to the * between them. When creating a HarmonicBondForce, you specify the number of bonds as an argument to the
* constructor, then loop over them and call setBondParameters() to set the force field parameters for each one. * constructor, then loop over them and call setBondParameters() to set the force field parameters for each one.
*/ */
...@@ -64,22 +64,22 @@ public: ...@@ -64,22 +64,22 @@ public:
* Get the force field parameters for a bond term. * Get the force field parameters for a bond term.
* *
* @param index the index of the bond for which to get parameters * @param index the index of the bond for which to get parameters
* @param atom1 the index of the first atom connected by the bond * @param particle1 the index of the first particle connected by the bond
* @param atom2 the index of the second atom connected by the bond * @param particle2 the index of the second particle connected by the bond
* @param length the equilibrium length of the bond, measured in nm * @param length the equilibrium length of the bond, measured in nm
* @param k the harmonic force constant for the bond * @param k the harmonic force constant for the bond
*/ */
void getBondParameters(int index, int& atom1, int& atom2, double& length, double& k) const; void getBondParameters(int index, int& particle1, int& particle2, double& length, double& k) const;
/** /**
* Set the force field parameters for a bond term. * Set the force field parameters for a bond term.
* *
* @param index the index of the bond for which to set parameters * @param index the index of the bond for which to set parameters
* @param atom1 the index of the first atom connected by the bond * @param particle1 the index of the first particle connected by the bond
* @param atom2 the index of the second atom connected by the bond * @param particle2 the index of the second particle connected by the bond
* @param length the equilibrium length of the bond, measured in nm * @param length the equilibrium length of the bond, measured in nm
* @param k the harmonic force constant for the bond * @param k the harmonic force constant for the bond
*/ */
void setBondParameters(int index, int atom1, int atom2, double length, double k); void setBondParameters(int index, int particle1, int particle2, double length, double k);
protected: protected:
ForceImpl* createImpl(); ForceImpl* createImpl();
private: private:
...@@ -101,10 +101,10 @@ private: ...@@ -101,10 +101,10 @@ private:
class HarmonicBondForce::BondInfo { class HarmonicBondForce::BondInfo {
public: public:
int atom1, atom2; int particle1, particle2;
double length, k; double length, k;
BondInfo() { BondInfo() {
atom1 = atom2 = -1; particle1 = particle2 = -1;
length = k = 0.0; length = k = 0.0;
} }
}; };
......
...@@ -51,8 +51,8 @@ namespace OpenMM { ...@@ -51,8 +51,8 @@ namespace OpenMM {
* for those separated by three bonds (known as "1-4 interactions"). This class lets you provide a list of * for those separated by three bonds (known as "1-4 interactions"). This class lets you provide a list of
* 1-4 interactions to include in the potential, along with the parameters to use for each one. * 1-4 interactions to include in the potential, along with the parameters to use for each one.
* *
* When creating a NonbondedForce, you specify the number of atoms and the number of 1-4 interactions as * When creating a NonbondedForce, you specify the number of particles and the number of 1-4 interactions as
* arguments to the constructor. You then loop over them and call setAtomParameters() for each atom and * arguments to the constructor. You then loop over them and call setParticleParameters() for each particle and
* setNonbond14Parameters() for each 1-4 interaction. * setNonbond14Parameters() for each 1-4 interaction.
*/ */
...@@ -73,8 +73,8 @@ public: ...@@ -73,8 +73,8 @@ public:
*/ */
CutoffNonPeriodic = 1, CutoffNonPeriodic = 1,
/** /**
* Periodic boundary conditions are used, so that each atom interacts only with the nearest periodic copy of * Periodic boundary conditions are used, so that each particle interacts only with the nearest periodic copy of
* each other atom. Interactions beyond the cutoff distance are ignored. Coulomb interactions closer than the * each other particle. Interactions beyond the cutoff distance are ignored. Coulomb interactions closer than the
* cutoff distance are modified using the reaction field method. * cutoff distance are modified using the reaction field method.
*/ */
CutoffPeriodic = 2 CutoffPeriodic = 2
...@@ -82,15 +82,15 @@ public: ...@@ -82,15 +82,15 @@ public:
/** /**
* Create a NonbondedForce. * Create a NonbondedForce.
* *
* @param numAtoms the number of atoms in the system * @param numParticles the number of particles in the system
* @param numNonbonded14 the number of nonbonded 1-4 terms in the potential function * @param numNonbonded14 the number of nonbonded 1-4 terms in the potential function
*/ */
NonbondedForce(int numAtoms, int numNonbonded14); NonbondedForce(int numParticles, int numNonbonded14);
/** /**
* Get the number of atoms in the system. * Get the number of particles in the system.
*/ */
int getNumAtoms() const { int getNumParticles() const {
return atoms.size(); return particles.size();
} }
/** /**
* Get the number of nonbonded 1-4 terms in the potential function * Get the number of nonbonded 1-4 terms in the potential function
...@@ -141,49 +141,49 @@ public: ...@@ -141,49 +141,49 @@ public:
*/ */
void setPeriodicBoxVectors(Vec3 a, Vec3 b, Vec3 c); void setPeriodicBoxVectors(Vec3 a, Vec3 b, Vec3 c);
/** /**
* Get the nonbonded force parameters for an atom. * Get the nonbonded force parameters for a particle.
* *
* @param index the index of the atom for which to get parameters * @param index the index of the particle for which to get parameters
* @param charge the charge of the atom, 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 atom, measured in nm * @param radius the van der Waals radius of the particle, measured in nm
* @param depth the well depth of the van der Waals interaction, measured in kJ/mol * @param depth the well depth of the van der Waals interaction, measured in kJ/mol
*/ */
void getAtomParameters(int index, double& charge, double& radius, double& depth) const; void getParticleParameters(int index, double& charge, double& radius, double& depth) const;
/** /**
* Set the nonbonded force parameters for an atom. * Set the nonbonded force parameters for a particle.
* *
* @param index the index of the atom for which to set parameters * @param index the index of the particle for which to set parameters
* @param charge the charge of the atom, 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 atom (sigma in the Lennard Jones potential), measured in nm * @param radius 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 depth the well depth of the van der Waals interaction (epsilon in the Lennard Jones potential), measured in kJ/mol
*/ */
void setAtomParameters(int index, double charge, double radius, double depth); void setParticleParameters(int index, double charge, double radius, double depth);
/** /**
* 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 atom1 the index of the first atom involved in the interaction * @param particle1 the index of the first particle involved in the interaction
* @param atom2 the index of the second atom 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 charge the scaled product of the atomic charges (i.e. the strength of the Coulomb interaction), measured in units of the proton charge
* @param radius the van der Waals radius of the atom (sigma in the Lennard Jones potential), measured in nm * @param radius 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 depth the well depth of the van der Waals interaction (epsilon in the Lennard Jones potential), measured in kJ/mol
*/ */
void getNonbonded14Parameters(int index, int& atom1, int& atom2, double& charge, double& radius, double& depth) const; void getNonbonded14Parameters(int index, int& particle1, int& particle2, double& charge, double& radius, double& depth) 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 atom1 the index of the first atom involved in the interaction * @param particle1 the index of the first particle involved in the interaction
* @param atom2 the index of the second atom 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 charge the scaled product of the atomic charges (i.e. the strength of the Coulomb interaction), measured in units of the proton charge
* @param radius the van der Waals radius of the atom (sigma in the Lennard Jones potential), measured in nm * @param radius 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 depth the well depth of the van der Waals interaction (epsilon in the Lennard Jones potential), measured in kJ/mol
*/ */
void setNonbonded14Parameters(int index, int atom1, int atom2, double charge, double radius, double depth); void setNonbonded14Parameters(int index, int particle1, int particle2, double charge, double radius, double depth);
protected: protected:
ForceImpl* createImpl(); ForceImpl* createImpl();
private: private:
class AtomInfo; class ParticleInfo;
class NB14Info; class NB14Info;
NonbondedMethod nonbondedMethod; NonbondedMethod nonbondedMethod;
double cutoffDistance; double cutoffDistance;
...@@ -196,7 +196,7 @@ private: ...@@ -196,7 +196,7 @@ private:
#pragma warning(push) #pragma warning(push)
#pragma warning(disable:4251) #pragma warning(disable:4251)
#endif #endif
std::vector<AtomInfo> atoms; std::vector<ParticleInfo> particles;
std::vector<NB14Info> nb14s; std::vector<NB14Info> nb14s;
#if defined(_MSC_VER) #if defined(_MSC_VER)
#pragma warning(pop) #pragma warning(pop)
...@@ -204,20 +204,20 @@ private: ...@@ -204,20 +204,20 @@ private:
}; };
class NonbondedForce::AtomInfo { class NonbondedForce::ParticleInfo {
public: public:
double charge, radius, depth; double charge, radius, depth;
AtomInfo() { ParticleInfo() {
charge = radius = depth = 0.0; charge = radius = depth = 0.0;
} }
}; };
class NonbondedForce::NB14Info { class NonbondedForce::NB14Info {
public: public:
int atom1, atom2; int particle1, particle2;
double charge, radius, depth; double charge, radius, depth;
NB14Info() { NB14Info() {
atom1 = atom2 = -1; particle1 = particle2 = -1;
charge = radius = depth = 0.0; charge = radius = depth = 0.0;
} }
}; };
......
...@@ -50,15 +50,15 @@ class Platform; ...@@ -50,15 +50,15 @@ class Platform;
* *
* <ul> * <ul>
* <li>The current time</li> * <li>The current time</li>
* <li>The position of each atom</li> * <li>The position of each particle</li>
* <li>The velocity of each atom</li> * <li>The velocity of each particle</li>
* <li>The values of configurable parameters defined by Force objects in the System</li> * <li>The values of configurable parameters defined by Force objects in the System</li>
* </ul> * </ul>
* *
* You can retrieve a snapshot of the current state at any time by calling getState(). This * You can retrieve a snapshot of the current state at any time by calling getState(). This
* allows you to record the state of the simulation at various points, either for analysis * allows you to record the state of the simulation at various points, either for analysis
* or for checkpointing. getState() can also be used to retrieve the current forces on each * or for checkpointing. getState() can also be used to retrieve the current forces on each
* atom and the current energy of the System. * particle and the current energy of the System.
*/ */
class OPENMM_EXPORT OpenMMContext { class OPENMM_EXPORT OpenMMContext {
...@@ -112,17 +112,17 @@ public: ...@@ -112,17 +112,17 @@ public:
*/ */
void setTime(double time); void setTime(double time);
/** /**
* Set the positions of all atoms in the System (measured in nm). * Set the positions of all particles in the System (measured in nm).
* *
* @param a vector whose length equals the number of atoms in the System. The i'th element * @param positions a vector whose length equals the number of particles in the System. The i'th element
* contains the position of the i'th atom. * contains the position of the i'th particle.
*/ */
void setPositions(const std::vector<Vec3>& positions); void setPositions(const std::vector<Vec3>& positions);
/** /**
* Set the velocities of all atoms in the System (measured in nm/picosecond). * Set the velocities of all particles in the System (measured in nm/picosecond).
* *
* @param a vector whose length equals the number of atoms in the System. The i'th element * @param velocities a vector whose length equals the number of particles in the System. The i'th element
* contains the velocity of the i'th atom. * contains the velocity of the i'th particle.
*/ */
void setVelocities(const std::vector<Vec3>& velocities); void setVelocities(const std::vector<Vec3>& velocities);
/** /**
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
namespace OpenMM { namespace OpenMM {
/** /**
* This class implements an interaction between groups of four atoms that varies periodically with the torsion angle * This class implements an interaction between groups of four particles that varies periodically with the torsion angle
* between them. When creating a PeriodicTorsionForce, you specify the number of torsions as an argument to the * between them. When creating a PeriodicTorsionForce, you specify the number of torsions as an argument to the
* constructor, then loop over them and call setTorsionParameters() to set the force field parameters for each one. * constructor, then loop over them and call setTorsionParameters() to set the force field parameters for each one.
*/ */
...@@ -64,43 +64,28 @@ public: ...@@ -64,43 +64,28 @@ public:
* Get the force field parameters for a periodic torsion term. * Get the force field parameters for a periodic torsion term.
* *
* @param index the index of the torsion for which to get parameters * @param index the index of the torsion for which to get parameters
* @param atom1 the index of the first atom forming the torsion * @param particle1 the index of the first particle forming the torsion
* @param atom2 the index of the second atom forming the torsion * @param particle2 the index of the second particle forming the torsion
* @param atom3 the index of the third atom forming the torsion * @param particle3 the index of the third particle forming the torsion
* @param atom3 the index of the fourth atom forming the torsion * @param particle3 the index of the fourth particle forming the torsion
* @param periodicity the periodicity of the torsion * @param periodicity the periodicity of the torsion
* @param phase the phase offset of the torsion, measured in radians * @param phase the phase offset of the torsion, measured in radians
* @param k the force constant for the torsion * @param k the force constant for the torsion
*/ */
void getTorsionParameters(int index, int& atom1, int& atom2, int& atom3, int& atom4, int& periodicity, double& phase, double& k) const; void getTorsionParameters(int index, int& particle1, int& particle2, int& particle3, int& particle4, int& periodicity, double& phase, double& k) const;
/** /**
* Set the force field parameters for a periodic torsion term. * Set the force field parameters for a periodic torsion term.
* *
* @param index the index of the torsion for which to set parameters * @param index the index of the torsion for which to set parameters
* @param atom1 the index of the first atom forming the torsion * @param particle1 the index of the first particle forming the torsion
* @param atom2 the index of the second atom forming the torsion * @param particle2 the index of the second particle forming the torsion
* @param atom3 the index of the third atom forming the torsion * @param particle3 the index of the third particle forming the torsion
* @param atom3 the index of the fourth atom forming the torsion * @param particle3 the index of the fourth particle forming the torsion
* @param periodicity the periodicity of the torsion * @param periodicity the periodicity of the torsion
* @param phase the phase offset of the torsion, measured in radians * @param phase the phase offset of the torsion, measured in radians
* @param k the force constant for the torsion * @param k the force constant for the torsion
*/ */
void setTorsionParameters(int index, int atom1, int atom2, int atom3, int atom4, int periodicity, double phase, double k); void setTorsionParameters(int index, int particle1, int particle2, int particle3, int particle4, int periodicity, double phase, double k);
/**
* Get the force field parameters for a Ryckaert-Bellemans torsion term.
*
* @param index the index of the torsion for which to get parameters
* @param atom1 the index of the first atom forming the torsion
* @param atom2 the index of the second atom forming the torsion
* @param atom3 the index of the third atom forming the torsion
* @param atom3 the index of the fourth atom forming the torsion
* @param c0 the coefficient of the constant term
* @param c1 the coefficient of the 1st order term
* @param c2 the coefficient of the 2nd order term
* @param c3 the coefficient of the 3rd order term
* @param c4 the coefficient of the 4th order term
* @param c5 the coefficient of the 5th order term
*/
protected: protected:
ForceImpl* createImpl(); ForceImpl* createImpl();
private: private:
...@@ -122,10 +107,10 @@ private: ...@@ -122,10 +107,10 @@ private:
class PeriodicTorsionForce::PeriodicTorsionInfo { class PeriodicTorsionForce::PeriodicTorsionInfo {
public: public:
int atom1, atom2, atom3, atom4, periodicity; int particle1, particle2, particle3, particle4, periodicity;
double phase, k; double phase, k;
PeriodicTorsionInfo() { PeriodicTorsionInfo() {
atom1 = atom2 = atom3 = atom4 = -1; particle1 = particle2 = particle3 = particle4 = -1;
periodicity = 1; periodicity = 1;
phase = k = 0.0; phase = k = 0.0;
} }
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
namespace OpenMM { namespace OpenMM {
/** /**
* This class implements an interaction between groups of four atoms that varies with the torsion angle between them * This class implements an interaction between groups of four particles that varies with the torsion angle between them
* according to the Ryckaert-Bellemans potential. When creating an RBTorsionForce, you specify the number of torsions * according to the Ryckaert-Bellemans potential. When creating an RBTorsionForce, you specify the number of torsions
* as an argument to the constructor, then loop over them and call setTorsionParameters() to set the force field * as an argument to the constructor, then loop over them and call setTorsionParameters() to set the force field
* parameters for each one. * parameters for each one.
...@@ -65,10 +65,10 @@ public: ...@@ -65,10 +65,10 @@ public:
* Get the force field parameters for a Ryckaert-Bellemans torsion term. * Get the force field parameters for a Ryckaert-Bellemans torsion term.
* *
* @param index the index of the torsion for which to get parameters * @param index the index of the torsion for which to get parameters
* @param atom1 the index of the first atom forming the torsion * @param particle1 the index of the first particle forming the torsion
* @param atom2 the index of the second atom forming the torsion * @param particle2 the index of the second particle forming the torsion
* @param atom3 the index of the third atom forming the torsion * @param particle3 the index of the third particle forming the torsion
* @param atom3 the index of the fourth atom forming the torsion * @param particle3 the index of the fourth particle forming the torsion
* @param c0 the coefficient of the constant term * @param c0 the coefficient of the constant term
* @param c1 the coefficient of the 1st order term * @param c1 the coefficient of the 1st order term
* @param c2 the coefficient of the 2nd order term * @param c2 the coefficient of the 2nd order term
...@@ -76,15 +76,15 @@ public: ...@@ -76,15 +76,15 @@ public:
* @param c4 the coefficient of the 4th order term * @param c4 the coefficient of the 4th order term
* @param c5 the coefficient of the 5th order term * @param c5 the coefficient of the 5th order term
*/ */
void getTorsionParameters(int index, int& atom1, int& atom2, int& atom3, int& atom4, double& c0, double& c1, double& c2, double& c3, double& c4, double& c5) const; void getTorsionParameters(int index, int& particle1, int& particle2, int& particle3, int& particle4, double& c0, double& c1, double& c2, double& c3, double& c4, double& c5) const;
/** /**
* Set the force field parameters for a Ryckaert-Bellemans torsion term. * Set the force field parameters for a Ryckaert-Bellemans torsion term.
* *
* @param index the index of the torsion for which to set parameters * @param index the index of the torsion for which to set parameters
* @param atom1 the index of the first atom forming the torsion * @param particle1 the index of the first particle forming the torsion
* @param atom2 the index of the second atom forming the torsion * @param particle2 the index of the second particle forming the torsion
* @param atom3 the index of the third atom forming the torsion * @param particle3 the index of the third particle forming the torsion
* @param atom3 the index of the fourth atom forming the torsion * @param particle3 the index of the fourth particle forming the torsion
* @param c0 the coefficient of the constant term * @param c0 the coefficient of the constant term
* @param c1 the coefficient of the 1st order term * @param c1 the coefficient of the 1st order term
* @param c2 the coefficient of the 2nd order term * @param c2 the coefficient of the 2nd order term
...@@ -92,7 +92,7 @@ public: ...@@ -92,7 +92,7 @@ public:
* @param c4 the coefficient of the 4th order term * @param c4 the coefficient of the 4th order term
* @param c5 the coefficient of the 5th order term * @param c5 the coefficient of the 5th order term
*/ */
void setTorsionParameters(int index, int atom1, int atom2, int atom3, int atom4, double c0, double c1, double c2, double c3, double c4, double c5); void setTorsionParameters(int index, int particle1, int particle2, int particle3, int particle4, double c0, double c1, double c2, double c3, double c4, double c5);
protected: protected:
ForceImpl* createImpl(); ForceImpl* createImpl();
private: private:
...@@ -114,10 +114,10 @@ private: ...@@ -114,10 +114,10 @@ private:
class RBTorsionForce::RBTorsionInfo { class RBTorsionForce::RBTorsionInfo {
public: public:
int atom1, atom2, atom3, atom4; int particle1, particle2, particle3, particle4;
double c[6]; double c[6];
RBTorsionInfo() { RBTorsionInfo() {
atom1 = atom2 = atom3 = atom4 = -1; particle1 = particle2 = particle3 = particle4 = -1;
c[0] = c[1] = c[2] = c[3] = c[4] = c[5] = 0.0; c[0] = c[1] = c[2] = c[3] = c[4] = c[5] = 0.0;
} }
}; };
......
...@@ -62,15 +62,15 @@ public: ...@@ -62,15 +62,15 @@ public:
*/ */
double getTime() const; double getTime() const;
/** /**
* Get the position of each atom. If this State does not contain positions, this will throw an exception. * Get the position of each particle. If this State does not contain positions, this will throw an exception.
*/ */
const std::vector<Vec3>& getPositions() const; const std::vector<Vec3>& getPositions() const;
/** /**
* Get the velocity of each atom. If this State does not contain velocities, this will throw an exception. * Get the velocity of each particle. If this State does not contain velocities, this will throw an exception.
*/ */
const std::vector<Vec3>& getVelocities() const; const std::vector<Vec3>& getVelocities() const;
/** /**
* Get the force acting on each atom. If this State does not contain forces, this will throw an exception. * Get the force acting on each particle. If this State does not contain forces, this will throw an exception.
*/ */
const std::vector<Vec3>& getForces() const; const std::vector<Vec3>& getForces() const;
/** /**
...@@ -87,7 +87,7 @@ public: ...@@ -87,7 +87,7 @@ public:
const std::map<std::string, double>& getParameters() const; const std::map<std::string, double>& getParameters() const;
private: private:
friend class OpenMMContext; friend class OpenMMContext;
State(double time, int numAtoms, DataType types); State(double time, int numParticles, DataType types);
// Retarded visual studio compiler complains about being unable to // Retarded visual studio compiler complains about being unable to
// export private stl class members. // export private stl class members.
......
...@@ -44,14 +44,14 @@ class OPENMM_EXPORT Force; ...@@ -44,14 +44,14 @@ class OPENMM_EXPORT Force;
* three elements: * three elements:
* *
* <ol> * <ol>
* <li>The set of atoms in the system</li> * <li>The set of particles in the system</li>
* <li>The forces acting on them</li> * <li>The forces acting on them</li>
* <li>Pairs of atoms whose separation should be connstrained to a fixed value</li> * <li>Pairs of particles whose separation should be connstrained to a fixed value</li>
* </ol> * </ol>
* *
* The atoms and constraints are defined directly by the System object. * The particles and constraints are defined directly by the System object.
* The forces are defined by objects that extend the Force class. The System * The forces are defined by objects that extend the Force class. The System
* stores a list of Force objects that determine the motion of the atoms. * stores a list of Force objects that determine the motion of the particles.
*/ */
class OPENMM_EXPORT System { class OPENMM_EXPORT System {
...@@ -59,32 +59,32 @@ public: ...@@ -59,32 +59,32 @@ public:
/** /**
* Create a new System. * Create a new System.
* *
* @param numAtoms the number of atoms in the System * @param numParticles the number of particles in the System
* @param numConstraints the number of distance constraints in the System. * @param numConstraints the number of distance constraints in the System.
*/ */
System(int numAtoms, int numConstraints); System(int numParticles, int numConstraints);
~System(); ~System();
/** /**
* Get the number of atoms in this System. * Get the number of particles in this System.
*/ */
int getNumAtoms() const { int getNumParticles() const {
return masses.size(); return masses.size();
} }
/** /**
* Get the mass (in atomic mass units) of an atom. * Get the mass (in atomic mass units) of a particle.
* *
* @param index the index of the atom for which to get the mass * @param index the index of the particle for which to get the mass
*/ */
double getAtomMass(int index) const { double getParticleMass(int index) const {
return masses[index]; return masses[index];
} }
/** /**
* Set the mass (in atomic mass units) of an atom. * Set the mass (in atomic mass units) of a particle.
* *
* @param index the index of the atom for which to set the mass * @param index the index of the particle for which to set the mass
* @param mass the mass of the atom * @param mass the mass of the particle
*/ */
void setAtomMass(int index, double mass) { void setParticleMass(int index, double mass) {
masses[index] = mass; masses[index] = mass;
} }
/** /**
...@@ -97,20 +97,20 @@ public: ...@@ -97,20 +97,20 @@ public:
* Get the parameters defining a distance constraint. * Get the parameters defining a distance constraint.
* *
* @param index the index of the constraint for which to get parameters * @param index the index of the constraint for which to get parameters
* @param atom1 the index of the first atom involved in the constraint * @param particle1 the index of the first particle involved in the constraint
* @param atom2 the index of the second atom involved in the constraint * @param particle2 the index of the second particle involved in the constraint
* @param distance the required distance between the two atoms, measured in nm * @param distance the required distance between the two particles, measured in nm
*/ */
void getConstraintParameters(int index, int& atom1, int& atom2, double& distance) const; void getConstraintParameters(int index, int& particle1, int& particle2, double& distance) const;
/** /**
* Set the parameters defining a distance constraint. * Set the parameters defining a distance constraint.
* *
* @param index the index of the constraint for which to set parameters * @param index the index of the constraint for which to set parameters
* @param atom1 the index of the first atom involved in the constraint * @param particle1 the index of the first particle involved in the constraint
* @param atom2 the index of the second atom involved in the constraint * @param particle2 the index of the second particle involved in the constraint
* @param distance the required distance between the two atoms, measured in nm * @param distance the required distance between the two particles, measured in nm
*/ */
void setConstraintParameters(int index, int atom1, int atom2, double distance); void setConstraintParameters(int index, int particle1, int particle2, double distance);
/** /**
* Add a Force to the System. The Force should have been created on the heap with the * Add a Force to the System. The Force should have been created on the heap with the
* "new" operator. The System takes over ownership of it, and deletes the Force when the * "new" operator. The System takes over ownership of it, and deletes the Force when the
...@@ -136,30 +136,30 @@ public: ...@@ -136,30 +136,30 @@ public:
private: private:
class ConstraintInfo; class ConstraintInfo;
// Retarded visual studio compiler complains about being unable to // Retarded visual studio compiler complains about being unable to
// export private stl class members. // export private stl class members.
// This stanza explains that it should temporarily shut up. // This stanza explains that it should temporarily shut up.
#if defined(_MSC_VER) #if defined(_MSC_VER)
#pragma warning(push) #pragma warning(push)
#pragma warning(disable:4251) #pragma warning(disable:4251)
#endif #endif
std::vector<double> masses; std::vector<double> masses;
std::vector<ConstraintInfo> constraints; std::vector<ConstraintInfo> constraints;
std::vector<Force*> forces; std::vector<Force*> forces;
#if defined(_MSC_VER) #if defined(_MSC_VER)
#pragma warning(pop) #pragma warning(pop)
#endif #endif
}; };
class System::ConstraintInfo { class System::ConstraintInfo {
public: public:
int atom1, atom2; int particle1, particle2;
double distance; double distance;
ConstraintInfo() { ConstraintInfo() {
atom1 = atom2 = -1; particle1 = particle2 = -1;
distance = 0.0; distance = 0.0;
} }
}; };
......
...@@ -52,7 +52,7 @@ public: ...@@ -52,7 +52,7 @@ public:
} }
void updateContextState(OpenMMContextImpl& context); void updateContextState(OpenMMContextImpl& context);
void calcForces(OpenMMContextImpl& context, Stream& forces) { void calcForces(OpenMMContextImpl& context, Stream& forces) {
// This force doesn't apply forces to atoms. // This force doesn't apply forces to particles.
} }
double calcEnergy(OpenMMContextImpl& context) { double calcEnergy(OpenMMContextImpl& context) {
return 0.0; // This force doesn't contribute to the potential energy. return 0.0; // This force doesn't contribute to the potential energy.
......
...@@ -51,7 +51,7 @@ public: ...@@ -51,7 +51,7 @@ public:
} }
void updateContextState(OpenMMContextImpl& context); void updateContextState(OpenMMContextImpl& context);
void calcForces(OpenMMContextImpl& context, Stream& forces) { void calcForces(OpenMMContextImpl& context, Stream& forces) {
// This force doesn't apply forces to atoms. // This force doesn't apply forces to particles.
} }
double calcEnergy(OpenMMContextImpl& context) { double calcEnergy(OpenMMContextImpl& context) {
return 0.0; // This force doesn't contribute to the potential energy. return 0.0; // This force doesn't contribute to the potential energy.
......
...@@ -74,7 +74,7 @@ public: ...@@ -74,7 +74,7 @@ public:
*/ */
virtual void updateContextState(OpenMMContextImpl& context) = 0; virtual void updateContextState(OpenMMContextImpl& context) = 0;
/** /**
* Calculate the force on each atom generated by this ForceImpl. The forces should be <i>added</i> * Calculate the force on each particle generated by this ForceImpl. The forces should be <i>added</i>
* to the values already present in the array that is passed in. If this ForceImpl does not generate * to the values already present in the array that is passed in. If this ForceImpl does not generate
* any new forces, it should simply return without modifying the array. * any new forces, it should simply return without modifying the array.
* *
......
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
std::vector<std::string> getKernelNames(); std::vector<std::string> getKernelNames();
private: private:
void findExclusions(const std::vector<std::vector<int> >& bondIndices, std::vector<std::set<int> >& exclusions, std::set<std::pair<int, int> >& bonded14Indices) const; void findExclusions(const std::vector<std::vector<int> >& bondIndices, std::vector<std::set<int> >& exclusions, std::set<std::pair<int, int> >& bonded14Indices) const;
void addExclusionsToSet(const std::vector<std::set<int> >& bonded12, std::set<int>& exclusions, int baseAtom, int fromAtom, int currentLevel) const; void addExclusionsToSet(const std::vector<std::set<int> >& bonded12, std::set<int>& exclusions, int baseParticle, int fromParticle, int currentLevel) const;
NonbondedForce& owner; NonbondedForce& owner;
Kernel kernel; Kernel kernel;
}; };
......
...@@ -81,19 +81,19 @@ public: ...@@ -81,19 +81,19 @@ public:
return *platform; return *platform;
} }
/** /**
* Get the Stream containing the current position of each atom. * Get the Stream containing the current position of each particle.
*/ */
Stream& getPositions() { Stream& getPositions() {
return positions; return positions;
} }
/** /**
* Get the Stream containing the current velocity of each atom. * Get the Stream containing the current velocity of each particle.
*/ */
Stream& getVelocities() { Stream& getVelocities() {
return velocities; return velocities;
} }
/** /**
* Get the Stream containing the force on each atom that was calculated by * Get the Stream containing the force on each particle that was calculated by
* the most recent call to calcForces(). * the most recent call to calcForces().
*/ */
Stream& getForces() { Stream& getForces() {
......
...@@ -49,17 +49,17 @@ void BrownianIntegrator::initialize(OpenMMContextImpl& contextRef) { ...@@ -49,17 +49,17 @@ void BrownianIntegrator::initialize(OpenMMContextImpl& contextRef) {
context = &contextRef; context = &contextRef;
kernel = context->getPlatform().createKernel(IntegrateBrownianStepKernel::Name(), contextRef); kernel = context->getPlatform().createKernel(IntegrateBrownianStepKernel::Name(), contextRef);
const System& system = context->getSystem(); const System& system = context->getSystem();
vector<double> masses(system.getNumAtoms()); vector<double> masses(system.getNumParticles());
vector<std::vector<int> > constraintIndices(system.getNumConstraints()); vector<std::vector<int> > constraintIndices(system.getNumConstraints());
vector<double> constraintLengths(system.getNumConstraints()); vector<double> constraintLengths(system.getNumConstraints());
for (int i = 0; i < system.getNumAtoms(); ++i) for (int i = 0; i < system.getNumParticles(); ++i)
masses[i] = system.getAtomMass(i); masses[i] = system.getParticleMass(i);
for (int i = 0; i < system.getNumConstraints(); ++i) { for (int i = 0; i < system.getNumConstraints(); ++i) {
int atom1, atom2; int particle1, particle2;
double distance; double distance;
system.getConstraintParameters(i, atom1, atom2, distance); system.getConstraintParameters(i, particle1, particle2, distance);
constraintIndices[i].push_back(atom1); constraintIndices[i].push_back(particle1);
constraintIndices[i].push_back(atom2); constraintIndices[i].push_back(particle2);
constraintLengths[i] = distance; constraintLengths[i] = distance;
} }
dynamic_cast<IntegrateBrownianStepKernel&>(kernel.getImpl()).initialize(system, *this); dynamic_cast<IntegrateBrownianStepKernel&>(kernel.getImpl()).initialize(system, *this);
......
...@@ -36,19 +36,19 @@ ...@@ -36,19 +36,19 @@
using namespace OpenMM; using namespace OpenMM;
GBSAOBCForceField::GBSAOBCForceField(int numAtoms) : atoms(numAtoms), solventDielectric(78.3), soluteDielectric(1.0) { GBSAOBCForceField::GBSAOBCForceField(int numParticles) : particles(numParticles), solventDielectric(78.3), soluteDielectric(1.0) {
} }
void GBSAOBCForceField::getAtomParameters(int index, double& charge, double& radius, double& scalingFactor) const { void GBSAOBCForceField::getParticleParameters(int index, double& charge, double& radius, double& scalingFactor) const {
charge = atoms[index].charge; charge = particles[index].charge;
radius = atoms[index].radius; radius = particles[index].radius;
scalingFactor = atoms[index].scalingFactor; scalingFactor = particles[index].scalingFactor;
} }
void GBSAOBCForceField::setAtomParameters(int index, double charge, double radius, double scalingFactor) { void GBSAOBCForceField::setParticleParameters(int index, double charge, double radius, double scalingFactor) {
atoms[index].charge = charge; particles[index].charge = charge;
atoms[index].radius = radius; particles[index].radius = radius;
atoms[index].scalingFactor = scalingFactor; particles[index].scalingFactor = scalingFactor;
} }
ForceImpl* GBSAOBCForceField::createImpl() { ForceImpl* GBSAOBCForceField::createImpl() {
......
...@@ -39,18 +39,18 @@ using namespace OpenMM; ...@@ -39,18 +39,18 @@ using namespace OpenMM;
HarmonicAngleForce::HarmonicAngleForce(int numAngles) : angles(numAngles) { HarmonicAngleForce::HarmonicAngleForce(int numAngles) : angles(numAngles) {
} }
void HarmonicAngleForce::getAngleParameters(int index, int& atom1, int& atom2, int& atom3, double& angle, double& k) const { void HarmonicAngleForce::getAngleParameters(int index, int& particle1, int& particle2, int& particle3, double& angle, double& k) const {
atom1 = angles[index].atom1; particle1 = angles[index].particle1;
atom2 = angles[index].atom2; particle2 = angles[index].particle2;
atom3 = angles[index].atom3; particle3 = angles[index].particle3;
angle = angles[index].angle; angle = angles[index].angle;
k = angles[index].k; k = angles[index].k;
} }
void HarmonicAngleForce::setAngleParameters(int index, int atom1, int atom2, int atom3, double angle, double k) { void HarmonicAngleForce::setAngleParameters(int index, int particle1, int particle2, int particle3, double angle, double k) {
angles[index].atom1 = atom1; angles[index].particle1 = particle1;
angles[index].atom2 = atom2; angles[index].particle2 = particle2;
angles[index].atom3 = atom3; angles[index].particle3 = particle3;
angles[index].angle = angle; angles[index].angle = angle;
angles[index].k = k; angles[index].k = k;
} }
......
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