OpenMM

- Main Page
- Related Pages
- Classes

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
CustomNonbondedForce Class Reference

This class implements nonbonded interactions between particles. More...

Inheritance diagram for CustomNonbondedForce:

## Public Member Functions
def | __init__
| init(OpenMM::CustomNonbondedForce self, std::string const & energy) -> CustomNonbondedForce init(OpenMM::CustomNonbondedForce self, CustomNonbondedForce rhs) -> CustomNonbondedForce More...
def | __del__
| del(OpenMM::CustomNonbondedForce self) More...
def | getNumParticles
| getNumParticles(CustomNonbondedForce self) -> int More...
def | getNumExclusions
| getNumExclusions(CustomNonbondedForce self) -> int More...
def | getNumPerParticleParameters
| getNumPerParticleParameters(CustomNonbondedForce self) -> int More...
def | getNumGlobalParameters
| getNumGlobalParameters(CustomNonbondedForce self) -> int More...
def | getNumTabulatedFunctions
| getNumTabulatedFunctions(CustomNonbondedForce self) -> int More...
def | getNumFunctions
| getNumFunctions(CustomNonbondedForce self) -> int More...
def | getNumInteractionGroups
| getNumInteractionGroups(CustomNonbondedForce self) -> int More...
def | getEnergyFunction
| getEnergyFunction(CustomNonbondedForce self) -> std::string const & More...
def | setEnergyFunction
| setEnergyFunction(CustomNonbondedForce self, std::string const & energy) More...
def | getNonbondedMethod
| getNonbondedMethod(CustomNonbondedForce self) -> OpenMM::CustomNonbondedForce::NonbondedMethod More...
def | setNonbondedMethod
| setNonbondedMethod(CustomNonbondedForce self, OpenMM::CustomNonbondedForce::NonbondedMethod method) More...
def | getCutoffDistance
| getCutoffDistance(CustomNonbondedForce self) -> double More...
def | setCutoffDistance
| setCutoffDistance(CustomNonbondedForce self, double distance) More...
def | getUseSwitchingFunction
| getUseSwitchingFunction(CustomNonbondedForce self) -> bool More...
def | setUseSwitchingFunction
| setUseSwitchingFunction(CustomNonbondedForce self, bool use) More...
def | getSwitchingDistance
| getSwitchingDistance(CustomNonbondedForce self) -> double More...
def | setSwitchingDistance
| setSwitchingDistance(CustomNonbondedForce self, double distance) More...
def | getUseLongRangeCorrection
| getUseLongRangeCorrection(CustomNonbondedForce self) -> bool More...
def | setUseLongRangeCorrection
| setUseLongRangeCorrection(CustomNonbondedForce self, bool use) More...
def | addPerParticleParameter
| addPerParticleParameter(CustomNonbondedForce self, std::string const & name) -> int More...
def | getPerParticleParameterName
| getPerParticleParameterName(CustomNonbondedForce self, int index) -> std::string const & More...
def | setPerParticleParameterName
| setPerParticleParameterName(CustomNonbondedForce self, int index, std::string const & name) More...
def | addGlobalParameter
| addGlobalParameter(CustomNonbondedForce self, std::string const & name, double defaultValue) -> int More...
def | getGlobalParameterName
| getGlobalParameterName(CustomNonbondedForce self, int index) -> std::string const & More...
def | setGlobalParameterName
| setGlobalParameterName(CustomNonbondedForce self, int index, std::string const & name) More...
def | getGlobalParameterDefaultValue
| getGlobalParameterDefaultValue(CustomNonbondedForce self, int index) -> double More...
def | setGlobalParameterDefaultValue
| setGlobalParameterDefaultValue(CustomNonbondedForce self, int index, double defaultValue) More...
def | addParticle
| addParticle(CustomNonbondedForce self, vectord parameters) -> int More...
def | getParticleParameters
| getParticleParameters(CustomNonbondedForce self, int index) More...
def | setParticleParameters
| setParticleParameters(CustomNonbondedForce self, int index, vectord parameters) More...
def | addExclusion
| addExclusion(CustomNonbondedForce self, int particle1, int particle2) -> int More...
def | getExclusionParticles
| getExclusionParticles(CustomNonbondedForce self, int index) More...
def | setExclusionParticles
| setExclusionParticles(CustomNonbondedForce self, int index, int particle1, int particle2) More...
def | createExclusionsFromBonds
| createExclusionsFromBonds(CustomNonbondedForce self, vectorpairii bonds, int bondCutoff) More...
def | addTabulatedFunction
| addTabulatedFunction(CustomNonbondedForce self, std::string const & name, TabulatedFunction function) -> int More...
def | getTabulatedFunction
| getTabulatedFunction(CustomNonbondedForce self, int index) -> TabulatedFunction getTabulatedFunction(CustomNonbondedForce self, int index) -> TabulatedFunction More...
def | getTabulatedFunctionName
| getTabulatedFunctionName(CustomNonbondedForce self, int index) -> std::string const & More...
def | addFunction
| addFunction(CustomNonbondedForce self, std::string const & name, vectord values, double min, double max) -> int More...
def | getFunctionParameters
| getFunctionParameters(CustomNonbondedForce self, int index) More...
def | setFunctionParameters
| setFunctionParameters(CustomNonbondedForce self, int index, std::string const & name, vectord values, double min, double max) More...
def | addInteractionGroup
| addInteractionGroup(CustomNonbondedForce self, seti set1, seti set2) -> int More...
def | getInteractionGroupParameters
| getInteractionGroupParameters(CustomNonbondedForce self, int index) More...
def | setInteractionGroupParameters
| setInteractionGroupParameters(CustomNonbondedForce self, int index, seti set1, seti set2) More...
def | updateParametersInContext
| updateParametersInContext(CustomNonbondedForce self, Context context) More...
def | usesPeriodicBoundaryConditions
| usesPeriodicBoundaryConditions(CustomNonbondedForce self) -> bool More...
Public Member Functions inherited from Force
def | __init__
def | __del__
| del(OpenMM::Force self) More...
def | getForceGroup
| getForceGroup(Force self) -> int More...
def | setForceGroup
| setForceGroup(Force self, int group) More...
def | usesPeriodicBoundaryConditions
| usesPeriodicBoundaryConditions(Force self) -> bool More...
def | __copy__
def | __deepcopy__

