discretize.tree_mesh.TreeCell.neighbors#

TreeCell.neighbors#

Indices for this cell’s neighbors within its parent tree mesh.

Returns a list containing the indexes for the cell’s neighbors. The ordering of the neighboring cells (i.e. the list) is [-x, +x, -y, +y, -z, +z]. For each entry in the list, there are several cases:

  • ind >= 0: the cell has a single neighbor in this direct and ind denotes its index

  • ind = -1: the neighbour in this direction lies outside the mesh

  • ind = [ind_1, ind_2, …]: When the level changes between cells it shares a boarder with more than 1 cell in this direction (2 if dim==2, 4 if dim==3).

Returns:
list of int or (list of int)

Indices for this cell’s neighbors within its parent tree mesh