class meld.system.restraints.AbsoluteCOMRestraint(system, scaler, ramp, group, weights, dims, force_const, position)[source]

Bases: meld.system.restraints.NonSelectableRestraint

Restraint on the distance between a group and a point in space

This class implements a restraint on the distance between the center of a group and a point in space.

The weights used to calculate the center can be specified as weights. If None, then the masses of the atoms will be used.

The dims parameter controls which dimensions are used to compute the distance. For example if dims='xyz', then the distance will be the normal distance in all three dimensions. If dims=x, then only the x-component will be considered.

Restraints are typically added using RestraintMangager.create_restraint with the 'abs_com' key:

>>> r = system.restraints.create_restraint('abs_com',
                                           scaler=scaler, ramp=ramp,
__init__(system, scaler, ramp, group, weights, dims, force_const, position)[source]

Initialize an AbsoluteCOMRestraint

  • system (ISystem) – system object used for indexing

  • scaler (Optional[RestraintScaler]) – scale the force with alpha

  • ramp (Optional[TimeRamp]) – scale the force over time

  • group (List[AtomIndex]) – atoms to restrain COM

  • weights (ndarray) – Weights to use when calculating the COM. If None, then the masses will be used.

  • dims (str) – combination of x, y, z that determines which dimensions are used when calculating the distance

  • force_const (Quantity) – force constant in kJ/mol/nm^2

  • point – location in space to restrain to


__init__(system, scaler, ramp, group, ...)

Initialize an AbsoluteCOMRestraint