rogers.neighbors.find_all

rogers.neighbors.find_all(i0, cutoff, in_mesh_pos, celmsh, mesh_idx, shift_grid, cell_shifts, cells, n_mesh_div, valid, periodic, single_count, cap)

Vectorized version of find_neighbors_single. Takes similar arguments as find_neighbors_single but with additional array axes over which find_neighbors_single is mapped.

Original documentation:

Find all neighbors of a given point within a certain radius.

Parameters:
  • i0 (int) – Index of point whose neighbors are to be found

  • cutoff (float) – Cutoff within which to consider points neighbors

  • in_mesh_pos (Float[Array, 'n 3']) – (n,3) In–mesh-cell position of each point

  • celmsh (Float[Array, '3 3']) – (3,3) Mesh cell lattice vectors, one per column

  • mesh_idx (Int[Array, 'n 3']) – (n,3) Home–mesh-cell index of each point

  • shift_grid (Int[Array, '3 2*nnx+1']) – (3,2*nnx+1) Grid of # of shifts to get to each neighboring mesh cell

  • cell_shifts (Float[Array, 'nnm 3']) – (nnm, 3) Vector shift to all neighboring cells

  • cells (Int[Array, 'nm max_count_cap']) – (nm, max_count_cap) Indices of all points in each cell

  • n_mesh_div (tuple[int, int, int]) – Number of mesh divisions in each direction

  • valid (Bool[Array, 'n']) – Which points are real/valid (vs. padding)

  • periodic (bool) – Whether to apply periodic wrapping

  • single_count (bool) – Whether to give a half-list (True) or a full-list

  • cap (int) – Maximum number of neighbors

Returns:

  • (int) number of actual neighbors (vs. padding)

  • (cap,) Indices of neighbors, padded with -1

Return type:

tuple[bool, int, Int[Array, ‘nna’]]