## Public Attributes
| this

## Static Public Attributes
| NoCutoff = _openmm.CustomNonbondedForce_NoCutoff
| CutoffNonPeriodic = _openmm.CustomNonbondedForce_CutoffNonPeriodic
| CutoffPeriodic = _openmm.CustomNonbondedForce_CutoffPeriodic

## Detailed Description

This class implements nonbonded interactions between particles.

Unlike NonbondedForce, the functional form of the interaction is completely customizable, and may involve arbitrary algebraic expressions and tabulated functions. It may depend on the distance between particles, as well as on arbitrary global and per-particle parameters. It also optionally supports periodic boundary conditions and cutoffs for long range interactions.

To use this class, create a CustomNonbondedForce object, passing an algebraic expression to the constructor that defines the interaction energy between each pair of particles. The expression may depend on r, the distance 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, you can modify its parameters by calling setParticleParameters(). This will have no effect on Contexts that already exist unless you call updateParametersInContext().

CustomNonbondedForce 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.

As an example, the following code creates a CustomNonbondedForce that implements a 12-6 Lennard-Jones potential:

`CustomNonbondedForce* force = new CustomNonbondedForce("4*epsilon*((sigma/r)^12-(sigma/r)^6); sigma=0.5*(sigma1+sigma2); epsilon=sqrt(epsilon1*epsilon2)");`

This force depends on two parameters: sigma and epsilon. The following code defines these as per-particle parameters:

``

    force->addPerParticleParameter("sigma");
    force->addPerParticleParameter("epsilon");

The expression must be symmetric with respect to the two particles. It typically will only be evaluated once for each pair of particles, and no guarantee is made about which particle will be identified as "particle 1". In the 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:

- Exclusions are still taken into account, so the interactions between excluded pairs are omitted.

- Likewise, a particle will never interact with itself, even if it appears in both sets of an interaction group.

- If a particle pair appears in two different interaction groups, its interaction will be computed twice. This is sometimes useful, but be aware of it so you do not accidentally create unwanted duplicate interactions.

