mpacts.contact.detectors. multigrid_cd

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

import mpacts.contact.detectors.multigrid_cd
#or assign it to a shorter name
import mpacts.contact.detectors.multigrid_cd as mul

MGrid

class mpacts.contact.detectors.multigrid_cd.MGrid

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Support for MultiGrid, not intended for manual use.
Has no default location.
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, [gate, predicate]
MGrid(name, parent, **kwargs)

MultiGridContactDetector

class mpacts.contact.detectors.multigrid_cd.MultiGridContactDetector

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

MultiGrid Contact detector module. Is not designed to be used independently, but through the MultiGrid python wrapper. In principle it is possible to use it independently but The MGrids and AABB boxes for each pc need to be created in the correct location manually then.
Default location: ‘loop_cmds/contact_cmds’
  • Required keywords:
    • cmodel — The contactmodel that will be executed.
    • keep_distance — A user defined criterium that determines when a contact can be ‘thrown away’, if not given and the contactmodel provides feedback,the smallest gridsize is taken as default value.Note: In order of this to work, also the bounding box generators need to get the same margin parameter set.TODO we could autogenerate the AABB generators, and set this correctly from python.
    • 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.
  • 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!
    • f (default value = 1.1000000000000001) — The maximum allowable ratio of particle sizes within one bin size.
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • h0 (default value = -1) — The size of the largest bin, if not given it is calculated (which is usually best)
object __init__(tuple args, dict kwds) :
args: name, parent kwds: cmodel, update_every, keep_distance, [gate, contact_data_storage_factory, contact_data, h0, f, counter]
MultiGridContactDetector(name, parent, **kwargs)
print_debugging_info((MultiGridContactDetector)arg1, (int)arg2, (int)arg3) → None