yt.utilities.amr_kdtree.amr_kdtree module¶
- class yt.utilities.amr_kdtree.amr_kdtree.AMRKDTree(ds, min_level=None, max_level=None, data_source=None)[source]¶
Bases:
ParallelAnalysisInterface
A KDTree for AMR data.
Not applicable to particle or octree-based datasets.
- comm = None¶
- fields = None¶
- get_dependencies(fields)¶
- 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 omitted.
- locate_neighbors_from_position(position)[source]¶
Given a position, finds the 26 neighbor grids and cell indices.
This is a mostly a wrapper for locate_neighbors.
- Parameters:
position (array-like) – Position 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 omitted.
- log_fields = None¶
- no_ghost = True¶
- partition_index_2d(axis)¶
- partition_index_3d(ds, padding=0.0, rank_ratio=1)¶
- partition_index_3d_bisection_list()¶
Returns an array that is used to drive _partition_index_3d_bisection, below.
- partition_region_3d(left_edge, right_edge, padding=0.0, rank_ratio=1)¶
Given a region, it subdivides it into smaller regions for parallel analysis.