- 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.

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() to specify the distance at which the interaction should begin to decrease. The switching distance must be less than the cutoff distance. Of course, you could also incorporate the switching function directly into your energy expression, but there are several advantages to keeping it separate. It makes your energy expression simpler 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. select(x,y,z) = z if x = 0, y otherwise. The names of per-particle parameters have the suffix "1" or "2" appended to them to indicate the values for the two interacting particles. As seen in the above example, the expression may also involve intermediate quantities that are defined following the main expression, using ";" as a separator.

In addition, you can call addTabulatedFunction() to define a new function based on tabulated values. You specify the function by creating a TabulatedFunction object. That function can then appear in the expression.

## Constructor & Destructor Documentation

def __init__ | ( |  | self,
|  |  | args
| ) |  |

init(OpenMM::CustomNonbondedForce self, std::string const & energy) -> CustomNonbondedForce init(OpenMM::CustomNonbondedForce self, CustomNonbondedForce rhs) -> CustomNonbondedForce

Create a CustomNonbondedForce.

Parameters

  energy | an algebraic expression giving the interaction energy between two particles as a function of r, the distance between them, as well as any global and per-particle parameters

References simtk.openmm.openmm.stripUnits().

def __del__ | ( |  | self | ) |

del(OpenMM::CustomNonbondedForce self)

References simtk.openmm.openmm.stripUnits().

## Member Function Documentation

def addExclusion | ( |  | self,
|  |  | args
| ) |  |

addExclusion(CustomNonbondedForce self, int particle1, int particle2) -> int

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.

Parameters

  particle1 | the index of the first particle in the pair
  particle2 | the index of the second particle in the pair

References simtk.openmm.openmm.stripUnits().

def addFunction | ( |  | self,
|  |  | args
| ) |  |

addFunction(CustomNonbondedForce self, std::string const & name, vectord values, double min, double max) -> int

Add a tabulated function that may appear in the energy expression.

References simtk.openmm.openmm.stripUnits().

def addGlobalParameter | ( |  | self,
|  |  | args
| ) |  |

addGlobalParameter(CustomNonbondedForce self, std::string const & name, double defaultValue) -> int

Add a new global parameter that the interaction may depend on.

Parameters

  name | the name of the parameter
  defaultValue | the default value of the parameter

References simtk.openmm.openmm.stripUnits().

def addInteractionGroup | ( |  | self,
|  |  | args
| ) |  |

addInteractionGroup(CustomNonbondedForce self, seti set1, seti set2) -> int

Add an interaction group. An interaction will be computed between every particle in set1 and every particle in set2.

Parameters

  set1 | the first set of particles forming the interaction group
  set2 | the second set of particles forming the interaction group

References simtk.openmm.openmm.stripUnits().

def addParticle | ( |  | self,
|  |  | args
| ) |  |

addParticle(CustomNonbondedForce self, vectord parameters) -> int

Add the nonbonded force 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.

Parameters

  parameters | the list of parameters for the new particle

References simtk.openmm.openmm.stripUnits().

Referenced by NonbondedForce.addParticle_usingRVdw().

def addPerParticleParameter | ( |  | self,
|  |  | args
| ) |  |

addPerParticleParameter(CustomNonbondedForce self, std::string const & name) -> int

Add a new per-particle parameter that the interaction may depend on.

Parameters

  name | the name of the parameter

References simtk.openmm.openmm.stripUnits().

def addTabulatedFunction | ( |  | self,
|  |  | args
| ) |  |

addTabulatedFunction(CustomNonbondedForce self, std::string const & name, TabulatedFunction function) -> int

Add a tabulated function that may appear in the energy expression.

Parameters

  name | the name of the function as it appears in expressions
  function | a TabulatedFunction object defining the function. The TabulatedFunction should have been created on the heap with the "new" operator. The Force takes over ownership of it, and deletes it when the Force itself is deleted.

def createExclusionsFromBonds | ( |  | self,
|  |  | args
| ) |  |

createExclusionsFromBonds(CustomNonbondedForce self, vectorpairii bonds, int bondCutoff)

