RMSDForce

class openmm.openmm.RMSDForce(*args)

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.

__init__(self, referencePositions, particles=std::vector< int >())RMSDForce
__init__(self, other)RMSDForce

Create an RMSDForce.

Parameters
  • referencePositions (vector< Vec3 >) – 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 (vector< int >) – 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.

Methods

__init__() -> RMSDForce)

Create an RMSDForce.

getForceGroup(self)

Get the force group this Force belongs to.

getName(self)

Get the name of this Force.

getParticles(self)

Get the indices of the particles to use when computing the RMSD.

getReferencePositions(self)

Get the reference positions to compute the deviation from.

setForceGroup(self, group)

Set the force group this Force belongs to.

setName(self, name)

Set the name of this Force.

setParticles(self, particles)

Set the indices of the particles to use when computing the RMSD.

setReferencePositions(self, positions)

Set the reference positions to compute the deviation from.

updateParametersInContext(self, context)

Update the reference positions and particle indices in a Context to match those stored in this Force object.

usesPeriodicBoundaryConditions(self)

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

Attributes

thisown

The membership flag

property thisown

The membership flag

getReferencePositions(self)std::vector< Vec3,std::allocator< Vec3 > > const &

Get the reference positions to compute the deviation from.

setReferencePositions(self, positions)

Set the reference positions to compute the deviation from.

getParticles(self)vectori

Get the indices of the particles to use when computing the RMSD. If this is empty, all particles in the system will be used.

setParticles(self, 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.

updateParametersInContext(self, context)

Update the reference positions and particle indices 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 setReferencePositions() and setParticles() to modify this object’s parameters, then call updateParametersInContext() to copy them over to the Context.

usesPeriodicBoundaryConditions(self)bool

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

Returns

true if force uses PBC and false otherwise

Return type

bool

__copy__(self)Force
getForceGroup(self)int

Get the force group this Force belongs to.

getName(self)std::string const &

Get the name of this Force. This is an arbitrary, user modifiable identifier. By default it equals the class name, but you can change it to anything useful.

setForceGroup(self, group)

Set the force group this Force belongs to.

Parameters

group (int) – the group index. Legal values are between 0 and 31 (inclusive).

setName(self, name)

Set the name of this Force. This is an arbitrary, user modifiable identifier. By default it equals the class name, but you can change it to anything useful.