meld.system.restraints.AbsoluteCOMRestraint
- class meld.system.restraints.AbsoluteCOMRestraint(system, scaler, ramp, group, weights, dims, force_const, position)[source]
Bases:
NonSelectableRestraintRestraint 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. IfNone, 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'abs_com'key:>>> r = system.restraints.create_restraint('abs_com', scaler=scaler, ramp=ramp, group=group, weights=weights, dims=dims, force_const=force_const, position=position)
- __init__(system, scaler, ramp, group, weights, dims, force_const, position)[source]
Initialize an AbsoluteCOMRestraint
- Parameters
system (
ISystem) – system object used for indexingscaler (
Optional[RestraintScaler]) – scale the force with alpharamp (
Optional[TimeRamp]) – scale the force over timegroup (
List[AtomIndex]) – atoms to restrain COMweights (
ndarray) – Weights to use when calculating the COM. IfNone, then the 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^2point – location in space to restrain to
Methods
__init__(system, scaler, ramp, group, ...)Initialize an AbsoluteCOMRestraint