Truncated Pair Force

class halmd.mdsim.forces.pair_trunc(args)

Construct truncated pair force.

Parameters:

The module computes the truncated 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 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. In this situation, weight needs to be set to 0.5.

If neighbour is left unspecified, a default neighbour list module is constructed using the default parameters of halmd.mdsim.neighbour. If a different value for, e.g., the skin parameter is needed, either the neighbour list module has to be provided explicitly or a keyword table with the non-default arguments is passed, which is forwarded to the default-constructed neighbour list module. For example:

 mdsim.forces.pair({
     box = [...], particle = [...], potential = [...]
   , neighbour = {skin = 0.7}     -- override default skin width
})
potential

Instance of halmd.mdsim.potentials.

disconnect()

Disconnect force from profiler.

Warning

Currently this does not disconnect particle sorting, binning and neighbour lists.

on_prepend_apply(slot)

Connect nullary slot function to signal. The signal is emitted before the force computation.

Returns:signal connection
on_append_apply(slot)

Connect nullary slot function to signal. The signal is emitted after the force computation.

Returns:signal connection