mpacts.contact.detectors. gridbased

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

import mpacts.contact.detectors.gridbased
#or assign it to a shorter name
import mpacts.contact.detectors.gridbased as gri

GridBasedContactDetector

class mpacts.contact.detectors.gridbased.GridBasedContactDetector

Bases: mpacts.contact.detectors.contactdetectorbase.ContactDetectorBase, mpacts.core.baseobject.BaseObject

A grid based contact detector that works with a single grid level. Any object type can be used as long as a position array can be provided for binning in the grid. It is a user responsability to choose the grid size bigger than any particle in the system.
Default location: ‘loop_cmds/contact_cmds’
  • Required keywords:
    • bin_width — The width of a cell. An optimal value is usually about 2 times the largest particle in the system.
    • cmodel — The contactmodel that will be executed.
    • update_every — The frequency used to repeat the binning. If set to one, the binning will be done every timestep, which is safe but slow.
    • x1 — The (position) array that will be used to bin the particles (needs to have the same length as pc1).
    • x2 — The (position) array that will be used to bin the particles (needs to have the same length as pc2).
  • Optional keywords:
    • 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 = -1) — The distance over which contacts are stored, when feedback is used. If not given, the bin_width is used.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: cmodel, x1, x2, bin_width, update_every, [gate, contact_data_storage_factory, contact_data, keep_distance, counter]
GridBasedContactDetector(name, parent, **kwargs)