meld.system.restraints.COMRestraint
- class meld.system.restraints.COMRestraint(system, scaler, ramp, group1, group2, weights1, weights2, dims, force_const, distance)[source]
 Bases:
NonSelectableRestraintRestraint on the distance between two groups along selected axes
This class implements a restraint on the distance between the center of two groups.
The weights used to calculate the center can be specified as
weights1andweights2. If these areNone, then the masses of the atoms will be used.The
dimsparameter controls which dimensions are used to compute the distance. For example ifdims='xyz', then the distance will be the normal distance in all three dimensions. Ifdims='x', then only the x-component will be considered.Restraints are typically added using
RestraintMangager.create_restraintwith the'com'key:>>> r = system.restraints.create_restraint('com', scaler, ramp=ramp, group1=group1, group2=group2, weights1=weights1, weights2=weights2, dims=dims, force_const=force_const, distance=distance)
- __init__(system, scaler, ramp, group1, group2, weights1, weights2, dims, force_const, distance)[source]
 Initialize a COMRestraint
- Parameters
 system (
ISystem) – the system this restraint belongs toscaler (
Optional[RestraintScaler]) – scale the force with alpharamp (
Optional[TimeRamp]) – scale the force over timegroup1 (
List[AtomIndex]) – atoms in group1group2 (
List[AtomIndex]) – atoms in group2weights1 (
List[float]) – Weights to use when calculating the COM. IfNone, then the atom masses will be used.weights2 (
List[float]) – Weights to use when calculating the COM. IfNone, then the atom masses will be used.dims (
str) – combination of x, y, z that determines which dimensions are used when calculating the distanceforce_const (
Quantity) – force constant in kJ/mol/nm^2distance (
Union[Quantity,Positioner]) – distance between groups
Methods
__init__(system, scaler, ramp, group1, ...)Initialize a COMRestraint