Create Bins

EDEMpy offers methods for binning objects using the BoxBin and CylinderBin classes.

To create bins:
  1. To import classes, use the following:
    from edempy import BoxBin, CylinderBin

    BoxBin is defined by an origin [x, y, z] and edge lengths.

    CylinderBin is defined by the Start and End points [x, y, z] , and a radius.

  2. To search for any arbitrary list of objects inside a bin, pass two arguments to the getBinnedObjects() function.
    Example
    boxbin = BoxBin([-0.25, 0.0, 0.0], 0.3, 1.0, 0.2)
    ids = deck.timestep[tStep].particle[0].getIds()
    pos = deck.timestep[tStep].particle[0].getPositions()
    binned_ids = boxbin.getBinnedObjects(ids, pos)

    The getBinnedObjects() function also accepts arguments for queryType (‘max’, ‘min’, ‘average’, or ‘total’) and transform where you can specify a 4x4 transformation matrix for translating and rotating the bin. Use this with the getTransformMatrix() function on Geometries to allow the bins to track Geometry motion.

  3. To read binned properties, use the getBinnedProperty() function to collect binned particle, contact, and bond data.
    binnedAveVel, x, y, z =
                      deck.timestep[tstep].particle[0].getBinnedProperty(50, 50, 50,
                                                                            option='velocity’,
                                                                            average=True)

    This returns the binned average velocity for particle type 0, and the x, y, and z positions of the bins. It is useful for displaying EDEM data as a continuum, and plotted using Matplotlib functions such as contour() .

    You can also use it to calculate custom properties, such as the segregation index.

    By default, the bin’s max and min coordinates match the simulation domain, but you can also pass custom limits. The default option returns IDs.