RMSDForce¶
-
class
OpenMM
::
RMSDForce
¶ This is a force whose energy equals the root mean squared deviation (RMSD) between the current coordinates and a reference structure. It is intended for use with
CustomCVForce
. You will not normally want a force that exactly equals the RMSD, but there are many situations where it is useful to have a restraining or biasing force that depends on the RMSD in some way.The force is computed by first aligning the particle positions to the reference structure, then computing the RMSD between the aligned positions and the reference. The computation can optionally be done based on only a subset of the particles in the system.
Methods
Create an
RMSDForce
.Get the reference positions to compute the deviation from.
Set the reference positions to compute the deviation from.
Get the indices of the particles to use when computing the RMSD.
Set the indices of the particles to use when computing the RMSD.
Update the reference positions and particle indices in a
Context
to match those stored in thisForce
object.Returns whether or not this force makes use of periodic boundary conditions.
-
RMSDForce
(const std::vector<Vec3> &referencePositions, const std::vector<int> &particles = std::vector<int>())¶ Create an
RMSDForce()
.- Parameters
referencePositions – the reference positions to compute the deviation from. The length of this vector must equal the number of particles in the system, even if not all particles are used in computing the RMSD.
particles – the indices of the particles to use when computing the RMSD. If this is empty (the default), all particles in the system will be used.
-
const std::vector<Vec3> &
getReferencePositions
() const¶ Get the reference positions to compute the deviation from.
-
void
setReferencePositions
(const std::vector<Vec3> &positions)¶ Set the reference positions to compute the deviation from.
-
const std::vector<int> &
getParticles
() const¶ Get the indices of the particles to use when computing the RMSD. If this is empty, all particles in the system will be used.
-
void
setParticles
(const std::vector<int> &particles)¶ Set the indices of the particles to use when computing the RMSD. If this is empty, all particles in the system will be used.
-
void
updateParametersInContext
(Context &context)¶ Update the reference positions and particle indices in a
Context
to match those stored in thisForce
object. This method provides an efficient method to update certain parameters in an existingContext
without needing to reinitialize it. Simply callsetReferencePositions()
andsetParticles()
to modify this object’s parameters, then callupdateParametersInContext()
to copy them over to theContext
.
-
bool
usesPeriodicBoundaryConditions
() const¶ Returns whether or not this force makes use of periodic boundary conditions.
- Returns
true if force uses PBC and false otherwise
-