mpacts.contact.detectors. sweepandprune

In order to be able to use this module import it like this:

import mpacts.contact.detectors.sweepandprune
#or assign it to a shorter name
import mpacts.contact.detectors.sweepandprune as swe

SweepAndPruneContactDetector

class mpacts.contact.detectors.sweepandprune.SweepAndPruneContactDetector(name, parent, **kwargs)

Bases: mpacts.contact.detectors.sweepandprune_cd.SweepAndPruneContactDetector

SweepAndPrune Contact detector module (python wrapper).

This contact detector uses the fact that at each time-step, there is only relatively little change in the number of actual contacts. It can (currently) only be used to detect contacts within one particle container, but it is safe and quite efficient to use it without tuning any parameters. Higher efficiency/ increased safety in case of very small particles can be achieved by tuning the ‘update_every’ and the ‘keep_distance’. For ‘mostly 1D or 2D’ systems which are aligned with the global reference frame, it may be beneficial to specify only one or two axis along which to detect contacts. While that is safe in any case, it means that the ‘candidate-contacts’ storage may become unreasonably large for full 3D systems.

Default location: ‘loop_cmds/contact_cmds’
  • Required keywords:
    • cmodel — The contactmodel that will be executed.
  • Optional keywords:
    • axes (default value = xyz) — The axes to be used: “xyz” (default), but you can also specify only one or two of them.
    • contact_data_storage_factory (default value = ContactDataStorageFactory) — The memory manager factory for contact data.
    • contact_data (default value = None) — Contact data itself note: may not always be present and writing to it is usually a bad idea.
    • counter (default value = 0) — Internal counter kept for the update_every. Normally this should NOT be set unless you want to manually force a detection step!
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • keep_distance (default value = 9.9999999999999995e-08) — The margin added to the axis-aligned bounding boxes.
    • update_every (default value = 1) — The frequency used to do sweep-and-prune
SweepAndPruneContactDetector(name, parent, **kwargs)