Identify exclusions based on the molecular topology. Particles which are separated by up to a specified number of bonds are added as exclusions.

Parameters

  bonds | the set of bonds based on which to construct exclusions. Each element specifies the indices of two particles that are bonded to each other.
  bondCutoff | pairs of particles that are separated by this many bonds or fewer are added to the list of exclusions

References simtk.openmm.openmm.stripUnits().

def getCutoffDistance | ( |  | self,
|  |  | args
| ) |  |

getCutoffDistance(CustomNonbondedForce self) -> double

Get the cutoff distance (in nm) being used for nonbonded interactions. If the NonbondedMethod in use is NoCutoff, this value will have no effect.

References simtk.openmm.openmm.stripUnits().

def getEnergyFunction | ( |  | self,
|  |  | args
| ) |  |

getEnergyFunction(CustomNonbondedForce self) -> std::string const &

Get the algebraic expression that gives the interaction energy between two particles

References simtk.openmm.openmm.stripUnits().

def getExclusionParticles | ( |  | self,
|  |  | args
| ) |  |

getExclusionParticles(CustomNonbondedForce self, int index)

Get the particles in a pair whose interaction should be excluded.

Parameters

  index | the index of the exclusion for which to get particle indices
  particle1 | the index of the first particle in the pair
  particle2 | the index of the second particle in the pair

References simtk.openmm.openmm.stripUnits().

def getFunctionParameters | ( |  | self,
|  |  | args
| ) |  |

getFunctionParameters(CustomNonbondedForce self, int index)

Get the parameters for a tabulated function that may appear in the energy expression.

References simtk.openmm.openmm.stripUnits().

def getGlobalParameterDefaultValue | ( |  | self,
|  |  | args
| ) |  |

getGlobalParameterDefaultValue(CustomNonbondedForce self, int index) -> double

Get the default value of a global parameter.

Parameters

  index | the index of the parameter for which to get the default value

References simtk.openmm.openmm.stripUnits().

def getGlobalParameterName | ( |  | self,
|  |  | args
| ) |  |

getGlobalParameterName(CustomNonbondedForce self, int index) -> std::string const &

Get the name of a global parameter.

Parameters

  index | the index of the parameter for which to get the name

References simtk.openmm.openmm.stripUnits().

def getInteractionGroupParameters | ( |  | self,
|  |  | args
| ) |  |

getInteractionGroupParameters(CustomNonbondedForce self, int index)

Get the parameters for an interaction group.

Parameters

  index | the index of the interaction group for which to get parameters
  set1 | the first set of particles forming the interaction group
  set2 | the second set of particles forming the interaction group

References simtk.openmm.openmm.stripUnits().

def getNonbondedMethod | ( |  | self,
|  |  | args
| ) |  |

getNonbondedMethod(CustomNonbondedForce self) -> OpenMM::CustomNonbondedForce::NonbondedMethod

Get the method used for handling long range nonbonded interactions.

References simtk.openmm.openmm.stripUnits().

def getNumExclusions | ( |  | self,
|  |  | args
| ) |  |

getNumExclusions(CustomNonbondedForce self) -> int

Get the number of particle pairs whose interactions should be excluded.

References simtk.openmm.openmm.stripUnits().

def getNumFunctions | ( |  | self,
|  |  | args
| ) |  |

getNumFunctions(CustomNonbondedForce self) -> int

Get the number of tabulated functions that have been defined.

References simtk.openmm.openmm.stripUnits().

def getNumGlobalParameters | ( |  | self,
|  |  | args
| ) |  |

getNumGlobalParameters(CustomNonbondedForce self) -> int

Get the number of global parameters that the interaction depends on.

References simtk.openmm.openmm.stripUnits().

def getNumInteractionGroups | ( |  | self,
|  |  | args
| ) |  |

getNumInteractionGroups(CustomNonbondedForce self) -> int

Get the number of interaction groups that have been defined.

References simtk.openmm.openmm.stripUnits().

def getNumParticles | ( |  | self,
|  |  | args
| ) |  |

getNumParticles(CustomNonbondedForce self) -> int

Get the number of particles for which force field parameters have been defined.

References simtk.openmm.openmm.stripUnits().

