mpacts.commands.misc. spatialsorting

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

import mpacts.commands.misc.spatialsorting
#or assign it to a shorter name
import mpacts.commands.misc.spatialsorting as spa


class mpacts.commands.misc.spatialsorting.HilbertCurveSortCommand

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

Computes (and stores) hilbert curve index and sorts the arraymanager (pc) by this index. This can help to increase computational speed because it reduces cache misses.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
    • w — width of the hilbert curve
    • x — positions that will be used to compute hilbert indices
  • 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, w, x, [gate, predicate]
HilbertCurveSortCommand(name, parent, **kwargs)