# Bin and reduce

This modifier applies a reduction operation to a certain property of all particles within a spatial bin.

The reduction operation can be the sum, the average (mean), or the minimum or maximum value of the property inside the bin.

The spatial bins are aligned parallel to the simulation cell axes.

The bin grid can be one- or two-dimensional.

## Parameters

Property

  The particle property the reduction operation should be applied to.

Reduction operation

  The type of reduction operation to be carried out. Possibilities are sum, mean, min or max. There is an additional option "sum divided by bin volume", which sums first and then divides the result by the volume of the respective bin. This option is intended to compute pressure (or stress) within each bin from the per-atom virial.

Binning direction

  The alignment of the bins. Note that selecting a single cell vector gives a one-dimensional bin grid. Bins are aligned perpendicular to the selected cell vector. Selecting two cell vectors gives a two-dimensional bin grid. Bins are aligned perpendicular to both cell vectors (i.e. parallel to the third vector).

Compute first derivative

  Numerically compute the first derivative of the binned data using a finite differences approximation. This works only for one-dimensional bin grids. (It is useful to e.g. compute the derivative of a velocity profile to get the shear rate.)

Number of spatial bins

  Number of bins in both binning directions.

Use only selected particles

  Restricts the calculation to the subset of particles that are currently selected.

Fix property axis range

  If selected, the plotted property range (or color scale for 2D plots) will be set to the values given in the "From:" and "To:" fields. Otherwise, the minimum and maximum data values will be used to automatically adjust the plotting range.

## Acknowledgment

This modifier has been contributed by Lars Pastewka.