OpenMM
|
This class supports a wide variety of energy functions used to represent hydrogen bonding. More...
Public Member Functions | |
def | __del__ |
del(OpenMM::CustomHbondForce self) More... | |
def | getNumDonors |
getNumDonors(CustomHbondForce self) -> int More... | |
def | getNumAcceptors |
getNumAcceptors(CustomHbondForce self) -> int More... | |
def | getNumExclusions |
getNumExclusions(CustomHbondForce self) -> int More... | |
def | getNumPerDonorParameters |
getNumPerDonorParameters(CustomHbondForce self) -> int More... | |
def | getNumPerAcceptorParameters |
getNumPerAcceptorParameters(CustomHbondForce self) -> int More... | |
def | getNumGlobalParameters |
getNumGlobalParameters(CustomHbondForce self) -> int More... | |
def | getNumTabulatedFunctions |
getNumTabulatedFunctions(CustomHbondForce self) -> int More... | |
def | getNumFunctions |
getNumFunctions(CustomHbondForce self) -> int More... | |
def | getEnergyFunction |
getEnergyFunction(CustomHbondForce self) -> std::string const & More... | |
def | setEnergyFunction |
setEnergyFunction(CustomHbondForce self, std::string const & energy) More... | |
def | getNonbondedMethod |
getNonbondedMethod(CustomHbondForce self) -> OpenMM::CustomHbondForce::NonbondedMethod More... | |
def | setNonbondedMethod |
setNonbondedMethod(CustomHbondForce self, OpenMM::CustomHbondForce::NonbondedMethod method) More... | |
def | getCutoffDistance |
getCutoffDistance(CustomHbondForce self) -> double More... | |
def | setCutoffDistance |
setCutoffDistance(CustomHbondForce self, double distance) More... | |
def | addPerDonorParameter |
addPerDonorParameter(CustomHbondForce self, std::string const & name) -> int More... | |
def | getPerDonorParameterName |
getPerDonorParameterName(CustomHbondForce self, int index) -> std::string const & More... | |
def | setPerDonorParameterName |
setPerDonorParameterName(CustomHbondForce self, int index, std::string const & name) More... | |
def | addPerAcceptorParameter |
addPerAcceptorParameter(CustomHbondForce self, std::string const & name) -> int More... | |
def | getPerAcceptorParameterName |
getPerAcceptorParameterName(CustomHbondForce self, int index) -> std::string const & More... | |
def | setPerAcceptorParameterName |
setPerAcceptorParameterName(CustomHbondForce self, int index, std::string const & name) More... | |
def | addGlobalParameter |
addGlobalParameter(CustomHbondForce self, std::string const & name, double defaultValue) -> int More... | |
def | getGlobalParameterName |
getGlobalParameterName(CustomHbondForce self, int index) -> std::string const & More... | |
def | setGlobalParameterName |
setGlobalParameterName(CustomHbondForce self, int index, std::string const & name) More... | |
def | getGlobalParameterDefaultValue |
getGlobalParameterDefaultValue(CustomHbondForce self, int index) -> double More... | |
def | setGlobalParameterDefaultValue |
setGlobalParameterDefaultValue(CustomHbondForce self, int index, double defaultValue) More... | |
def | addDonor |
addDonor(CustomHbondForce self, int d1, int d2, int d3, vectord parameters) -> int More... | |
def | getDonorParameters |
getDonorParameters(CustomHbondForce self, int index) More... | |
def | setDonorParameters |
setDonorParameters(CustomHbondForce self, int index, int d1, int d2, int d3, vectord parameters) More... | |
def | addAcceptor |
addAcceptor(CustomHbondForce self, int a1, int a2, int a3, vectord parameters) -> int More... | |
def | getAcceptorParameters |
getAcceptorParameters(CustomHbondForce self, int index) More... | |
def | setAcceptorParameters |
setAcceptorParameters(CustomHbondForce self, int index, int a1, int a2, int a3, vectord parameters) More... | |
def | addExclusion |
addExclusion(CustomHbondForce self, int donor, int acceptor) -> int More... | |
def | getExclusionParticles |
getExclusionParticles(CustomHbondForce self, int index) More... | |
def | setExclusionParticles |
setExclusionParticles(CustomHbondForce self, int index, int donor, int acceptor) More... | |
def | addTabulatedFunction |
addTabulatedFunction(CustomHbondForce self, std::string const & name, TabulatedFunction function) -> int More... | |
def | getTabulatedFunction |
getTabulatedFunction(CustomHbondForce self, int index) -> TabulatedFunction getTabulatedFunction(CustomHbondForce self, int index) -> TabulatedFunction More... | |
def | getTabulatedFunctionName |
getTabulatedFunctionName(CustomHbondForce self, int index) -> std::string const & More... | |
def | addFunction |
addFunction(CustomHbondForce self, std::string const & name, vectord values, double min, double max) -> int More... | |
def | getFunctionParameters |
getFunctionParameters(CustomHbondForce self, int index) More... | |
def | setFunctionParameters |
setFunctionParameters(CustomHbondForce self, int index, std::string const & name, vectord values, double min, double max) More... | |
def | updateParametersInContext |
updateParametersInContext(CustomHbondForce self, Context context) More... | |
def | __init__ |
init(OpenMM::CustomHbondForce self, std::string const & energy) -> CustomHbondForce init(OpenMM::CustomHbondForce self, CustomHbondForce other) -> CustomHbondForce 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 | __copy__ |
def | __deepcopy__ |
Public Attributes | |
this | |
Static Public Attributes | |
NoCutoff = _openmm.CustomHbondForce_NoCutoff | |
CutoffNonPeriodic = _openmm.CustomHbondForce_CutoffNonPeriodic | |
CutoffPeriodic = _openmm.CustomHbondForce_CutoffPeriodic | |
This class supports a wide variety of energy functions used to represent hydrogen bonding.
It computes interactions between "donor" particle groups and "acceptor" particle groups, where each group may include up to three particles. Typically a donor group consists of a hydrogen atom and the atoms it is bonded to, and an acceptor group consists of a negatively charged atom and the atoms it is bonded to.
We refer to the particles in a donor group as d1, d2 and d3, and the particles in an acceptor group as a1, a2, and a3. For each donor and each acceptor, CustomHbondForce evaluates a user supplied algebraic expression to determine the interaction energy. The expression may depend on arbitrary distances, angles, and dihedral angles defined by any of the six particles involved. The function distance(p1, p2) is the distance between the particles p1 and p2 (where "p1" and "p2" should be replaced by the names of the actual particles to calculate the distance between), angle(p1, p2, p3) is the angle formed by the three specified particles, and dihedral(p1, p2, p3, p4) is the dihedral angle formed by the four specified particles.
The expression also may involve tabulated functions, and may depend on arbitrary global, per-donor, and per-acceptor parameters. It also optionally supports periodic boundary conditions and cutoffs for long range interactions.
To use this class, create a CustomHbondForce object, passing an algebraic expression to the constructor that defines the interaction energy between each donor and acceptor. Then call addPerDonorParameter() to define per-donor parameters, addPerAcceptorParameter() to define per-acceptor parameters, and addGlobalParameter() to define global parameters. The values of per-donor and per-acceptor 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 addDonor() and addAcceptor() to define donors and acceptors and specify their parameter values. After a donor or acceptor has been added, you can modify its parameters by calling setDonorParameters() or setAcceptorParameters(). This will have no effect on Contexts that already exist unless you call updateParametersInContext().
CustomHbondForce also lets you specify "exclusions", particular combinations of donors and acceptors 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 CustomHbondForce that implements a simple harmonic potential to keep the distance between a1 and d1, and the angle formed by a1-d1-d2, near ideal values:
CustomHbondForce* force = new CustomHbondForce("k*(distance(a1,d1)-r0)^2*(angle(a1,d1,d2)-theta0)^2");
This force depends on three parameters: k, r0, and theta0. The following code defines these as per-donor parameters:
force->addPerDonorParameter("k"); force->addPerDonorParameter("r0"); force->addPerDonorParameter("theta0");
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, step, delta. 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.
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.
def __del__ | ( | self | ) |
del(OpenMM::CustomHbondForce self)
References simtk.openmm.openmm.stripUnits().
def __init__ | ( | self, | |
args | |||
) |
init(OpenMM::CustomHbondForce self, std::string const & energy) -> CustomHbondForce init(OpenMM::CustomHbondForce self, CustomHbondForce other) -> CustomHbondForce
Create a CustomHbondForce.
energy | an algebraic expression giving the interaction energy between a donor and an acceptor as a function of inter-particle distances, angles, and dihedrals, as well as any global, per-donor, and per-acceptor parameters |
References simtk.openmm.openmm.stripUnits().
def addAcceptor | ( | self, | |
args | |||
) |
addAcceptor(CustomHbondForce self, int a1, int a2, int a3, vectord parameters) -> int
Add an acceptor group to the force
a1 | the index of the first particle for this acceptor group |
a2 | the index of the second particle for this acceptor group. If the group only includes one particle, this must be -1. |
a3 | the index of the third particle for this acceptor group. If the group includes less than three particles, this must be -1. |
parameters | the list of per-acceptor parameter values for the new acceptor |
References simtk.openmm.openmm.stripUnits().
def addDonor | ( | self, | |
args | |||
) |
addDonor(CustomHbondForce self, int d1, int d2, int d3, vectord parameters) -> int
Add a donor group to the force
d1 | the index of the first particle for this donor group |
d2 | the index of the second particle for this donor group. If the group only includes one particle, this must be -1. |
d3 | the index of the third particle for this donor group. If the group includes less than three particles, this must be -1. |
parameters | the list of per-donor parameter values for the new donor |
References simtk.openmm.openmm.stripUnits().
def addExclusion | ( | self, | |
args | |||
) |
addExclusion(CustomHbondForce self, int donor, int acceptor) -> int
Add a donor-acceptor pair to the list of interactions that should be excluded.
donor | the index of the donor to exclude |
acceptor | the index of the acceptor to exclude |
References simtk.openmm.openmm.stripUnits().
def addFunction | ( | self, | |
args | |||
) |
addFunction(CustomHbondForce 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(CustomHbondForce self, std::string const & name, double defaultValue) -> int
Add a new global parameter that the interaction may depend on.
name | the name of the parameter |
defaultValue | the default value of the parameter |
References simtk.openmm.openmm.stripUnits().
def addPerAcceptorParameter | ( | self, | |
args | |||
) |
addPerAcceptorParameter(CustomHbondForce self, std::string const & name) -> int
Add a new per-acceptor parameter that the interaction may depend on.
name | the name of the parameter |
References simtk.openmm.openmm.stripUnits().
def addPerDonorParameter | ( | self, | |
args | |||
) |
addPerDonorParameter(CustomHbondForce self, std::string const & name) -> int
Add a new per-donor parameter that the interaction may depend on.
name | the name of the parameter |
References simtk.openmm.openmm.stripUnits().
def addTabulatedFunction | ( | self, | |
args | |||
) |
addTabulatedFunction(CustomHbondForce self, std::string const & name, TabulatedFunction function) -> int
Add a tabulated function that may appear in the energy expression.
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 getAcceptorParameters | ( | self, | |
args | |||
) |
getAcceptorParameters(CustomHbondForce self, int index)
Get the properties of an acceptor group.
index | the index of the acceptor group to get |
a1 | the index of the first particle for this acceptor group |
a2 | the index of the second particle for this acceptor group. If the group only includes one particle, this will be -1. |
a3 | the index of the third particle for this acceptor group. If the group includes less than three particles, this will be -1. |
parameters | the list of per-acceptor parameter values for the acceptor |
References simtk.openmm.openmm.stripUnits().
def getCutoffDistance | ( | self | ) |
getCutoffDistance(CustomHbondForce self) -> double
Get the cutoff distance (in nm) being used. All interactions for which the distance between d1 and a1 is greater than the cutoff will be ignored. If the NonbondedMethod in use is NoCutoff, this value will have no effect.
References simtk.openmm.openmm.stripUnits().
def getDonorParameters | ( | self, | |
args | |||
) |
getDonorParameters(CustomHbondForce self, int index)
Get the properties of a donor group.
index | the index of the donor group to get |
d1 | the index of the first particle for this donor group |
d2 | the index of the second particle for this donor group. If the group only includes one particle, this will be -1. |
d3 | the index of the third particle for this donor group. If the group includes less than three particles, this will be -1. |
parameters | the list of per-donor parameter values for the donor |
References simtk.openmm.openmm.stripUnits().
def getEnergyFunction | ( | self | ) |
getEnergyFunction(CustomHbondForce self) -> std::string const &
Get the algebraic expression that gives the interaction energy between a donor and an acceptor
References simtk.openmm.openmm.stripUnits().
def getExclusionParticles | ( | self, | |
args | |||
) |
getExclusionParticles(CustomHbondForce self, int index)
Get the donor and acceptor in a pair whose interaction should be excluded.
index | the index of the exclusion for which to get donor and acceptor indices |
particle1 | the index of the donor |
particle2 | the index of the acceptor |
References simtk.openmm.openmm.stripUnits().
def getFunctionParameters | ( | self, | |
args | |||
) |
getFunctionParameters(CustomHbondForce 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(CustomHbondForce self, int index) -> double
Get the default value of a global parameter.
index | the index of the parameter for which to get the default value |
References simtk.openmm.openmm.stripUnits().
def getGlobalParameterName | ( | self, | |
args | |||
) |
getGlobalParameterName(CustomHbondForce self, int index) -> std::string const &
Get the name of a global parameter.
index | the index of the parameter for which to get the name |
References simtk.openmm.openmm.stripUnits().
def getNonbondedMethod | ( | self | ) |
getNonbondedMethod(CustomHbondForce self) -> OpenMM::CustomHbondForce::NonbondedMethod
Get the method used for handling long range nonbonded interactions.
References simtk.openmm.openmm.stripUnits().
def getNumAcceptors | ( | self | ) |
getNumAcceptors(CustomHbondForce self) -> int
Get the number of acceptors for which force field parameters have been defined.
References simtk.openmm.openmm.stripUnits().
def getNumDonors | ( | self | ) |
getNumDonors(CustomHbondForce self) -> int
Get the number of donors for which force field parameters have been defined.
References simtk.openmm.openmm.stripUnits().
def getNumExclusions | ( | self | ) |
getNumExclusions(CustomHbondForce self) -> int
Get the number of donor-acceptor pairs whose interactions should be excluded.
References simtk.openmm.openmm.stripUnits().
def getNumFunctions | ( | self | ) |
getNumFunctions(CustomHbondForce self) -> int
Get the number of tabulated functions that have been defined.
References simtk.openmm.openmm.stripUnits().
def getNumGlobalParameters | ( | self | ) |
getNumGlobalParameters(CustomHbondForce self) -> int
Get the number of global parameters that the interaction depends on.
References simtk.openmm.openmm.stripUnits().
def getNumPerAcceptorParameters | ( | self | ) |
getNumPerAcceptorParameters(CustomHbondForce self) -> int
Get the number of per-acceptor parameters that the interaction depends on.
References simtk.openmm.openmm.stripUnits().
def getNumPerDonorParameters | ( | self | ) |
getNumPerDonorParameters(CustomHbondForce self) -> int
Get the number of per-donor parameters that the interaction depends on.
References simtk.openmm.openmm.stripUnits().
def getNumTabulatedFunctions | ( | self | ) |
getNumTabulatedFunctions(CustomHbondForce self) -> int
Get the number of tabulated functions that have been defined.
References simtk.openmm.openmm.stripUnits().
def getPerAcceptorParameterName | ( | self, | |
args | |||
) |
getPerAcceptorParameterName(CustomHbondForce self, int index) -> std::string const &
Get the name of a per-acceptor parameter.
index | the index of the parameter for which to get the name |
References simtk.openmm.openmm.stripUnits().
def getPerDonorParameterName | ( | self, | |
args | |||
) |
getPerDonorParameterName(CustomHbondForce self, int index) -> std::string const &
Get the name of a per-donor parameter.
index | the index of the parameter for which to get the name |
References simtk.openmm.openmm.stripUnits().
def getTabulatedFunction | ( | self, | |
args | |||
) |
getTabulatedFunction(CustomHbondForce self, int index) -> TabulatedFunction getTabulatedFunction(CustomHbondForce self, int index) -> TabulatedFunction
Get a reference to a tabulated function that may appear in the energy expression.
index | the index of the function to get |
References simtk.openmm.openmm.stripUnits().
def getTabulatedFunctionName | ( | self, | |
args | |||
) |
getTabulatedFunctionName(CustomHbondForce self, int index) -> std::string const &
Get the name of a tabulated function that may appear in the energy expression.
index | the index of the function to get |
References simtk.openmm.openmm.stripUnits().
def setAcceptorParameters | ( | self, | |
args | |||
) |
setAcceptorParameters(CustomHbondForce self, int index, int a1, int a2, int a3, vectord parameters)
Set the properties of an acceptor group.
index | the index of the acceptor group to set |
a1 | the index of the first particle for this acceptor group |
a2 | the index of the second particle for this acceptor group. If the group only includes one particle, this must be -1. |
a3 | the index of the third particle for this acceptor group. If the group includes less than three particles, this must be -1. |
parameters | the list of per-acceptor parameter values for the acceptor |
References simtk.openmm.openmm.stripUnits().
def setCutoffDistance | ( | self, | |
args | |||
) |
setCutoffDistance(CustomHbondForce self, double distance)
Set the cutoff distance (in nm) being used. All interactions for which the distance between d1 and a1 is greater than the cutoff will be ignored. If the NonbondedMethod in use is NoCutoff, this value will have no effect.
distance | the cutoff distance, measured in nm |
References simtk.openmm.openmm.stripUnits().
def setDonorParameters | ( | self, | |
args | |||
) |
setDonorParameters(CustomHbondForce self, int index, int d1, int d2, int d3, vectord parameters)
Set the properties of a donor group.
index | the index of the donor group to set |
d1 | the index of the first particle for this donor group |
d2 | the index of the second particle for this donor group. If the group only includes one particle, this must be -1. |
d3 | the index of the third particle for this donor group. If the group includes less than three particles, this must be -1. |
parameters | the list of per-donor parameter values for the donor |
References simtk.openmm.openmm.stripUnits().
def setEnergyFunction | ( | self, | |
args | |||
) |
setEnergyFunction(CustomHbondForce self, std::string const & energy)
Set the algebraic expression that gives the interaction energy between a donor and an acceptor
References simtk.openmm.openmm.stripUnits().
def setExclusionParticles | ( | self, | |
args | |||
) |
setExclusionParticles(CustomHbondForce self, int index, int donor, int acceptor)
Get the donor and acceptor in a pair whose interaction should be excluded.
index | the index of the exclusion for which to get donor and acceptor indices |
particle1 | the index of the donor |
particle2 | the index of the acceptor |
References simtk.openmm.openmm.stripUnits().
def setFunctionParameters | ( | self, | |
args | |||
) |
setFunctionParameters(CustomHbondForce 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(CustomHbondForce self, int index, double defaultValue)
Set the default value of a global parameter.
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(CustomHbondForce self, int index, std::string const & name)
Set the name of a global parameter.
index | the index of the parameter for which to set the name |
name | the name of the parameter |
References simtk.openmm.openmm.stripUnits().
def setNonbondedMethod | ( | self, | |
args | |||
) |
setNonbondedMethod(CustomHbondForce self, OpenMM::CustomHbondForce::NonbondedMethod method)
Set the method used for handling long range nonbonded interactions.
References simtk.openmm.openmm.stripUnits().
def setPerAcceptorParameterName | ( | self, | |
args | |||
) |
setPerAcceptorParameterName(CustomHbondForce self, int index, std::string const & name)
Set the name of a per-acceptor parameter.
index | the index of the parameter for which to set the name |
name | the name of the parameter |
References simtk.openmm.openmm.stripUnits().
def setPerDonorParameterName | ( | self, | |
args | |||
) |
setPerDonorParameterName(CustomHbondForce self, int index, std::string const & name)
Set the name of a per-donor parameter.
index | the index of the parameter for which to set the name |
name | the name of the parameter |
References simtk.openmm.openmm.stripUnits().
def updateParametersInContext | ( | self, | |
args | |||
) |
updateParametersInContext(CustomHbondForce self, Context context)
Update the per-donor and per-acceptor 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 setDonorParameters() and setAcceptorParameters() to modify this object's parameters, then call updateParametersInState() 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 new donors or acceptors be added.
References simtk.openmm.openmm.stripUnits().
|
static |
|
static |
|
static |
this |
Referenced by System.__init__().