Pair Force¶
- class halmd.mdsim.forces.pair(args)¶
Construct pair force.
- Parameters:
args (table) – keyword arguments
args.particle – instance, or sequence of two instances, of
halmd.mdsim.particle
args.box – instance of
halmd.mdsim.box
args.potential – instance of
halmd.mdsim.potentials
args.neighbour – instance of
halmd.mdsim.neighbour
or a table of keyword arguments (optional)args.weight (number) – weight of the auxiliary variables (default: 1)
args.label (string) – instance label (optional)
The module computes the potential forces excerted by the particles of the second particle instance on those of the first one. The two instances agree if only a single instance is passed. Recomputation is triggered by the signals on_force and on_prepend_force of args.particle[1].
The argument
weight
determines the fraction of the potential energy and the stress tensor that that is added to by the interaction of this force module. A value of 1 is defined as adding the full potential energy and stress tensor of each interaction. This is especially useful when considering pair forces where the particle instances (A and B) are distinct and only AB but not BA interaction is calculated.Note
If two different instances of
halmd.mdsim.particle
are passed, Newton’s 3rd law is not obeyed. To restore such a behaviour, the module must be constructed a second time with the order of particle instances reversed.The argument
neighbour
is only relevant for truncated potentials. See the description of thetruncated pair force
module for details.- potential¶
Instance of
halmd.mdsim.potentials
.
- label¶
Label of force instance.
- disconnect()¶
Disconnect force from profiler.
Warning
Currently this does not disconnect particle sorting, binning and neighbour lists.