MELDOpenMMPlugin
|
This is the MELD Force. More...
#include <MeldForce.h>
Public Member Functions | |
MeldForce () | |
Default constructor. More... | |
void | updateParametersInContext (OpenMM::Context &context) |
Update the per-restraint parameters in a Context to match those stored in this Force object. More... | |
int | getNumDistRestraints () const |
int | getNumHyperbolicDistRestraints () const |
int | getNumTorsionRestraints () const |
int | getNumDistProfileRestraints () const |
int | getNumDistProfileRestParams () const |
int | getNumTorsProfileRestraints () const |
int | getNumTorsProfileRestParams () const |
int | getNumTotalRestraints () const |
int | getNumGroups () const |
int | getNumCollections () const |
void | getDistanceRestraintParams (int index, int &atom1, int &atom2, float &r1, float &r2, float &r3, float &r4, float &forceConstant, int &globalIndex) const |
Get the parameters for a distance restraint. More... | |
void | getHyperbolicDistanceRestraintParams (int index, int &atom1, int &atom2, float &r1, float &r2, float &r3, float &r4, float &forceConstant, float &asymptote, int &globalIndex) const |
Get the parameters for a hyperbolic distance restraint. More... | |
void | getTorsionRestraintParams (int index, int &atom1, int &atom2, int &atom3, int &atom4, float &phi, float &deltaPhi, float &forceConstant, int &globalIndex) const |
Get the parameters for a torsion restraint. More... | |
void | getDistProfileRestraintParams (int index, int &atom1, int &atom2, float &rMin, float &rMax, int &nBins, std::vector< double > &a0, std::vector< double > &a1, std::vector< double > &a2, std::vector< double > &a3, float &scaleFactor, int &globalIndex) const |
Get the parameters for a distance profile restraint. More... | |
void | getTorsProfileRestraintParams (int index, int &atom1, int &atom2, int &atom3, int &atom4, int &atom5, int &atom6, int &atom7, int &atom8, int &nBins, std::vector< double > &a0, std::vector< double > &a1, std::vector< double > &a2, std::vector< double > &a3, std::vector< double > &a4, std::vector< double > &a5, std::vector< double > &a6, std::vector< double > &a7, std::vector< double > &a8, std::vector< double > &a9, std::vector< double > &a10, std::vector< double > &a11, std::vector< double > &a12, std::vector< double > &a13, std::vector< double > &a14, std::vector< double > &a15, float &scaleFactor, int &globalIndex) const |
Get the parameters for a torsion profile restraint. More... | |
void | getGroupParams (int index, std::vector< int > &indices, int &numActive) const |
Get the parameters for a group of restraints. More... | |
void | getCollectionParams (int index, std::vector< int > &indices, int &numActive) const |
Get the parameters for a collection of restraint groups. More... | |
int | addDistanceRestraint (int particle1, int particle2, float r1, float r2, float r3, float r4, float force_constant) |
Create a new distance restraint. More... | |
void | modifyDistanceRestraint (int index, int particle1, int particle2, float r1, float r2, float r3, float r4, float force_constant) |
Modify an existing distance restraint. More... | |
int | addHyperbolicDistanceRestraint (int particle1, int particle2, float r1, float r2, float r3, float r4, float force_constant, float asymptote) |
Create a new hyperbolic distance restraint. More... | |
void | modifyHyperbolicDistanceRestraint (int index, int particle1, int particle2, float r1, float r2, float r3, float r4, float force_constant, float asymptote) |
Modify an existing hyperbolic distance restraint. More... | |
int | addTorsionRestraint (int atom1, int atom2, int atom3, int atom4, float phi, float deltaPhi, float forceConstant) |
Create a new torsion restraint. More... | |
void | modifyTorsionRestraint (int index, int atom1, int atom2, int atom3, int atom4, float phi, float deltaPhi, float forceConstant) |
Modify an existing torsion restraint. More... | |
int | addDistProfileRestraint (int atom1, int atom2, float rMin, float rMax, int nBins, std::vector< double > a0, std::vector< double > a1, std::vector< double > a2, std::vector< double > a3, float scaleFactor) |
Create a new distance profile restraint. More... | |
void | modifyDistProfileRestraint (int index, int atom1, int atom2, float rMin, float rMax, int nBins, std::vector< double > a0, std::vector< double > a1, std::vector< double > a2, std::vector< double > a3, float scaleFactor) |
Modify an existing distance profile restraint. More... | |
int | addTorsProfileRestraint (int atom1, int atom2, int atom3, int atom4, int atom5, int atom6, int atom7, int atom8, int nBins, std::vector< double > a0, std::vector< double > a1, std::vector< double > a2, std::vector< double > a3, std::vector< double > a4, std::vector< double > a5, std::vector< double > a6, std::vector< double > a7, std::vector< double > a8, std::vector< double > a9, std::vector< double > a10, std::vector< double > a11, std::vector< double > a12, std::vector< double > a13, std::vector< double > a14, std::vector< double > a15, float scaleFactor) |
Create a new torsion profile restraint. More... | |
void | modifyTorsProfileRestraint (int index, int atom1, int atom2, int atom3, int atom4, int atom5, int atom6, int atom7, int atom8, int nBins, std::vector< double > a0, std::vector< double > a1, std::vector< double > a2, std::vector< double > a3, std::vector< double > a4, std::vector< double > a5, std::vector< double > a6, std::vector< double > a7, std::vector< double > a8, std::vector< double > a9, std::vector< double > a10, std::vector< double > a11, std::vector< double > a12, std::vector< double > a13, std::vector< double > a14, std::vector< double > a15, float scaleFactor) |
Modify an existing torsion profile restraint. More... | |
int | addGroup (std::vector< int > restraint_indices, int n_active) |
Create a new group of restraints. More... | |
int | addCollection (std::vector< int > group_indices, int n_active) |
Create a new collection of restraint groups. More... | |
Protected Member Functions | |
OpenMM::ForceImpl * | createImpl () const |
This is the MELD Force.
MeldForce | ( | ) |
Default constructor.
int addCollection | ( | std::vector< int > | group_indices, |
int | n_active | ||
) |
Create a new collection of restraint groups.
group_indices | the indices of the groups in the collection |
n_active | the number of active groups in the collection |
int addDistanceRestraint | ( | int | particle1, |
int | particle2, | ||
float | r1, | ||
float | r2, | ||
float | r3, | ||
float | r4, | ||
float | force_constant | ||
) |
Create a new distance restraint.
There are five regions:
I: r < r1
II: r1 < r < r2
III: r2 < r < r3
IV: r3 < r < r4
V: r4 < r
The energy is linear in regions I and V, quadratic in II and IV, and zero in III.
particle1 | the first atom |
particle2 | the second atom |
r1 | the upper bound of region 1 |
r2 | the upper bound of region 2 |
r3 | the upper bound of region 3 |
r4 | the upper bound of region 4 |
forceConstant | the force constant |
int addDistProfileRestraint | ( | int | atom1, |
int | atom2, | ||
float | rMin, | ||
float | rMax, | ||
int | nBins, | ||
std::vector< double > | a0, | ||
std::vector< double > | a1, | ||
std::vector< double > | a2, | ||
std::vector< double > | a3, | ||
float | scaleFactor | ||
) |
Create a new distance profile restraint.
bin = floor( (r - rMin) / (rMax - rMin) * nBins) )
binWidth = (rMax - rMin) / nBins
t = (r - bin * binWidth + rMin) / binWidth;
E = scaleFactor * (a0 + a1 * t + a2 * t^2 + a3 * t^3)
atom1 | the first atom |
atom2 | the second atom |
rMin | the lower bound of the restraint |
rMax | the upper bound of the restraint |
nBins | the number of bins |
aN | the Nth spline parameter where N is in (0,1,2,3) |
scaleFactor | the scale factor |
int addGroup | ( | std::vector< int > | restraint_indices, |
int | n_active | ||
) |
Create a new group of restraints.
restraint_indices | the indices of the restraints in the group |
n_active | the number of active restraints in the group |
int addHyperbolicDistanceRestraint | ( | int | particle1, |
int | particle2, | ||
float | r1, | ||
float | r2, | ||
float | r3, | ||
float | r4, | ||
float | force_constant, | ||
float | asymptote | ||
) |
Create a new hyperbolic distance restraint.
There are five regions:
I: r < r1
II: r1 < r < r2
III: r2 < r < r3
IV: r3 < r < r4
V: r4 < r
The energy is linear in region I, quadratic in II and IV, and zero in III.
The energy is hyperbolic in region V, with an asymptotic value set by the parameter asymptote. The energy will be 1/3 of the asymptotic value at r=r4. The distance between r3 and r4 controls the steepness of the potential.
particle1 | the first atom |
particle2 | the second atom |
r1 | the upper bound of region 1 |
r2 | the upper bound of region 2 |
r3 | the upper bound of region 3 |
r4 | the upper bound of region 4 |
forceConstant | the force constant in regions I and II |
asymptote | the asymptotic value in region V, also controls the steepness in region IV. |
int addTorsionRestraint | ( | int | atom1, |
int | atom2, | ||
int | atom3, | ||
int | atom4, | ||
float | phi, | ||
float | deltaPhi, | ||
float | forceConstant | ||
) |
Create a new torsion restraint.
If (x - phi) < -deltaPhi: E = 1/2 * forceConstant * (x - phi + deltaPhi)^2
Else if (x - phi) > deltaPhi: E = 1/2 * forceConstant * (x - phi - deltaPhi)^2
Else: E = 0
atom1 | the first atom |
atom2 | the second atom |
atom3 | the third atom |
atom4 | the fourth atom |
phi | the equilibrium torsion (degrees) |
deltaPhi | the deltaPhi parameter (degrees) |
forceConstant | the force constant |
int addTorsProfileRestraint | ( | int | atom1, |
int | atom2, | ||
int | atom3, | ||
int | atom4, | ||
int | atom5, | ||
int | atom6, | ||
int | atom7, | ||
int | atom8, | ||
int | nBins, | ||
std::vector< double > | a0, | ||
std::vector< double > | a1, | ||
std::vector< double > | a2, | ||
std::vector< double > | a3, | ||
std::vector< double > | a4, | ||
std::vector< double > | a5, | ||
std::vector< double > | a6, | ||
std::vector< double > | a7, | ||
std::vector< double > | a8, | ||
std::vector< double > | a9, | ||
std::vector< double > | a10, | ||
std::vector< double > | a11, | ||
std::vector< double > | a12, | ||
std::vector< double > | a13, | ||
std::vector< double > | a14, | ||
std::vector< double > | a15, | ||
float | scaleFactor | ||
) |
Create a new torsion profile restraint.
atom1 | the first atom |
atom2 | the second atom |
atom3 | the third atom |
atom4 | the fourth atom |
atom5 | the fifth atom |
atom6 | the sixth atom |
atom7 | the seventh atom |
atom8 | the eighth atom |
nBins | the number of bins |
aN | the Nth spline parameter where N is in (0,1,...,14,15) |
scaleFactor | the scale factor |
|
protected |
void getCollectionParams | ( | int | index, |
std::vector< int > & | indices, | ||
int & | numActive | ||
) | const |
Get the parameters for a collection of restraint groups.
index | the index of the collection |
indices | the indices of the groups in the collection |
numActive | the number of active groups in the collection |
void getDistanceRestraintParams | ( | int | index, |
int & | atom1, | ||
int & | atom2, | ||
float & | r1, | ||
float & | r2, | ||
float & | r3, | ||
float & | r4, | ||
float & | forceConstant, | ||
int & | globalIndex | ||
) | const |
Get the parameters for a distance restraint.
See addDistanceRestraint() for more details about the parameters.
index | the index of the restraint |
atom1 | the first atom |
atom2 | the second atom |
r1 | the upper bound of region 1 |
r2 | the upper bound of region 2 |
r3 | the upper bound of region 3 |
r4 | the upper bound of region 4 |
forceConstant | the force constant |
globalIndex | the global index of the restraint |
void getDistProfileRestraintParams | ( | int | index, |
int & | atom1, | ||
int & | atom2, | ||
float & | rMin, | ||
float & | rMax, | ||
int & | nBins, | ||
std::vector< double > & | a0, | ||
std::vector< double > & | a1, | ||
std::vector< double > & | a2, | ||
std::vector< double > & | a3, | ||
float & | scaleFactor, | ||
int & | globalIndex | ||
) | const |
Get the parameters for a distance profile restraint.
See addDistProfileRestraint() for more details about the parameters.
index | the index of the restraint |
atom1 | the first atom |
atom2 | the second atom |
rMin | the lower bound of the restraint |
rMax | the upper bound of the restraint |
nBins | the number of bins |
aN | the Nth spline parameter where N is in (0,1,2,3) |
scaleFactor | the scale factor |
globalIndex | the global index of the restraint |
void getGroupParams | ( | int | index, |
std::vector< int > & | indices, | ||
int & | numActive | ||
) | const |
Get the parameters for a group of restraints.
index | the index of the group |
indices | the indices of the restraints in the group |
numActive | the number of active restraints in the group |
void getHyperbolicDistanceRestraintParams | ( | int | index, |
int & | atom1, | ||
int & | atom2, | ||
float & | r1, | ||
float & | r2, | ||
float & | r3, | ||
float & | r4, | ||
float & | forceConstant, | ||
float & | asymptote, | ||
int & | globalIndex | ||
) | const |
Get the parameters for a hyperbolic distance restraint.
See addHyperbolicDistanceRestraint() for more details about the parameters.
index | the index of the restraint |
atom1 | the first atom |
atom2 | the second atom |
r1 | the upper bound of region 1 |
r2 | the upper bound of region 2 |
r3 | the upper bound of region 3 |
r4 | the upper bound of region 4 |
forceConstant | the force constant for region 1 |
asymptote | the asymptotic energy in region 4 |
globalIndex | the global index of the restraint |
int getNumCollections | ( | ) | const |
int getNumDistProfileRestParams | ( | ) | const |
int getNumDistProfileRestraints | ( | ) | const |
int getNumDistRestraints | ( | ) | const |
int getNumGroups | ( | ) | const |
int getNumHyperbolicDistRestraints | ( | ) | const |
int getNumTorsionRestraints | ( | ) | const |
int getNumTorsProfileRestParams | ( | ) | const |
int getNumTorsProfileRestraints | ( | ) | const |
int getNumTotalRestraints | ( | ) | const |
void getTorsionRestraintParams | ( | int | index, |
int & | atom1, | ||
int & | atom2, | ||
int & | atom3, | ||
int & | atom4, | ||
float & | phi, | ||
float & | deltaPhi, | ||
float & | forceConstant, | ||
int & | globalIndex | ||
) | const |
Get the parameters for a torsion restraint.
See addTorsionRestraint() for more details about the parameters.
index | the index of the restraint |
atom1 | the first atom |
atom2 | the second atom |
atom3 | the third atom |
atom4 | the fourth atom |
phi | the equilibrium torsion (degrees) |
deltaPhi | the deltaPhi parameter (degrees) |
forceConstant | the force constant |
globalIndex | the global index of the restraint |
void getTorsProfileRestraintParams | ( | int | index, |
int & | atom1, | ||
int & | atom2, | ||
int & | atom3, | ||
int & | atom4, | ||
int & | atom5, | ||
int & | atom6, | ||
int & | atom7, | ||
int & | atom8, | ||
int & | nBins, | ||
std::vector< double > & | a0, | ||
std::vector< double > & | a1, | ||
std::vector< double > & | a2, | ||
std::vector< double > & | a3, | ||
std::vector< double > & | a4, | ||
std::vector< double > & | a5, | ||
std::vector< double > & | a6, | ||
std::vector< double > & | a7, | ||
std::vector< double > & | a8, | ||
std::vector< double > & | a9, | ||
std::vector< double > & | a10, | ||
std::vector< double > & | a11, | ||
std::vector< double > & | a12, | ||
std::vector< double > & | a13, | ||
std::vector< double > & | a14, | ||
std::vector< double > & | a15, | ||
float & | scaleFactor, | ||
int & | globalIndex | ||
) | const |
Get the parameters for a torsion profile restraint.
index | the index of the restraint |
atom1 | the first atom |
atom2 | the second atom |
atom3 | the third atom |
atom4 | the fourth atom |
atom5 | the fifth atom |
atom6 | the sixth atom |
atom7 | the seventh atom |
atom8 | the eighth atom |
nBins | the number of bins |
aN | the Nth spline parameter where N is in (0,1,...,14,15) |
scaleFactor | the scale factor |
globalIndex | the global index of the restraint |
void modifyDistanceRestraint | ( | int | index, |
int | particle1, | ||
int | particle2, | ||
float | r1, | ||
float | r2, | ||
float | r3, | ||
float | r4, | ||
float | force_constant | ||
) |
Modify an existing distance restraint.
See addDistanceRestraint() for more details about the parameters.
index | the index of the restraint |
particle1 | the first atom |
particle2 | the second atom |
r1 | the upper bound of region 1 |
r2 | the upper bound of region 2 |
r3 | the upper bound of region 3 |
r4 | the upper bound of region 4 |
forceConstant | the force constant |
void modifyDistProfileRestraint | ( | int | index, |
int | atom1, | ||
int | atom2, | ||
float | rMin, | ||
float | rMax, | ||
int | nBins, | ||
std::vector< double > | a0, | ||
std::vector< double > | a1, | ||
std::vector< double > | a2, | ||
std::vector< double > | a3, | ||
float | scaleFactor | ||
) |
Modify an existing distance profile restraint.
See addDistProfileRestraint() for more details about the parameters.
index | the index of the restraint |
atom1 | the first atom |
atom2 | the second atom |
rMin | the lower bound of the restraint |
rMax | the upper bound of the restraint |
nBins | the number of bins |
aN | the Nth spline parameter where N is in (0,1,2,3) |
scaleFactor | the scale factor |
void modifyHyperbolicDistanceRestraint | ( | int | index, |
int | particle1, | ||
int | particle2, | ||
float | r1, | ||
float | r2, | ||
float | r3, | ||
float | r4, | ||
float | force_constant, | ||
float | asymptote | ||
) |
Modify an existing hyperbolic distance restraint.
See addHyperbolicDistanceRestraint() for more details about the parameters.
index | the index of the restraint |
particle1 | the first atom |
particle2 | the second atom |
r1 | the upper bound of region 1 |
r2 | the upper bound of region 2 |
r3 | the upper bound of region 3 |
r4 | the upper bound of region 4 |
forceConstant | the force constant |
asymptote | the asymptotic value |
void modifyTorsionRestraint | ( | int | index, |
int | atom1, | ||
int | atom2, | ||
int | atom3, | ||
int | atom4, | ||
float | phi, | ||
float | deltaPhi, | ||
float | forceConstant | ||
) |
Modify an existing torsion restraint.
See addTorsionRestraint() for more details about the parameters.
index | the index of the restraint |
atom1 | the first atom |
atom2 | the second atom |
atom3 | the third atom |
atom4 | the fourth atom |
phi | the equilibrium torsion (degrees) |
deltaPhi | the deltaPhi parameter (degrees) |
forceConstant | the force constant |
void modifyTorsProfileRestraint | ( | int | index, |
int | atom1, | ||
int | atom2, | ||
int | atom3, | ||
int | atom4, | ||
int | atom5, | ||
int | atom6, | ||
int | atom7, | ||
int | atom8, | ||
int | nBins, | ||
std::vector< double > | a0, | ||
std::vector< double > | a1, | ||
std::vector< double > | a2, | ||
std::vector< double > | a3, | ||
std::vector< double > | a4, | ||
std::vector< double > | a5, | ||
std::vector< double > | a6, | ||
std::vector< double > | a7, | ||
std::vector< double > | a8, | ||
std::vector< double > | a9, | ||
std::vector< double > | a10, | ||
std::vector< double > | a11, | ||
std::vector< double > | a12, | ||
std::vector< double > | a13, | ||
std::vector< double > | a14, | ||
std::vector< double > | a15, | ||
float | scaleFactor | ||
) |
Modify an existing torsion profile restraint.
index | the index of the restraint |
atom1 | the first atom |
atom2 | the second atom |
atom3 | the third atom |
atom4 | the fourth atom |
atom5 | the fifth atom |
atom6 | the sixth atom |
atom7 | the seventh atom |
atom8 | the eighth atom |
nBins | the number of bins |
aN | the Nth spline parameter where N is in (0,1,...,14,15) |
scaleFactor | the scale factor |
void updateParametersInContext | ( | OpenMM::Context & | context | ) |
Update the per-restraint 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 modifyDistanceRestaint(), modifyTorsionRestraint(), modifyDistProfileRestraint(), or modifyTorsProfileRestraint() to modify the parameters of a restraint, 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-restraint 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 restraint cannot be changed, nor can new restraints be added.