Cell

class hoomd.md.nlist.Cell(buffer, exclusions=('bond',), rebuild_check_delay=1, check_dist=True, deterministic=False, mesh=None, default_r_cut=0.0)

Bases: NeighborList

Neighbor list computed via a cell list.

Parameters:
  • buffer (float) – Buffer width \([\mathrm{length}]\).

  • exclusions (tuple[str]) – Defines which particles to exclude from the neighbor list, see more details in NeighborList.

  • rebuild_check_delay (int) – How often to attempt to rebuild the neighbor list.

  • check_dist (bool) – Flag to enable / disable distance checking.

  • deterministic (bool) – When True, sort neighbors to help provide deterministic simulation runs.

  • mesh (Mesh) – When a mesh object is passed, the neighbor list uses the mesh to determine the bond exclusions in addition to all other set exclusions.

  • default_r_cut

Cell finds neighboring particles using a fixed width cell list, allowing for O(kN) construction of the neighbor list where k is the number of particles per cell. Cells are sized to the largest \(r_\mathrm{cut}\). This method is very efficient for systems with nearly monodisperse cutoffs, but performance degrades for large cutoff radius asymmetries due to the significantly increased number of particles per cell. In practice, Cell is usually the best option for most users when the asymmetry between the largest and smallest cutoff radius is less than 2:1.

Cell list schematic

Note

Cell may consume a significant amount of memory, especially on GPU devices. One cause of this can be non-uniform density distributions because the memory allocated for the cell list is proportional the maximum number of particles in any cell. Another common cause is large box volumes combined with small cutoffs, which results in a very large number of cells in the system. In these cases, consider using Stencil or Tree, which can use less memory.

Examples:

cell = nlist.Cell()

Members inherited from AutotunedObject:

property kernel_parameters

Kernel parameters. Read more...

property is_tuning_complete

Check if kernel parameter tuning is complete. Read more...

tune_kernel_parameters()

Start tuning kernel parameters. Read more...


Members inherited from NeighborList:

buffer

Buffer width. Read more...

check_dist

Flag to enable / disable distance checking. Read more...

exclusions

Defines which particles to exclude from the neighbor list. Read more...

mesh

Associated mesh data structure. Read more...

rebuild_check_delay

How often to attempt to rebuild the neighbor list. Read more...

r_cut

Base cutoff radius for neighbor list queries. Read more...

property cpu_local_nlist_arrays

Local nlist arrays on the CPU. Read more...

property gpu_local_nlist_arrays

Local nlist arrays on the GPU. Read more...

property local_pair_list

Local pair list. Read more...

property num_builds

The number of neighbor list builds. Read more...

property pair_list

Global pair list. Read more...

property shortest_rebuild

The shortest period between neighbor list rebuilds. Read more...


Members defined in Cell:

deterministic

When True, sort neighbors to help provide deterministic simulation runs.

Type:

bool

property allocated_particles_per_cell

Number of particle slots allocated per cell.

The total memory usage of Cell is proportional to the product of the three cell list dimensions and the allocated_particles_per_cell.

(Loggable: category=”scalar”, default=False)

Type:

int

property dimensions

Cell list dimensions.

dimensions is the number of cells in the x, y, and z directions.

(Loggable: category=”sequence”, default=False)

Type:

tuple[int, int, int]