mstk.ommhelper.force.spring_self¶
- mstk.ommhelper.force.spring_self(system, positions, particles, strength)¶
Restrain the selected particles at their original positions.
Note that the original positions will NOT change with box size if there is a barostat.
- Parameters:
system (mm.System) – The OpenMM system to be simulated
positions (array_like) – The positions of all particles in the system in unit of nm
particles (list of int) – The indexes of particles to be restrained
strength (list of float) – The strength of harmonic restraint in x, y and z directions. Three elements should be provided in unit of kJ/mol/nm^2
- Returns:
force
- Return type:
mm.CustomExternalForce