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

#or assign it to a shorter name
import as sup


class, parent, **kwargs)

Bases: mpacts.core.command.PythonCommand

Makes all needed contact detectors in the heuristically most efficient way.

Specifically, this “Super contact detector” uses brute-force, sweep-and-prune or multigrid-contact detection, depending on the number/range of pre-calculated axis-aligned bounding boxes (AABBs).


  • name (common part of the) name of the generated CDs as well as this->name()
  • parent should almost always be the simulation object (mysim).
  • cmodels list of contact models
  • margins either one scalar >0., then the same margin is added everywhere, or dictionary with keys corresponding to the full names of the particle containers (as in: pc.path(pc.root_node()) ). If the list of pcs is incomplete, we take the largest margin for all others.
  • keep_distance alias for margins.
  • update_every number of time steps in between full contact detections
  • update_every alias for update_every, for historical reasons ;-).
  • gate by default, ExecuteOnce, but you can re-execute this command, if your particle numbers vary.
SuperContactDetectorAABB(name, parent, **kwargs)

add generators, should be safe to call repeatedly since we check if the name exists...


The overloaded function making the actual contact-detection commands

make_CD(cmodel, aabbprops1, aabbprops2)

Make a single contact detector for a given contact model

heuristic guesses for what’s best - this should be tested and extended!


Set necessary member variables: cmodels_, margins_, update_every_, pcs_, pcnames_