Commit 1c938ceb authored by Jason Swails's avatar Jason Swails
Browse files

Merge branch 'master' into amber-switching

 Conflicts:
	wrappers/python/simtk/openmm/app/amberprmtopfile.py

In fixing the merge conflict, I went ahead and fixed up the switchDistance logic
to match what I did in CharmmPsfFile.
parents a1113e7b 167ae8a0
......@@ -170,7 +170,7 @@ public:
* Set the default value of a global parameter.
*
* @param index the index of the parameter for which to set the default value
* @param name the default value of the parameter
* @param defaultValue the default value of the parameter
*/
void setGlobalParameterDefaultValue(int index, double defaultValue);
/**
......@@ -184,9 +184,9 @@ public:
/**
* Get the force field parameters for a force field term.
*
* @param index the index of the particle term for which to get parameters
* @param particle the index of the particle this term is applied to
* @param parameters the list of parameters for the force field term
* @param index the index of the particle term for which to get parameters
* @param[out] particle the index of the particle this term is applied to
* @param[out] parameters the list of parameters for the force field term
*/
void getParticleParameters(int index, int& particle, std::vector<double>& parameters) const;
/**
......
......@@ -215,7 +215,7 @@ public:
}
/**
* Get the number of tabulated functions that have been defined.
*
*
* @deprecated This method exists only for backward compatibility. Use getNumTabulatedFunctions() instead.
*/
int getNumFunctions() const {
......@@ -308,8 +308,8 @@ public:
/**
* Set the default value of a global parameter.
*
* @param index the index of the parameter for which to set the default value
* @param name the default value of the parameter
* @param index the index of the parameter for which to set the default value
* @param defaultValue the default value of the parameter
*/
void setGlobalParameterDefaultValue(int index, double defaultValue);
/**
......@@ -323,8 +323,8 @@ public:
/**
* Get the nonbonded force parameters for a particle.
*
* @param index the index of the particle for which to get parameters
* @param parameters the list of parameters for the specified particle
* @param index the index of the particle for which to get parameters
* @param[out] parameters the list of parameters for the specified particle
*/
void getParticleParameters(int index, std::vector<double>& parameters) const;
/**
......@@ -354,19 +354,19 @@ public:
/**
* Get the properties of a computed value.
*
* @param index the index of the computed value for which to get parameters
* @param name the name of the value
* @param expression an algebraic expression to evaluate when calculating the computed value. If the
* ComputationType is SingleParticle, the expression is evaluated independently
* for each particle, and may depend on its x, y, and z coordinates, as well as the per-particle
* parameters and previous computed values for that particle. If the ComputationType is ParticlePair
* or ParticlePairNoExclusions, the expression is evaluated once for every other
* particle in the system and summed to get the final value. In the latter case,
* the expression may depend on the distance r between the two particles, and on
* the per-particle parameters and previous computed values for each of them.
* Append "1" to a variable name to indicate the parameter for the particle whose
* value is being calculated, and "2" to indicate the particle it is interacting with.
* @param type the method to use for computing this value
* @param index the index of the computed value for which to get parameters
* @param[out] name the name of the value
* @param[out] expression an algebraic expression to evaluate when calculating the computed value. If the
* ComputationType is SingleParticle, the expression is evaluated independently
* for each particle, and may depend on its x, y, and z coordinates, as well as the per-particle
* parameters and previous computed values for that particle. If the ComputationType is ParticlePair
* or ParticlePairNoExclusions, the expression is evaluated once for every other
* particle in the system and summed to get the final value. In the latter case,
* the expression may depend on the distance r between the two particles, and on
* the per-particle parameters and previous computed values for each of them.
* Append "1" to a variable name to indicate the parameter for the particle whose
* value is being calculated, and "2" to indicate the particle it is interacting with.
* @param[out] type the method to use for computing this value
*/
void getComputedValueParameters(int index, std::string& name, std::string& expression, ComputationType& type) const;
/**
......@@ -406,18 +406,18 @@ public:
/**
* Get the properties of a term to the energy computation.
*
* @param index the index of the term for which to get parameters
* @param expression an algebraic expression to evaluate when calculating the energy. If the
* ComputationType is SingleParticle, the expression is evaluated once
* for each particle, and may depend on its x, y, and z coordinates, as well as the per-particle
* parameters and computed values for that particle. If the ComputationType is ParticlePair or
* ParticlePairNoExclusions, the expression is evaluated once for every pair of
* particles in the system. In the latter case,
* the expression may depend on the distance r between the two particles, and on
* the per-particle parameters and computed values for each of them.
* Append "1" to a variable name to indicate the parameter for the first particle
* in the pair and "2" to indicate the second particle in the pair.
* @param type the method to use for computing this value
* @param index the index of the term for which to get parameters
* @param[out] expression an algebraic expression to evaluate when calculating the energy. If the
* ComputationType is SingleParticle, the expression is evaluated once
* for each particle, and may depend on its x, y, and z coordinates, as well as the per-particle
* parameters and computed values for that particle. If the ComputationType is ParticlePair or
* ParticlePairNoExclusions, the expression is evaluated once for every pair of
* particles in the system. In the latter case,
* the expression may depend on the distance r between the two particles, and on
* the per-particle parameters and computed values for each of them.
* Append "1" to a variable name to indicate the parameter for the first particle
* in the pair and "2" to indicate the second particle in the pair.
* @param[out] type the method to use for computing this value
*/
void getEnergyTermParameters(int index, std::string& expression, ComputationType& type) const;
/**
......@@ -448,9 +448,9 @@ public:
/**
* Get the particles in a pair whose interaction should be excluded.
*
* @param index the index of the exclusion for which to get particle indices
* @param particle1 the index of the first particle in the pair
* @param particle2 the index of the second particle in the pair
* @param index the index of the exclusion for which to get particle indices
* @param[out] particle1 the index of the first particle in the pair
* @param[out] particle2 the index of the second particle in the pair
*/
void getExclusionParticles(int index, int& particle1, int& particle2) const;
/**
......@@ -517,7 +517,7 @@ public:
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
* Simply call setParticleParameters() to modify this object's parameters, then call updateParametersInContext()
* to copy them over to the Context.
*
*
* This method has several limitations. The only information it updates is the values of per-particle parameters.
* All other aspects of the Force (such as the energy function) are unaffected and can only be changed by reinitializing
* the Context. Also, this method cannot be used to add new particles, only to change the parameters of existing ones.
......
......@@ -171,7 +171,7 @@ public:
}
/**
* Get the number of tabulated functions that have been defined.
*
*
* @deprecated This method exists only for backward compatibility. Use getNumTabulatedFunctions() instead.
*/
int getNumFunctions() const {
......@@ -282,7 +282,7 @@ public:
* Set the default value of a global parameter.
*
* @param index the index of the parameter for which to set the default value
* @param name the default value of the parameter
* @param defaultValue the default value of the parameter
*/
void setGlobalParameterDefaultValue(int index, double defaultValue);
/**
......@@ -300,13 +300,13 @@ public:
/**
* Get the properties of a donor group.
*
* @param index the index of the donor group to get
* @param d1 the index of the first particle for this donor group
* @param d2 the index of the second particle for this donor group. If the group only
* includes one particle, this will be -1.
* @param d3 the index of the third particle for this donor group. If the group includes
* less than three particles, this will be -1.
* @param parameters the list of per-donor parameter values for the donor
* @param index the index of the donor group to get
* @param[out] d1 the index of the first particle for this donor group
* @param[out] d2 the index of the second particle for this donor group. If the group only
* includes one particle, this will be -1.
* @param[out] d3 the index of the third particle for this donor group. If the group includes
* less than three particles, this will be -1.
* @param[out] parameters the list of per-donor parameter values for the donor
*/
void getDonorParameters(int index, int& d1, int& d2, int& d3, std::vector<double>& parameters) const;
/**
......@@ -336,13 +336,13 @@ public:
/**
* Get the properties of an acceptor group.
*
* @param index the index of the acceptor group to get
* @param a1 the index of the first particle for this acceptor group
* @param a2 the index of the second particle for this acceptor group. If the group only
* includes one particle, this will be -1.
* @param a3 the index of the third particle for this acceptor group. If the group includes
* less than three particles, this will be -1.
* @param parameters the list of per-acceptor parameter values for the acceptor
* @param index the index of the acceptor group to get
* @param[out] a1 the index of the first particle for this acceptor group
* @param[out] a2 the index of the second particle for this acceptor group. If the group only
* includes one particle, this will be -1.
* @param[out] a3 the index of the third particle for this acceptor group. If the group includes
* less than three particles, this will be -1.
* @param[out] parameters the list of per-acceptor parameter values for the acceptor
*/
void getAcceptorParameters(int index, int& a1, int& a2, int& a3, std::vector<double>& parameters) const;
/**
......@@ -368,17 +368,17 @@ public:
/**
* Get the donor and acceptor in a pair whose interaction should be excluded.
*
* @param index the index of the exclusion for which to get donor and acceptor indices
* @param particle1 the index of the donor
* @param particle2 the index of the acceptor
* @param index the index of the exclusion for which to get donor and acceptor indices
* @param[out] particle1 the index of the donor
* @param[out] particle2 the index of the acceptor
*/
void getExclusionParticles(int index, int& donor, int& acceptor) const;
/**
* Get the donor and acceptor in a pair whose interaction should be excluded.
*
* @param index the index of the exclusion for which to get donor and acceptor indices
* @param particle1 the index of the donor
* @param particle2 the index of the acceptor
* @param donor the index of the donor
* @param acceptor the index of the acceptor
*/
void setExclusionParticles(int index, int donor, int acceptor);
/**
......@@ -437,7 +437,7 @@ public:
* provides an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
* Simply call setDonorParameters() and setAcceptorParameters() to modify this object's parameters, then call
* updateParametersInContext() to copy them over to the Context.
*
*
* This method has several limitations. The only information it updates is the values of per-donor and per-acceptor parameters.
* All other aspects of the Force (the energy function, nonbonded method, cutoff distance, etc.) are unaffected and can only
* be changed by reinitializing the Context. The set of particles involved in a donor or acceptor cannot be changed, nor can
......
......@@ -47,7 +47,7 @@ namespace OpenMM {
* methods including both deterministic and stochastic integrators, Metropolized
* integrators, and integrators that must integrate additional quantities along
* with the particle positions and momenta.
*
*
* To create an integration algorithm, you first define a set of variables the
* integrator will compute. Variables come in two types: <i>global</i> variables
* have a single value, while <i>per-DOF</i> variables have a value for every
......@@ -57,12 +57,12 @@ namespace OpenMM {
* the CustomIntegrator. All variables are persistent between integration
* steps; once a value is set, it keeps that value until it is changed by the
* user or recomputed in a later integration step.
*
*
* Next, you define the algorithm as a series of computations. To execute a
* time step, the integrator performs the list of computations in order. Each
* computation updates the value of one global or per-DOF value. There are
* several types of computations that can be done:
*
*
* <ul>
* <li>Global: You provide a mathematical expression involving only global
* variables. It is evaluated and stored into a global variable.</li>
......@@ -78,15 +78,15 @@ namespace OpenMM {
* <li>Constrain Velocities: The particle velocities are updated so the net
* velocity along any constrained distance is 0.</li>
* </ul>
*
*
* Like all integrators, CustomIntegrator ignores any particle whose mass is 0.
* It is skipped when doing per-DOF computations, and is not included when
* computing sums over degrees of freedom.
*
*
* In addition to the variables you define by calling addGlobalVariable() and
* addPerDofVariable(), the integrator provides the following pre-defined
* variables:
*
*
* <ul>
* <li>dt: (global) This is the step size being used by the integrator.</li>
* <li>energy: (global, read-only) This is the current potential energy of the
......@@ -123,24 +123,24 @@ namespace OpenMM {
* <li>A global variable is created for every adjustable parameter defined
* in the integrator's Context.</li>
* </ul>
*
*
* The following example uses a CustomIntegrator to implement a velocity Verlet
* integrator:
*
*
* <tt><pre>
* CustomIntegrator integrator(0.001);
* integrator.addComputePerDof("v", "v+0.5*dt*f/m");
* integrator.addComputePerDof("x", "x+dt*v");
* integrator.addComputePerDof("v", "v+0.5*dt*f/m");
* </pre></tt>
*
*
* The first step updates the velocities based on the current forces.
* The second step updates the positions based on the new velocities, and the
* third step updates the velocities again. Although the first and third steps
* look identical, the forces used in them are different. You do not need to
* tell the integrator that; it will recognize that the positions have changed
* and know to recompute the forces automatically.
*
*
* The above example has two problems. First, it does not respect distance
* constraints. To make the integrator work with constraints, you need to add
* extra steps to tell it when and how to apply them. Second, it never gives
......@@ -149,7 +149,7 @@ namespace OpenMM {
* or a MonteCarloBarostat can scale particle positions. You need to add a
* step to tell the integrator when to do this. The following example corrects
* both these problems, using the RATTLE algorithm to apply constraints:
*
*
* <tt><pre>
* CustomIntegrator integrator(0.001);
* integrator.addPerDofVariable("x1", 0);
......@@ -161,12 +161,12 @@ namespace OpenMM {
* integrator.addComputePerDof("v", "v+0.5*dt*f/m+(x-x1)/dt");
* integrator.addConstrainVelocities();
* </pre></tt>
*
*
* CustomIntegrator can be used to implement multiple time step integrators. The
* following example shows an r-RESPA integrator. It assumes the quickly changing
* forces are in force group 0 and the slowly changing ones are in force group 1.
* It evaluates the "fast" forces four times as often as the "slow" forces.
*
*
* <tt><pre>
* CustomIntegrator integrator(0.004);
* integrator.addComputePerDof("v", "v+0.5*dt*f1/m");
......@@ -208,25 +208,25 @@ namespace OpenMM {
* freedom may not give the correct answer. For example, in a leapfrog integrator
* the velocities are "delayed" by half a time step, so the above formula would
* give the kinetic energy half a time step ago, not at the current time.
*
*
* Call setKineticEnergyExpression() to set an expression for the kinetic energy.
* It is computed for every degree of freedom (excluding ones whose mass is 0) and
* the result is summed. The default expression is "m*v*v/2", which is correct
* for many integrators.
*
*
* As example, the following line defines the correct way to compute kinetic energy
* when using a leapfrog algorithm:
*
*
* <tt><pre>
* integrator.setKineticEnergyExpression("m*v1*v1/2; v1=v+0.5*dt*f/m");
* </pre></tt>
*
*
* The kinetic energy expression may depend on the following pre-defined variables:
* x, v, f, m, dt. It also may depend on user-defined global and per-DOF variables,
* and on the values of adjustable parameters defined in the integrator's Context.
* It may <i>not</i> depend on any other variable, such as the potential energy,
* the force from a single force group, or a random number.
*
*
* Expressions may involve the operators + (add), - (subtract), * (multiply), / (divide), and ^ (power), and the following
* functions: sqrt, exp, log, sin, cos, sec, csc, tan, cot, asin, acos, atan, sinh, cosh, tanh, erf, erfc, min, max, abs, floor, ceil, step, delta, select. All trigonometric functions
* are defined in radians, and log is the natural logarithm. step(x) = 0 if x is less than 0, 1 otherwise. delta(x) = 1 if x is 0, 0 otherwise.
......@@ -278,7 +278,7 @@ public:
};
/**
* Create a CustomIntegrator.
*
*
* @param stepSize the step size with which to integrate the system (in picoseconds)
*/
CustomIntegrator(double stepSize);
......@@ -302,7 +302,7 @@ public:
}
/**
* Define a new global variable.
*
*
* @param name the name of the variable
* @param initialValue the variable will initially be set to this value
* @return the index of the variable that was added
......@@ -310,14 +310,14 @@ public:
int addGlobalVariable(const std::string& name, double initialValue);
/**
* Get the name of a global variable.
*
*
* @param index the index of the variable to get
* @return the name of the variable
*/
const std::string& getGlobalVariableName(int index) const;
/**
* Define a new per-DOF variable.
*
*
* @param name the name of the variable
* @param initialValue the variable will initially be set to this value for
* all degrees of freedom
......@@ -326,14 +326,14 @@ public:
int addPerDofVariable(const std::string& name, double initialValue);
/**
* Get the name of a per-DOF variable.
*
*
* @param index the index of the variable to get
* @return the name of the variable
*/
const std::string& getPerDofVariableName(int index) const;
/**
* Get the current value of a global variable.
*
*
* @param index the index of the variable to get
* @return the current value of the variable
*/
......@@ -347,21 +347,21 @@ public:
double getGlobalVariableByName(const std::string& name) const;
/**
* Set the value of a global variable.
*
*
* @param index the index of the variable to set
* @param value the new value of the variable
*/
void setGlobalVariable(int index, double value);
/**
* Set the value of a global variable, specified by name.
*
*
* @param name the name of the variable to set
* @param value the new value of the variable
*/
void setGlobalVariableByName(const std::string& name, double value);
/**
* Get the value of a per-DOF variable.
*
*
* @param index the index of the variable to get
* @param values the values of the variable for all degrees of freedom
* are stored into this
......@@ -370,28 +370,28 @@ public:
/**
* Get the value of a per-DOF variable, specified by name.
*
* @param name the name of the variable to get
* @param values the values of the variable for all degrees of freedom
* are stored into this
* @param name the name of the variable to get
* @param[out] values the values of the variable for all degrees of freedom
* are stored into this
*/
void getPerDofVariableByName(const std::string& name, std::vector<Vec3>& values) const;
/**
* Set the value of a per-DOF variable.
*
*
* @param index the index of the variable to set
* @param values the new values of the variable for all degrees of freedom
*/
void setPerDofVariable(int index, const std::vector<Vec3>& values);
/**
* Set the value of a per-DOF variable, specified by name.
*
*
* @param name the name of the variable to set
* @param values the new values of the variable for all degrees of freedom
*/
void setPerDofVariableByName(const std::string& name, const std::vector<Vec3>& values);
/**
* Add a step to the integration algorithm that computes a global value.
*
*
* @param variable the global variable to store the computed value into
* @param expression a mathematical expression involving only global variables.
* In each integration step, its value is computed and
......@@ -401,7 +401,7 @@ public:
int addComputeGlobal(const std::string& variable, const std::string& expression);
/**
* Add a step to the integration algorithm that computes a per-DOF value.
*
*
* @param variable the per-DOF variable to store the computed value into
* @param expression a mathematical expression involving both global and
* per-DOF variables. In each integration step, its value
......@@ -412,7 +412,7 @@ public:
int addComputePerDof(const std::string& variable, const std::string& expression);
/**
* Add a step to the integration algorithm that computes a sum over degrees of freedom.
*
*
* @param variable the global variable to store the computed value into
* @param expression a mathematical expression involving both global and
* per-DOF variables. In each integration step, its value
......@@ -425,28 +425,28 @@ public:
/**
* Add a step to the integration algorithm that updates particle positions so
* all constraints are satisfied.
*
*
* @return the index of the step that was added
*/
int addConstrainPositions();
/**
* Add a step to the integration algorithm that updates particle velocities
* so the net velocity along all constraints is 0.
*
*
* @return the index of the step that was added
*/
int addConstrainVelocities();
/**
* Add a step to the integration algorithm that allows Forces to update the
* context state.
*
*
* @return the index of the step that was added
*/
int addUpdateContextState();
/**
* Add a step which begins a new "if" block.
*
* @param expression a mathematical expression involving a comparison operator
* @param condition a mathematical expression involving a comparison operator
* and global variables. All steps between this one and
* the end of the block are executed only if the condition
* is true.
......@@ -457,7 +457,7 @@ public:
/**
* Add a step which begins a new "while" block.
*
* @param expression a mathematical expression involving a comparison operator
* @param condition a mathematical expression involving a comparison operator
* and global variables. All steps between this one and
* the end of the block are executed repeatedly as long as
* the condition remains true.
......@@ -474,14 +474,15 @@ public:
int endBlock();
/**
* Get the details of a computation step that has been added to the integration algorithm.
*
* @param index the index of the computation step to get
* @param type on exit, the type of computation this step performs
* @param variable on exit, the variable into which this step stores its result. If this
* step does not store a result in a variable, this will be an
* empty string.
* @param expression on exit, the expression this step evaluates. If this step does not
* evaluate an expression, this will be an empty string.
*
* @param index the index of the computation step to get
* @param[out] type the type of computation this step performs
* @param[out] variable the variable into which this step stores its
* result. If this step does not store a result in
* a variable, this will be an empty string.
* @param[out] expression the expression this step evaluates. If
* this step does not evaluate an expression, this
* will be an empty string.
*/
void getComputationStep(int index, ComputationType& type, std::string& variable, std::string& expression) const;
/**
......@@ -519,7 +520,7 @@ public:
}
/**
* Advance a simulation through time by taking a series of time steps.
*
*
* @param steps the number of time steps to take
*/
void step(int steps);
......
......@@ -47,13 +47,13 @@ namespace OpenMM {
* every possible set of N particles in the system. It may depend on the positions of the individual particles,
* the distances between pairs of particles, the angles formed by sets of three particles, and the dihedral
* angles formed by sets of four particles.
*
*
* Be aware that the cost of evaluating an N-particle interaction increases very rapidly with N. Values larger
* than N=3 are rarely used.
*
*
* We refer to a set of particles for which the energy is being evaluated as p1, p2, p3, etc. The energy expression
* may depend on the following variables and functions:
*
*
* <ul>
* <li>x1, y1, z1, x2, y2, z2, etc.: The x, y, and z coordinates of the particle positions. For example, x1
* is the x coordinate of particle p1, and y3 is the y coordinate of particle p3.</li>
......@@ -68,16 +68,16 @@ namespace OpenMM {
* that defines the interaction energy of each set of particles. Then call addPerParticleParameter() to define per-particle
* parameters, and addGlobalParameter() to define global parameters. The values of per-particle parameters are specified as
* part of the system definition, while values of global parameters may be modified during a simulation by calling Context::setParameter().
*
*
* Next, call addParticle() once for each particle in the System to set the values of its per-particle parameters.
* The number of particles for which you set parameters must be exactly equal to the number of particles in the
* System, or else an exception will be thrown when you try to create a Context. After a particle has been added,
* you can modify its parameters by calling setParticleParameters(). This will have no effect on Contexts that already exist
* unless you call updateParametersInContext().
*
*
* Multi-particle interactions can be very expensive to evaluate, so they are usually used with a cutoff distance. The exact
* interpretation of the cutoff depends on the permutation mode, as discussed below.
*
*
* CustomManyParticleForce also lets you specify "exclusions", particular pairs of particles whose interactions should be
* omitted from force and energy calculations. This is most often used for particles that are bonded to each other.
* If you specify a pair of particles as an exclusion, <i>all</i> sets that include those two particles will be omitted.
......@@ -97,7 +97,7 @@ namespace OpenMM {
* <tt><pre>
* force->addGlobalParameter("C", 1.0);
* </pre></tt>
*
*
* Notice that the expression is symmetric with respect to the particles. It only depends on the products
* cos(theta1)*cos(theta2)*cos(theta3) and r12*r13*r23, both of which are unchanged if the labels p1, p2, and p3 are permuted.
* This is required because we specified SinglePermutation as the permutation mode. (This is the default, so we did not
......@@ -105,36 +105,36 @@ namespace OpenMM {
* each set of particles. No guarantee is made about which particle will be identified as p1, p2, etc. Therefore, the
* energy <i>must</i> be symmetric with respect to exchange of particles. Otherwise, the results would be undefined because
* permuting the labels would change the energy.
*
*
* Not all many-particle interactions work this way. Another common pattern is for the expression to describe an interaction
* between one central particle and other nearby particles. An example of this is the 3-particle piece of the Stillinger-Weber
* potential:
*
*
* <tt><pre>CustomManyParticleForce* force = new CustomManyParticleForce(3,
* "L*eps*(cos(theta1)+1/3)^2*exp(sigma*gamma/(r12-a*sigma))*exp(sigma*gamma/(r13-a*sigma));"
"r12 = distance(p1,p2); r13 = distance(p1,p3); theta1 = angle(p3,p1,p2)");
* force->setPermutationMode(CustomManyParticleForce::UniqueCentralParticle);
* </pre></tt>
*
*
* When the permutation mode is set to UniqueCentralParticle, particle p1 is treated as the central particle. For a set of
* N particles, the expression is evaluated N times, once with each particle as p1. The expression can therefore treat
* p1 differently from the other particles. Notice that it is still symmetric with respect to p2 and p3, however. There
* is no guarantee about how those labels will be assigned to particles.
*
*
* Distance cutoffs are applied in different ways depending on the permutation mode. In SinglePermutation mode, every particle
* in the set must be within the cutoff distance of every other particle. If <i>any</i> two particles are further apart than
* the cutoff distance, the interaction is skipped. In UniqueCentralParticle mode, each particle must be within the cutoff
* distance of the central particle, but not necessarily of all the other particles. The cutoff may therefore exclude a subset
* of the permutations of a set of particles.
*
*
* Another common situation is that some particles are fundamentally different from others, causing the expression to be
* inherently non-symmetric. An example would be a water model that involves three particles, two of which <i>must</i> be
* hydrogen and one of which <i>must</i> be oxygen. Cases like this can be implemented using particle types.
*
*
* A particle type is an integer that you specify when you call addParticle(). (If you omit the argument, it defaults
* to 0.) For the water model, you could specify 0 for all oxygen atoms and 1 for all hydrogen atoms. You can then
* call setTypeFilter() to specify the list of allowed types for each of the N particles involved in an interaction:
*
*
* <tt><pre>
* set&lt;int&gt; oxygenTypes, hydrogenTypes;
* oxygenTypes.insert(0);
......@@ -147,7 +147,7 @@ namespace OpenMM {
* This specifies that of the three particles in an interaction, p1 must be oxygen while p2 and p3 must be hydrogen.
* The energy expression will only be evaluated for triplets of particles that satisfy those requirements. It will
* still only be evaluated once for each triplet, so it must still be symmetric with respect to p2 and p3.
*
*
* Expressions may involve the operators + (add), - (subtract), * (multiply), / (divide), and ^ (power), and the following
* functions: sqrt, exp, log, sin, cos, sec, csc, tan, cot, asin, acos, atan, sinh, cosh, tanh, erf, erfc, min, max, abs, floor, ceil, step, delta, select. All trigonometric functions
* are defined in radians, and log is the natural logarithm. step(x) = 0 if x is less than 0, 1 otherwise. delta(x) = 1 if x is 0, 0 otherwise.
......@@ -337,7 +337,7 @@ public:
* Set the default value of a global parameter.
*
* @param index the index of the parameter for which to set the default value
* @param name the default value of the parameter
* @param defaultValue the default value of the parameter
*/
void setGlobalParameterDefaultValue(int index, double defaultValue);
/**
......@@ -352,9 +352,9 @@ public:
/**
* Get the nonbonded force parameters for a particle.
*
* @param index the index of the particle for which to get parameters
* @param parameters the list of parameters for the specified particle
* @param type the type of the specified particle
* @param index the index of the particle for which to get parameters
* @param[out] parameters the list of parameters for the specified particle
* @param[out] type the type of the specified particle
*/
void getParticleParameters(int index, std::vector<double>& parameters, int& type) const;
/**
......@@ -367,7 +367,7 @@ public:
void setParticleParameters(int index, const std::vector<double>& parameters, int type);
/**
* Add a particle pair to the list of interactions that should be excluded.
*
*
* In many cases, you can use createExclusionsFromBonds() rather than adding each exclusion explicitly.
*
* @param particle1 the index of the first particle in the pair
......@@ -378,9 +378,9 @@ public:
/**
* Get the particles in a pair whose interaction should be excluded.
*
* @param index the index of the exclusion for which to get particle indices
* @param particle1 the index of the first particle in the pair
* @param particle2 the index of the second particle in the pair
* @param index the index of the exclusion for which to get particle indices
* @param[out] particle1 the index of the first particle in the pair
* @param[out] particle2 the index of the second particle in the pair
*/
void getExclusionParticles(int index, int& particle1, int& particle2) const;
/**
......@@ -404,16 +404,16 @@ public:
* Get the allowed particle types for one of the particles involved in the interaction.
* If this an empty set (the default), no filter is applied and all interactions are evaluated
* regardless of the type of the specified particle.
*
* @param index the index of the particle within the interaction (between 0 and getNumParticlesPerSet())
* @param types the allowed types for the specified particle
*
* @param index the index of the particle within the interaction (between 0 and getNumParticlesPerSet())
* @param[out] types the allowed types for the specified particle
*/
void getTypeFilter(int index, std::set<int>& types) const;
/**
* Set the allowed particle types for one of the particles involved in the interaction.
* If this an empty set (the default), no filter is applied and all interactions are evaluated
* regardless of the type of the specified particle.
*
*
* @param index the index of the particle within the interaction (between 0 and getNumParticlesPerSet())
* @param types the allowed types for the specified particle
*/
......@@ -454,7 +454,7 @@ public:
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
* Simply call setParticleParameters() to modify this object's parameters, then call updateParametersInContext()
* to copy them over to the Context.
*
*
* This method has several limitations. The only information it updates is the values of per-particle parameters.
* All other aspects of the Force (the energy function, nonbonded method, cutoff distance, etc.) are unaffected and can
* only be changed by reinitializing the Context. Also, this method cannot be used to add new particles, only to change
......
......@@ -54,7 +54,7 @@ namespace OpenMM {
* between the particles, as well as on any parameters you choose. Then call addPerParticleParameter() to define per-particle
* parameters, and addGlobalParameter() to define global parameters. The values of per-particle parameters are specified as
* part of the system definition, while values of global parameters may be modified during a simulation by calling Context::setParameter().
*
*
* Next, call addParticle() once for each particle in the System to set the values of its per-particle parameters.
* The number of particles for which you set parameters must be exactly equal to the number of particles in the
* System, or else an exception will be thrown when you try to create a Context. After a particle has been added,
......@@ -80,17 +80,17 @@ namespace OpenMM {
* above example, the energy only depends on the products sigma1*sigma2 and epsilon1*epsilon2, both of which are unchanged
* if the labels 1 and 2 are reversed. In contrast, if it depended on the difference sigma1-sigma2, the results would
* be undefined, because reversing the labels 1 and 2 would change the energy.
*
*
* CustomNonbondedForce can operate in two modes. By default, it computes the interaction of every particle in the System
* with every other particle. Alternatively, you can restrict it to only a subset of particle pairs. To do this, specify
* one or more "interaction groups". An interaction group consists of two sets of particles that should interact with
* each other. Every particle in the first set interacts with every particle in the second set. For example, you might use
* this feature to compute a solute-solvent interaction energy, while omitting all interactions between two solute atoms
* or two solvent atoms.
*
*
* To create an interaction group, call addInteractionGroup(). You may add as many interaction groups as you want.
* Be aware of the following:
*
*
* <ul>
* <li>Exclusions are still taken into account, so the interactions between excluded pairs are omitted.</li>
* <li>Likewise, a particle will never interact with itself, even if it appears in both sets of an interaction group.</li>
......@@ -99,7 +99,7 @@ namespace OpenMM {
* <li>If you do not add any interaction groups to a CustomNonbondedForce, it operates in the default mode where every
* particle interacts with every other particle.</li>
* </ul>
*
*
* When using a cutoff, by default the interaction is sharply truncated at the cutoff distance.
* Optionally you can instead use a switching function to make the interaction smoothly go to zero over a finite
* distance range. To enable this, call setUseSwitchingFunction(). You must also call setSwitchingDistance()
......@@ -109,16 +109,16 @@ namespace OpenMM {
* to write and understand. It allows you to use the same energy expression with or without a cutoff. Also, when using
* a long range correction (see below), separating out the switching function allows the correction to be calculated
* more accurately.
*
*
* Another optional feature of this class is to add a contribution to the energy which approximates the effect of all
* interactions beyond the cutoff in a periodic system. When running a simulation at constant pressure, this can improve
* the quality of the result. Call setUseLongRangeCorrection() to enable it.
*
*
* Computing the long range correction takes negligible work in each time step, but it does require an expensive precomputation
* at the start of the simulation. Furthermore, that precomputation must be repeated every time a global parameter changes
* (or when you modify per-particle parameters by calling updateParametersInContext()). This means that if parameters change
* frequently, the long range correction can be very slow. For this reason, it is disabled by default.
*
*
* Expressions may involve the operators + (add), - (subtract), * (multiply), / (divide), and ^ (power), and the following
* functions: sqrt, exp, log, sin, cos, sec, csc, tan, cot, asin, acos, atan, sinh, cosh, tanh, erf, erfc, min, max, abs, floor, ceil, step, delta, select. All trigonometric functions
* are defined in radians, and log is the natural logarithm. step(x) = 0 if x is less than 0, 1 otherwise. delta(x) = 1 if x is 0, 0 otherwise.
......@@ -192,7 +192,7 @@ public:
}
/**
* Get the number of tabulated functions that have been defined.
*
*
* @deprecated This method exists only for backward compatibility. Use getNumTabulatedFunctions() instead.
*/
int getNumFunctions() const {
......@@ -318,7 +318,7 @@ public:
* Set the default value of a global parameter.
*
* @param index the index of the parameter for which to set the default value
* @param name the default value of the parameter
* @param defaultValue the default value of the parameter
*/
void setGlobalParameterDefaultValue(int index, double defaultValue);
/**
......@@ -332,8 +332,8 @@ public:
/**
* Get the nonbonded force parameters for a particle.
*
* @param index the index of the particle for which to get parameters
* @param parameters the list of parameters for the specified particle
* @param index the index of the particle for which to get parameters
* @param[out] parameters the list of parameters for the specified particle
*/
void getParticleParameters(int index, std::vector<double>& parameters) const;
/**
......@@ -345,7 +345,7 @@ public:
void setParticleParameters(int index, const std::vector<double>& parameters);
/**
* Add a particle pair to the list of interactions that should be excluded.
*
*
* In many cases, you can use createExclusionsFromBonds() rather than adding each exclusion explicitly.
*
* @param particle1 the index of the first particle in the pair
......@@ -356,9 +356,9 @@ public:
/**
* Get the particles in a pair whose interaction should be excluded.
*
* @param index the index of the exclusion for which to get particle indices
* @param particle1 the index of the first particle in the pair
* @param particle2 the index of the second particle in the pair
* @param index the index of the exclusion for which to get particle indices
* @param[out] particle1 the index of the first particle in the pair
* @param[out] particle2 the index of the second particle in the pair
*/
void getExclusionParticles(int index, int& particle1, int& particle2) const;
/**
......@@ -431,7 +431,7 @@ public:
void setFunctionParameters(int index, const std::string& name, const std::vector<double>& values, double min, double max);
/**
* Add an interaction group. An interaction will be computed between every particle in set1 and every particle in set2.
*
*
* @param set1 the first set of particles forming the interaction group
* @param set2 the second set of particles forming the interaction group
* @return the index of the interaction group that was added
......@@ -439,15 +439,15 @@ public:
int addInteractionGroup(const std::set<int>& set1, const std::set<int>& set2);
/**
* Get the parameters for an interaction group.
*
* @param index the index of the interaction group for which to get parameters
* @param set1 the first set of particles forming the interaction group
* @param set2 the second set of particles forming the interaction group
*
* @param index the index of the interaction group for which to get parameters
* @param[out] set1 the first set of particles forming the interaction group
* @param[out] set2 the second set of particles forming the interaction group
*/
void getInteractionGroupParameters(int index, std::set<int>& set1, std::set<int>& set2) const;
/**
* Set the parameters for an interaction group.
*
*
* @param index the index of the interaction group for which to set parameters
* @param set1 the first set of particles forming the interaction group
* @param set2 the second set of particles forming the interaction group
......@@ -458,7 +458,7 @@ public:
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
* Simply call setParticleParameters() to modify this object's parameters, then call updateParametersInContext()
* to copy them over to the Context.
*
*
* This method has several limitations. The only information it updates is the values of per-particle parameters.
* All other aspects of the Force (the energy function, nonbonded method, cutoff distance, etc.) are unaffected and can
* only be changed by reinitializing the Context. Also, this method cannot be used to add new particles, only to change
......
......@@ -159,7 +159,7 @@ public:
* Set the default value of a global parameter.
*
* @param index the index of the parameter for which to set the default value
* @param name the default value of the parameter
* @param defaultValue the default value of the parameter
*/
void setGlobalParameterDefaultValue(int index, double defaultValue);
/**
......@@ -176,12 +176,12 @@ public:
/**
* Get the force field parameters for a torsion term.
*
* @param index the index of the torsion for which to get parameters
* @param particle1 the index of the first particle connected by the torsion
* @param particle2 the index of the second particle connected by the torsion
* @param particle3 the index of the third particle connected by the torsion
* @param particle4 the index of the fourth particle connected by the torsion
* @param parameters the list of parameters for the torsion
* @param index the index of the torsion for which to get parameters
* @param[out] particle1 the index of the first particle connected by the torsion
* @param[out] particle2 the index of the second particle connected by the torsion
* @param[out] particle3 the index of the third particle connected by the torsion
* @param[out] particle4 the index of the fourth particle connected by the torsion
* @param[out] parameters the list of parameters for the torsion
*/
void getTorsionParameters(int index, int& particle1, int& particle2, int& particle3, int& particle4, std::vector<double>& parameters) const;
/**
......@@ -200,7 +200,7 @@ public:
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
* Simply call setTorsionParameters() to modify this object's parameters, then call updateParametersInContext()
* to copy them over to the Context.
*
*
* This method has several limitations. The only information it updates is the values of per-torsion parameters.
* All other aspects of the Force (such as the energy function) are unaffected and can only be changed by reinitializing
* the Context. The set of particles involved in a torsion cannot be changed, nor can new torsions be added.
......
......@@ -40,14 +40,14 @@ namespace OpenMM {
/**
* This class implements an implicit solvation force using the GBSA-OBC model.
*
*
* To use this class, create a GBSAOBCForce object, then call addParticle() once for each particle in the
* System to define its parameters. The number of particles for which you define GBSA parameters must
* be exactly equal to the number of particles in the System, or else an exception will be thrown when you
* try to create a Context. After a particle has been added, you can modify its force field parameters
* by calling setParticleParameters(). This will have no effect on Contexts that already exist unless you
* call updateParametersInContext().
*
*
* When using this Force, the System should also include a NonbondedForce, and both objects must specify
* identical charges for all particles. Otherwise, the results will not be correct. Furthermore, if the
* nonbonded method is set to CutoffNonPeriodic or CutoffPeriodic, you should call setReactionFieldDielectric(1.0)
......@@ -98,16 +98,16 @@ public:
int addParticle(double charge, double radius, double scalingFactor);
/**
* Get the force field parameters for a particle.
*
* @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
*
* @param index the index of the particle for which to get parameters
* @param[out] charge the charge of the particle, measured in units of the proton charge
* @param[out] radius the GBSA radius of the particle, measured in nm
* @param[out] scalingFactor the OBC scaling factor for the particle
*/
void getParticleParameters(int index, double& charge, double& radius, double& scalingFactor) const;
/**
* Set the force field parameters for a particle.
*
*
* @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
......@@ -177,7 +177,7 @@ public:
* provides an efficient method to update certain parameters in an existing Context without needing to
* reinitialize it. Simply call setParticleParameters() to modify this object's parameters, then call
* updateParametersInContext() to copy them over to the Context.
*
*
* The only information this method updates is the values of per-particle parameters. All other aspects
* of the Force (the nonbonded method, the cutoff distance, etc.) are unaffected and can only be changed
* by reinitializing the Context. Furthermore, this method cannot be used to add new particles, only to
......
#ifndef OPENMM_GBVIFORCEFIELD_H_
#define OPENMM_GBVIFORCEFIELD_H_
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* This is part of the OpenMM molecular simulation toolkit originating from *
* Simbios, the NIH National Center for Physics-Based Simulation of *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008-2009 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the "Software"), *
* to deal in the Software without restriction, including without limitation *
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
* and/or sell copies of the Software, and to permit persons to whom the *
* Software is furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
* THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "Force.h"
#include <vector>
#include "internal/windowsExport.h"
namespace OpenMM {
/**
* This class implements an implicit solvation force using the GB/VI model.
* <p>
* To use this class, create a GBVIForce object, then call addParticle() once for each particle in the
* System to define its parameters. The number of particles for which you define GB/VI parameters must
* be exactly equal to the number of particles in the System, or else an exception will be thrown when you
* try to create a Context. After a particle has been added, you can modify its force field parameters
* by calling setParticleParameters().
*
* @deprecated This class is not supported by most platforms, and will eventually be removed. You can implement the same force with CustomGBForce.
*/
class OPENMM_EXPORT GBVIForce : public Force {
public:
/**
* This is an enumeration of the different methods that may be used for handling long range nonbonded forces.
*/
enum NonbondedMethod {
/**
* No cutoff is applied to nonbonded interactions. The full set of N^2 interactions is computed exactly.
* This necessarily means that periodic boundary conditions cannot be used. This is the default.
*/
NoCutoff = 0,
/**
* Interactions beyond the cutoff distance are ignored.
*/
CutoffNonPeriodic = 1,
/**
* 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.
*/
CutoffPeriodic = 2,
};
/**
* This is an enumeration of the different methods that may be used for scaling of the Born radii.
*/
enum BornRadiusScalingMethod {
/**
* No scaling method is applied.
*/
NoScaling = 0,
/**
* Use quintic spline scaling function
*/
QuinticSpline = 1
};
/*
* Create a GBVIForce.
*/
GBVIForce();
/**
* Get the number of particles in the system.
*/
int getNumParticles() const {
return particles.size();
}
/**
* Add the GB/VI parameters for a particle. This should be called once for each particle
* in the System. When it is called for the i'th time, it specifies the parameters for the i'th particle.
*
* @param charge the charge of the particle, measured in units of the proton charge
* @param radius the GB/VI radius of the particle, measured in nm
* @param gamma the gamma parameter
* @return the index of the particle that was added
*/
int addParticle(double charge, double radius, double gamma);
/**
* Get the force field parameters for a particle.
*
* @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 gamma the gamma parameter
*/
void getParticleParameters(int index, double& charge, double& radius, double& gamma) const;
/**
* Set the force field parameters for a particle.
*
* @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 GB/VI radius of the particle, measured in nm
* @param gamma the gamma parameter
*/
void setParticleParameters(int index, double charge, double radius, double gamma);
/**
* Add a bond
*
* @param particle1 the index of the first particle
* @param particle2 the index of the second particle
* @param distance the distance between the two particles, measured in nm
* @return the index of the bond that was added
*/
int addBond(int particle1, int particle2, double distance);
/**
* Get the parameters defining a bond
*
* @param index the index of the bond for which to get parameters
* @param particle1 the index of the first particle involved in the bond
* @param particle2 the index of the second particle involved in the bond
* @param distance the distance between the two particles, measured in nm
*/
void getBondParameters(int index, int& particle1, int& particle2, double& distance) const;
/**
* Set 1-2 bonds
*
* @param index index of the bond for which to set parameters
* @param particle1 index of first atom in bond
* @param particle2 index of second atom in bond
* @param bondLength bond length, measured in nm
*/
void setBondParameters( int index, int particle1, int particle2, double bondLength);
/**
* Get number of bonds
*
* @return number of bonds
*/
int getNumBonds() const;
/**
* Get the dielectric constant for the solvent.
*/
double getSolventDielectric() const {
return solventDielectric;
}
/**
* Set the dielectric constant for the solvent.
*/
void setSolventDielectric(double dielectric) {
solventDielectric = dielectric;
}
/**
* Get the dielectric constant for the solute.
*/
double getSoluteDielectric() const {
return soluteDielectric;
}
/**
* Set the dielectric constant for the solute.
*/
void setSoluteDielectric(double dielectric) {
soluteDielectric = dielectric;
}
/**
* Get the method used for handling long range nonbonded interactions.
*/
NonbondedMethod getNonbondedMethod() const;
/**
* Set the method used for handling long range nonbonded interactions.
*/
void setNonbondedMethod(NonbondedMethod method);
/**
* Get the cutoff distance (in nm) being used for nonbonded interactions. If the NonbondedMethod in use
* is NoCutoff, this value will have no effect.
*
* @return the cutoff distance, measured in nm
*/
double getCutoffDistance() const;
/**
* Set the cutoff distance (in nm) being used for nonbonded interactions. If the NonbondedMethod in use
* is NoCutoff, this value will have no effect.
*
* @param distance the cutoff distance, measured in nm
*/
void setCutoffDistance(double distance);
/**
* Get Born radius scaling method
*/
BornRadiusScalingMethod getBornRadiusScalingMethod() const;
/**
* Set Born radius scaling method
*/
void setBornRadiusScalingMethod( BornRadiusScalingMethod method);
/**
* Get the lower limit factor used in the quintic spline scaling method (typically 0.5-0.8)
*/
double getQuinticLowerLimitFactor() const;
/**
* Set the lower limit factor used in the quintic spline scaling method (typically 0.5-0.8)
*/
void setQuinticLowerLimitFactor(double quinticLowerLimitFactor );
/**
* Get the upper limit used in the quintic spline scaling method, measured in nm (~5.0)
*/
double getQuinticUpperBornRadiusLimit() const;
/**
* Set the upper limit used in the quintic spline scaling method, measured in nm (~5.0)
*/
void setQuinticUpperBornRadiusLimit(double quinticUpperBornRadiusLimit);
/**
* Returns whether or not this force makes use of periodic boundary
* conditions.
*
* @returns true if force uses PBC and false otherwise
*/
bool usesPeriodicBoundaryConditions() const {
return nonbondedMethod == GBVIForce::CutoffPeriodic;
}
protected:
ForceImpl* createImpl() const;
private:
class ParticleInfo;
NonbondedMethod nonbondedMethod;
double cutoffDistance, solventDielectric, soluteDielectric;
BornRadiusScalingMethod scalingMethod;
double quinticLowerLimitFactor, quinticUpperBornRadiusLimit;
class BondInfo;
std::vector<ParticleInfo> particles;
std::vector<BondInfo> bonds;
};
/**
* This is an internal class used to record information about a particle.
* @private
*/
class GBVIForce::ParticleInfo {
public:
double charge, radius, gamma;
ParticleInfo() {
charge = radius = gamma = 0.0;
}
ParticleInfo(double charge, double radius, double gamma) :
charge(charge), radius(radius), gamma(gamma) {
}
};
/**
* This is an internal class used to record information about a bond.
* @private
*/
class GBVIForce::BondInfo {
public:
int particle1, particle2;
double bondLength;
BondInfo() {
bondLength = 0.0;
particle1 = -1;
particle2 = -1;
}
BondInfo(int atomIndex1, int atomIndex2, double bondLength) :
particle1(atomIndex1), particle2(atomIndex2), bondLength(bondLength) {
}
};
} // namespace OpenMM
#endif /*OPENMM_GBVIFORCEFIELD_H_*/
......@@ -72,18 +72,18 @@ public:
int addAngle(int particle1, int particle2, int particle3, double angle, double k);
/**
* Get the force field parameters for an angle term.
*
* @param index the index of the angle for which to get parameters
* @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 angle the equilibrium angle, measured in radians
* @param k the harmonic force constant for the angle, measured in kJ/mol/radian^2
*
* @param index the index of the angle for which to get parameters
* @param[out] particle1 the index of the first particle forming the angle
* @param[out] particle2 the index of the second particle forming the angle
* @param[out] particle3 the index of the third particle forming the angle
* @param[out] angle the equilibrium angle, measured in radians
* @param[out] k the harmonic force constant for the angle, measured in kJ/mol/radian^2
*/
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 particle1 the index of the first particle forming the angle
* @param particle2 the index of the second particle forming the angle
......@@ -97,7 +97,7 @@ public:
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
* Simply call setAngleParameters() to modify this object's parameters, then call updateParametersInContext()
* to copy them over to the Context.
*
*
* The only information this method updates is the values of per-angle parameters. The set of particles involved
* in a angle cannot be changed, nor can new angles be added.
*/
......
......@@ -71,17 +71,17 @@ public:
int addBond(int particle1, int particle2, double length, double k);
/**
* Get the force field parameters for a bond term.
*
* @param index the index of the bond for which to get parameters
* @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, measured in kJ/mol/nm^2
*
* @param index the index of the bond for which to get parameters
* @param[out] particle1 the index of the first particle connected by the bond
* @param[out] particle2 the index of the second particle connected by the bond
* @param[out] length the equilibrium length of the bond, measured in nm
* @param[out] k the harmonic force constant for the bond, measured in kJ/mol/nm^2
*/
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 particle1 the index of the first particle connected by the bond
* @param particle2 the index of the second particle connected by the bond
......@@ -94,7 +94,7 @@ public:
* an efficient method to update certain parameters in an existing Context without needing to reinitialize it.
* Simply call setBondParameters() to modify this object's parameters, then call updateParametersInContext()
* to copy them over to the Context.
*
*
* The only information this method updates is the values of per-bond parameters. The set of particles involved
* in a bond cannot be changed, nor can new bonds be added.
*/
......
......@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008-2012 Stanford University and the Authors. *
* Portions copyright (c) 2008-2015 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
......@@ -61,30 +61,22 @@ public:
*
* @return the step size, measured in ps
*/
double getStepSize() const {
return stepSize;
}
virtual double getStepSize() const;
/**
* Set the size of each time step, in picoseconds. If this integrator uses variable time steps,
* the effect of calling this method is undefined, and it may simply be ignored.
*
* @param size the step size, measured in ps
*/
void setStepSize(double size) {
stepSize = size;
}
virtual void setStepSize(double size);
/**
* Get the distance tolerance within which constraints are maintained, as a fraction of the constrained distance.
*/
double getConstraintTolerance() const {
return constraintTol;
}
virtual double getConstraintTolerance() const;
/**
* Set the distance tolerance within which constraints are maintained, as a fraction of the constrained distance.
*/
void setConstraintTolerance(double tol) {
constraintTol = tol;
}
virtual void setConstraintTolerance(double tol);
/**
* Advance a simulation through time by taking a series of time steps.
*
......@@ -94,6 +86,7 @@ public:
protected:
friend class Context;
friend class ContextImpl;
friend class CompoundIntegrator;
ContextImpl* context;
Context* owner;
/**
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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