yt.utilities.amr_kdtree.amr_kdtree.AMRKDTree.locate_neighbors

AMRKDTree.locate_neighbors(grid, ci)[source]

Given a grid and cell index, finds the 26 neighbor grids and cell indices.

Parameters:

grid: Grid Object :

Grid containing the cell of interest

ci: array-like :

The cell index of the cell of interest

Returns:

grids: Numpy array of Grid objects :

cis: List of neighbor cell index tuples :

Both of these are neighbors that, relative to the current cell :

index (i,j,k), are ordered as: :

(i-1, j-1, k-1), (i-1, j-1, k ), (i-1, j-1, k+1), ... :

(i-1, j , k-1), (i-1, j , k ), (i-1, j , k+1), ... :

(i+1, j+1, k-1), (i-1, j-1, k ), (i+1, j+1, k+1) :

That is they start from the lower left and proceed to upper :

right varying the third index most frequently. Note that the :

center cell (i,j,k) is ommitted. :