Commit 62c4fd53 authored by Peter Eastman's avatar Peter Eastman
Browse files

Renamed "atoms" to "particles"

parent ad75a390
......@@ -200,7 +200,7 @@ public:
*
* @param system the System this kernel will be applied to
* @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
* the standard nonbonded calculation.
*/
......@@ -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 {
public:
......
......@@ -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
* 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 {
......
......@@ -39,15 +39,15 @@ namespace OpenMM {
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.
*
* More specifically, a Force object can do any or all of the following:
*
* <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>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>Change the values of parameters defined by other Force objects at the start of each time step</li>
* </ul>
......
......@@ -47,33 +47,33 @@ public:
/*
* 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 {
return atoms.size();
int getNumParticles() const {
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 charge the charge of the atom, measured in units of the proton charge
* @param radius the GBSA radius of the atom, measured in nm
* @param scalingFactor the OBC scaling factor for the atom
* @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 radius the GBSA radius of the particle, measured in nm
* @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 charge the charge of the atom, measured in units of the proton charge
* @param radius the GBSA radius of the atom, measured in nm
* @param scalingFactor the OBC scaling factor for the atom
* @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 radius the GBSA radius of the particle, measured in nm
* @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.
*/
......@@ -101,7 +101,7 @@ public:
protected:
ForceImpl* createImpl();
private:
class AtomInfo;
class ParticleInfo;
double solventDielectric, soluteDielectric;
// Retarded visual studio compiler complains about being unable to
......@@ -112,7 +112,7 @@ private:
#pragma warning(disable:4251)
#endif
std::vector<AtomInfo> atoms;
std::vector<ParticleInfo> particles;
#if defined(_MSC_VER)
#pragma warning(pop)
......@@ -120,10 +120,10 @@ private:
};
class GBSAOBCForceField::AtomInfo {
class GBSAOBCForceField::ParticleInfo {
public:
double charge, radius, scalingFactor;
AtomInfo() {
ParticleInfo() {
charge = radius = scalingFactor = 0.0;
}
};
......
......@@ -41,7 +41,7 @@
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
* constructor, then loop over them and call setAngleParameters() to set the force field parameters for each one.
*/
......@@ -64,24 +64,24 @@ public:
* Get the force field parameters for an angle term.
*
* @param index the index of the angle for which to get parameters
* @param atom1 the index of the first atom forming the angle
* @param atom2 the index of the second atom forming the angle
* @param atom3 the index of the third atom forming the angle
* @param particle1 the index of the first particle forming the angle
* @param particle2 the index of the second particle forming the angle
* @param particle3 the index of the third particle forming the angle
* @param length the equilibrium angle, measured in radians
* @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.
*
* @param index the index of the angle for which to set parameters
* @param atom1 the index of the first atom forming the angle
* @param atom2 the index of the second atom forming the angle
* @param atom3 the index of the third atom forming the angle
* @param particle1 the index of the first particle forming the angle
* @param particle2 the index of the second particle forming the angle
* @param particle3 the index of the third particle forming the angle
* @param length the equilibrium angle, measured in radians
* @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:
ForceImpl* createImpl();
private:
......@@ -103,10 +103,10 @@ private:
class HarmonicAngleForce::AngleInfo {
public:
int atom1, atom2, atom3;
int particle1, particle2, particle3;
double angle, k;
AngleInfo() {
atom1 = atom2 = atom3 = -1;
particle1 = particle2 = particle3 = -1;
angle = k = 0.0;
}
};
......
......@@ -41,7 +41,7 @@
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
* constructor, then loop over them and call setBondParameters() to set the force field parameters for each one.
*/
......@@ -64,22 +64,22 @@ public:
* Get the force field parameters for a bond term.
*
* @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 atom2 the index of the second atom connected by the bond
* @param particle1 the index of the first particle 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 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.
*
* @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 atom2 the index of the second atom connected by the bond
* @param particle1 the index of the first particle 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 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:
ForceImpl* createImpl();
private:
......@@ -101,10 +101,10 @@ private:
class HarmonicBondForce::BondInfo {
public:
int atom1, atom2;
int particle1, particle2;
double length, k;
BondInfo() {
atom1 = atom2 = -1;
particle1 = particle2 = -1;
length = k = 0.0;
}
};
......
......@@ -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
* 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
* arguments to the constructor. You then loop over them and call setAtomParameters() for each atom and
* 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 setParticleParameters() for each particle and
* setNonbond14Parameters() for each 1-4 interaction.
*/
......@@ -73,8 +73,8 @@ public:
*/
CutoffNonPeriodic = 1,
/**
* Periodic boundary conditions are used, so that each atom interacts only with the nearest periodic copy of
* each other atom. Interactions beyond the cutoff distance are ignored. Coulomb interactions closer than the
* Periodic boundary conditions are used, so that each particle interacts only with the nearest periodic copy of
* each other particle. Interactions beyond the cutoff distance are ignored. Coulomb interactions closer than the
* cutoff distance are modified using the reaction field method.
*/
CutoffPeriodic = 2
......@@ -82,15 +82,15 @@ public:
/**
* 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
*/
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 {
return atoms.size();
int getNumParticles() const {
return particles.size();
}
/**
* Get the number of nonbonded 1-4 terms in the potential function
......@@ -141,49 +141,49 @@ public:
*/
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 charge the charge of the atom, measured in units of the proton charge
* @param radius the van der Waals radius of the atom, measured in nm
* @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 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
*/
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 charge the charge of the atom, 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 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 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
*/
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.
*
* @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 atom2 the index of the second atom 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 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
*/
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.
*
* @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 atom2 the index of the second atom 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 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
*/
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:
ForceImpl* createImpl();
private:
class AtomInfo;
class ParticleInfo;
class NB14Info;
NonbondedMethod nonbondedMethod;
double cutoffDistance;
......@@ -196,7 +196,7 @@ private:
#pragma warning(push)
#pragma warning(disable:4251)
#endif
std::vector<AtomInfo> atoms;
std::vector<ParticleInfo> particles;
std::vector<NB14Info> nb14s;
#if defined(_MSC_VER)
#pragma warning(pop)
......@@ -204,20 +204,20 @@ private:
};
class NonbondedForce::AtomInfo {
class NonbondedForce::ParticleInfo {
public:
double charge, radius, depth;
AtomInfo() {
ParticleInfo() {
charge = radius = depth = 0.0;
}
};
class NonbondedForce::NB14Info {
public:
int atom1, atom2;
int particle1, particle2;
double charge, radius, depth;
NB14Info() {
atom1 = atom2 = -1;
particle1 = particle2 = -1;
charge = radius = depth = 0.0;
}
};
......
......@@ -50,15 +50,15 @@ class Platform;
*
* <ul>
* <li>The current time</li>
* <li>The position of each atom</li>
* <li>The velocity of each atom</li>
* <li>The position of each particle</li>
* <li>The velocity of each particle</li>
* <li>The values of configurable parameters defined by Force objects in the System</li>
* </ul>
*
* 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
* 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 {
......@@ -112,17 +112,17 @@ public:
*/
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
* contains the position of the i'th atom.
* @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 particle.
*/
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
* contains the velocity of the i'th atom.
* @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 particle.
*/
void setVelocities(const std::vector<Vec3>& velocities);
/**
......
......@@ -41,7 +41,7 @@
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
* constructor, then loop over them and call setTorsionParameters() to set the force field parameters for each one.
*/
......@@ -64,43 +64,28 @@ public:
* Get the force field parameters for a periodic 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 particle1 the index of the first particle forming the torsion
* @param particle2 the index of the second particle forming the torsion
* @param particle3 the index of the third particle forming the torsion
* @param particle3 the index of the fourth particle forming the torsion
* @param periodicity the periodicity of the torsion
* @param phase the phase offset of the torsion, measured in radians
* @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.
*
* @param index the index of the torsion for which to set 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 particle1 the index of the first particle forming the torsion
* @param particle2 the index of the second particle forming the torsion
* @param particle3 the index of the third particle forming the torsion
* @param particle3 the index of the fourth particle forming the torsion
* @param periodicity the periodicity of the torsion
* @param phase the phase offset of the torsion, measured in radians
* @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);
/**
* 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
*/
void setTorsionParameters(int index, int particle1, int particle2, int particle3, int particle4, int periodicity, double phase, double k);
protected:
ForceImpl* createImpl();
private:
......@@ -122,10 +107,10 @@ private:
class PeriodicTorsionForce::PeriodicTorsionInfo {
public:
int atom1, atom2, atom3, atom4, periodicity;
int particle1, particle2, particle3, particle4, periodicity;
double phase, k;
PeriodicTorsionInfo() {
atom1 = atom2 = atom3 = atom4 = -1;
particle1 = particle2 = particle3 = particle4 = -1;
periodicity = 1;
phase = k = 0.0;
}
......
......@@ -41,7 +41,7 @@
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
* as an argument to the constructor, then loop over them and call setTorsionParameters() to set the force field
* parameters for each one.
......@@ -65,10 +65,10 @@ public:
* 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 particle1 the index of the first particle forming the torsion
* @param particle2 the index of the second particle forming the torsion
* @param particle3 the index of the third particle forming the torsion
* @param particle3 the index of the fourth particle 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
......@@ -76,15 +76,15 @@ public:
* @param c4 the coefficient of the 4th 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.
*
* @param index the index of the torsion for which to set 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 particle1 the index of the first particle forming the torsion
* @param particle2 the index of the second particle forming the torsion
* @param particle3 the index of the third particle forming the torsion
* @param particle3 the index of the fourth particle 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
......@@ -92,7 +92,7 @@ public:
* @param c4 the coefficient of the 4th 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:
ForceImpl* createImpl();
private:
......@@ -114,10 +114,10 @@ private:
class RBTorsionForce::RBTorsionInfo {
public:
int atom1, atom2, atom3, atom4;
int particle1, particle2, particle3, particle4;
double c[6];
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;
}
};
......
......@@ -62,15 +62,15 @@ public:
*/
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;
/**
* 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;
/**
* 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;
/**
......@@ -87,7 +87,7 @@ public:
const std::map<std::string, double>& getParameters() const;
private:
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
// export private stl class members.
......
......@@ -44,14 +44,14 @@ class OPENMM_EXPORT Force;
* three elements:
*
* <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>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>
*
* 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
* 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 {
......@@ -59,32 +59,32 @@ public:
/**
* 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.
*/
System(int numAtoms, int numConstraints);
System(int numParticles, int numConstraints);
~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();
}
/**
* 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];
}
/**
* 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 mass the mass of the atom
* @param index the index of the particle for which to set the mass
* @param mass the mass of the particle
*/
void setAtomMass(int index, double mass) {
void setParticleMass(int index, double mass) {
masses[index] = mass;
}
/**
......@@ -97,20 +97,20 @@ public:
* Get the parameters defining a distance constraint.
*
* @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 atom2 the index of the second atom involved in the constraint
* @param distance the required distance between the two atoms, measured in nm
* @param particle1 the index of the first particle involved in the constraint
* @param particle2 the index of the second particle involved in the constraint
* @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.
*
* @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 atom2 the index of the second atom involved in the constraint
* @param distance the required distance between the two atoms, measured in nm
* @param particle1 the index of the first particle involved in the constraint
* @param particle2 the index of the second particle involved in the constraint
* @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
* "new" operator. The System takes over ownership of it, and deletes the Force when the
......@@ -156,10 +156,10 @@ private:
class System::ConstraintInfo {
public:
int atom1, atom2;
int particle1, particle2;
double distance;
ConstraintInfo() {
atom1 = atom2 = -1;
particle1 = particle2 = -1;
distance = 0.0;
}
};
......
......@@ -52,7 +52,7 @@ public:
}
void updateContextState(OpenMMContextImpl& context);
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) {
return 0.0; // This force doesn't contribute to the potential energy.
......
......@@ -51,7 +51,7 @@ public:
}
void updateContextState(OpenMMContextImpl& context);
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) {
return 0.0; // This force doesn't contribute to the potential energy.
......
......@@ -74,7 +74,7 @@ public:
*/
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
* any new forces, it should simply return without modifying the array.
*
......
......@@ -64,7 +64,7 @@ public:
std::vector<std::string> getKernelNames();
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 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;
Kernel kernel;
};
......
......@@ -81,19 +81,19 @@ public:
return *platform;
}
/**
* Get the Stream containing the current position of each atom.
* Get the Stream containing the current position of each particle.
*/
Stream& getPositions() {
return positions;
}
/**
* Get the Stream containing the current velocity of each atom.
* Get the Stream containing the current velocity of each particle.
*/
Stream& getVelocities() {
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().
*/
Stream& getForces() {
......
......@@ -49,17 +49,17 @@ void BrownianIntegrator::initialize(OpenMMContextImpl& contextRef) {
context = &contextRef;
kernel = context->getPlatform().createKernel(IntegrateBrownianStepKernel::Name(), contextRef);
const System& system = context->getSystem();
vector<double> masses(system.getNumAtoms());
vector<double> masses(system.getNumParticles());
vector<std::vector<int> > constraintIndices(system.getNumConstraints());
vector<double> constraintLengths(system.getNumConstraints());
for (int i = 0; i < system.getNumAtoms(); ++i)
masses[i] = system.getAtomMass(i);
for (int i = 0; i < system.getNumParticles(); ++i)
masses[i] = system.getParticleMass(i);
for (int i = 0; i < system.getNumConstraints(); ++i) {
int atom1, atom2;
int particle1, particle2;
double distance;
system.getConstraintParameters(i, atom1, atom2, distance);
constraintIndices[i].push_back(atom1);
constraintIndices[i].push_back(atom2);
system.getConstraintParameters(i, particle1, particle2, distance);
constraintIndices[i].push_back(particle1);
constraintIndices[i].push_back(particle2);
constraintLengths[i] = distance;
}
dynamic_cast<IntegrateBrownianStepKernel&>(kernel.getImpl()).initialize(system, *this);
......
......@@ -36,19 +36,19 @@
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 {
charge = atoms[index].charge;
radius = atoms[index].radius;
scalingFactor = atoms[index].scalingFactor;
void GBSAOBCForceField::getParticleParameters(int index, double& charge, double& radius, double& scalingFactor) const {
charge = particles[index].charge;
radius = particles[index].radius;
scalingFactor = particles[index].scalingFactor;
}
void GBSAOBCForceField::setAtomParameters(int index, double charge, double radius, double scalingFactor) {
atoms[index].charge = charge;
atoms[index].radius = radius;
atoms[index].scalingFactor = scalingFactor;
void GBSAOBCForceField::setParticleParameters(int index, double charge, double radius, double scalingFactor) {
particles[index].charge = charge;
particles[index].radius = radius;
particles[index].scalingFactor = scalingFactor;
}
ForceImpl* GBSAOBCForceField::createImpl() {
......
......@@ -39,18 +39,18 @@ using namespace OpenMM;
HarmonicAngleForce::HarmonicAngleForce(int numAngles) : angles(numAngles) {
}
void HarmonicAngleForce::getAngleParameters(int index, int& atom1, int& atom2, int& atom3, double& angle, double& k) const {
atom1 = angles[index].atom1;
atom2 = angles[index].atom2;
atom3 = angles[index].atom3;
void HarmonicAngleForce::getAngleParameters(int index, int& particle1, int& particle2, int& particle3, double& angle, double& k) const {
particle1 = angles[index].particle1;
particle2 = angles[index].particle2;
particle3 = angles[index].particle3;
angle = angles[index].angle;
k = angles[index].k;
}
void HarmonicAngleForce::setAngleParameters(int index, int atom1, int atom2, int atom3, double angle, double k) {
angles[index].atom1 = atom1;
angles[index].atom2 = atom2;
angles[index].atom3 = atom3;
void HarmonicAngleForce::setAngleParameters(int index, int particle1, int particle2, int particle3, double angle, double k) {
angles[index].particle1 = particle1;
angles[index].particle2 = particle2;
angles[index].particle3 = particle3;
angles[index].angle = angle;
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