def getNumPerParticleParameters | ( |  | self,
|  |  | args
| ) |  |

getNumPerParticleParameters(CustomNonbondedForce self) -> int

Get the number of per-particle parameters that the interaction depends on.

References simtk.openmm.openmm.stripUnits().

def getNumTabulatedFunctions | ( |  | self,
|  |  | args
| ) |  |

getNumTabulatedFunctions(CustomNonbondedForce self) -> int

Get the number of tabulated functions that have been defined.

References simtk.openmm.openmm.stripUnits().

def getParticleParameters | ( |  | self,
|  |  | args
| ) |  |

getParticleParameters(CustomNonbondedForce self, int index)

Get the nonbonded force parameters for a particle.

Parameters

  index | the index of the particle for which to get parameters
  parameters | the list of parameters for the specified particle

References simtk.openmm.openmm.stripUnits().

def getPerParticleParameterName | ( |  | self,
|  |  | args
| ) |  |

getPerParticleParameterName(CustomNonbondedForce self, int index) -> std::string const &

Get the name of a per-particle parameter.

Parameters

  index | the index of the parameter for which to get the name

References simtk.openmm.openmm.stripUnits().

def getSwitchingDistance | ( |  | self,
|  |  | args
| ) |  |

getSwitchingDistance(CustomNonbondedForce self) -> double

Get the distance at which the switching function begins to reduce the interaction. This must be less than the cutoff distance.

References simtk.openmm.openmm.stripUnits().

def getTabulatedFunction | ( |  | self,
|  |  | args
| ) |  |

getTabulatedFunction(CustomNonbondedForce self, int index) -> TabulatedFunction getTabulatedFunction(CustomNonbondedForce self, int index) -> TabulatedFunction

Get a reference to a tabulated function that may appear in the energy expression.

Parameters

  index | the index of the function to get

References simtk.openmm.openmm.stripUnits().

def getTabulatedFunctionName | ( |  | self,
|  |  | args
| ) |  |

getTabulatedFunctionName(CustomNonbondedForce self, int index) -> std::string const &

Get the name of a tabulated function that may appear in the energy expression.

Parameters

  index | the index of the function to get

References simtk.openmm.openmm.stripUnits().

def getUseLongRangeCorrection | ( |  | self,
|  |  | args
| ) |  |

getUseLongRangeCorrection(CustomNonbondedForce self) -> bool

Get whether to add a correction to the energy to compensate for the cutoff and switching function. This has no effect if periodic boundary conditions are not used.

References simtk.openmm.openmm.stripUnits().

def getUseSwitchingFunction | ( |  | self,
|  |  | args
| ) |  |

getUseSwitchingFunction(CustomNonbondedForce self) -> bool

Get whether a switching function is applied to the interaction. If the nonbonded method is set to NoCutoff, this option is ignored.

References simtk.openmm.openmm.stripUnits().

def setCutoffDistance | ( |  | self,
|  |  | args
| ) |  |

setCutoffDistance(CustomNonbondedForce self, double distance)

Set the cutoff distance (in nm) being used for nonbonded interactions. If the NonbondedMethod in use is NoCutoff, this value will have no effect.

Parameters

  distance | the cutoff distance, measured in nm

References simtk.openmm.openmm.stripUnits().

def setEnergyFunction | ( |  | self,
|  |  | args
| ) |  |

setEnergyFunction(CustomNonbondedForce self, std::string const & energy)

Set the algebraic expression that gives the interaction energy between two particles

References simtk.openmm.openmm.stripUnits().

def setExclusionParticles | ( |  | self,
|  |  | args
| ) |  |

setExclusionParticles(CustomNonbondedForce self, int index, int particle1, int particle2)

Set the particles in a pair whose interaction should be excluded.

Parameters

  index | the index of the exclusion for which to set particle indices
  particle1 | the index of the first particle in the pair
  particle2 | the index of the second particle in the pair

References simtk.openmm.openmm.stripUnits().

def setFunctionParameters | ( |  | self,
|  |  | args
| ) |  |

setFunctionParameters(CustomNonbondedForce self, int index, std::string const & name, vectord values, double min, double max)

Set the parameters for a tabulated function that may appear in the energy expression.

References simtk.openmm.openmm.stripUnits().

def setGlobalParameterDefaultValue | ( |  | self,
|  |  | args
| ) |  |

setGlobalParameterDefaultValue(CustomNonbondedForce self, int index, double defaultValue)

Set the default value of a global parameter.

Parameters

  index | the index of the parameter for which to set the default value
  name | the default value of the parameter

References simtk.openmm.openmm.stripUnits().

def setGlobalParameterName | ( |  | self,
|  |  | args
| ) |  |

setGlobalParameterName(CustomNonbondedForce self, int index, std::string const & name)

Set the name of a global parameter.

Parameters

  index | the index of the parameter for which to set the name
  name | the name of the parameter

References simtk.openmm.openmm.stripUnits().

def setInteractionGroupParameters | ( |  | self,
|  |  | args
| ) |  |

setInteractionGroupParameters(CustomNonbondedForce self, int index, seti set1, seti set2)

Set the parameters for an interaction group.

Parameters

  index | the index of the interaction group for which to set parameters
  set1 | the first set of particles forming the interaction group
  set2 | the second set of particles forming the interaction group

References simtk.openmm.openmm.stripUnits().

def setNonbondedMethod | ( |  | self,
|  |  | args
| ) |  |

setNonbondedMethod(CustomNonbondedForce self, OpenMM::CustomNonbondedForce::NonbondedMethod method)

Set the method used for handling long range nonbonded interactions.

References simtk.openmm.openmm.stripUnits().

def setParticleParameters | ( |  | self,
|  |  | args
| ) |  |

setParticleParameters(CustomNonbondedForce self, int index, vectord parameters)

Set the nonbonded force parameters for a particle.

Parameters

  index | the index of the particle for which to set parameters
  parameters | the list of parameters for the specified particle

References simtk.openmm.openmm.stripUnits().

def setPerParticleParameterName | ( |  | self,
|  |  | args
| ) |  |

setPerParticleParameterName(CustomNonbondedForce self, int index, std::string const & name)

Set the name of a per-particle parameter.

Parameters

  index | the index of the parameter for which to set the name
  name | the name of the parameter

References simtk.openmm.openmm.stripUnits().

def setSwitchingDistance | ( |  | self,
|  |  | args
| ) |  |

setSwitchingDistance(CustomNonbondedForce self, double distance)

Set the distance at which the switching function begins to reduce the interaction. This must be less than the cutoff distance.

References simtk.openmm.openmm.stripUnits().

def setUseLongRangeCorrection | ( |  | self,
|  |  | args
| ) |  |

setUseLongRangeCorrection(CustomNonbondedForce self, bool use)

Set whether to add a correction to the energy to compensate for the cutoff and switching function. This has no effect if periodic boundary conditions are not used.

References simtk.openmm.openmm.stripUnits().

def setUseSwitchingFunction | ( |  | self,
|  |  | args
| ) |  |

setUseSwitchingFunction(CustomNonbondedForce self, bool use)

Set whether a switching function is applied to the interaction. If the nonbonded method is set to NoCutoff, this option is ignored.

References simtk.openmm.openmm.stripUnits().

def updateParametersInContext | ( |  | self,
|  |  | args
| ) |  |

updateParametersInContext(CustomNonbondedForce self, Context context)

Update the per-particle parameters in a Context to match those stored in this Force object. This method 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.

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 the parameters of existing ones.

References simtk.openmm.openmm.stripUnits().

def usesPeriodicBoundaryConditions | ( |  | self,
|  |  | args
| ) |  |

usesPeriodicBoundaryConditions(CustomNonbondedForce self) -> bool

Returns whether or not this force makes use of periodic boundary conditions.

References simtk.openmm.openmm.stripUnits().

## Member Data Documentation

CutoffNonPeriodic = _openmm.CustomNonbondedForce_CutoffNonPeriodic
| static

CutoffPeriodic = _openmm.CustomNonbondedForce_CutoffPeriodic
| static

NoCutoff = _openmm.CustomNonbondedForce_NoCutoff
| static

this

Referenced by System.__init__().

The documentation for this class was generated from the following file:

- openmm.py