yt.geometry.particle_oct_container module

Oct container tuned for Particles

class yt.geometry.particle_oct_container.ParticleBitmap

Bases: object

bitmasks
calcsize_bitmasks()
check()
check_bitmasks()
collisions
construct_octree()
count_coarse()

Get the number of coarse cells set for a file.

count_refined()

Get the number of cells refined for a file.

count_total()

Get the total number of cells set for a file.

counts
file_ownership_mask()
filemasks2addfiles()
finalize()
find_collisions()
find_collisions_coarse()
find_collisions_refined()
find_contaminated()
find_uncontaminated()
get_DLE()
get_DRE()
get_bitmasks()
get_ghost_zones()
identify_data_files()
identify_file_masks()
index_order1
index_order2
iseq_bitmask()
load_bitmasks()
mask2filemasks()
mask2files()
mask_to_files()
masks
masks_to_files()
max_count
nfiles
particle_counts
primary_indices()
print_info()
reset_bitmasks()
save_bitmasks()
selector2mask()
update_mi2()

mi2 is the refined morton index order; mi2 is thus the definition of the size of the refined index objects we stick inside any collisions at the coarse level. This takes a characteristic size and attempts to compute the mi2 such that the cell is roughly equivalent to the characteristic size. It will return whether or not it was able to update; if the mi2 has already been used, it does not update. There are cases where the maximum index_order2 that it would compute would be extremely fine, which can do really bad things to memory. So we allow the setting of a maximum value, which it won’t exceed.

class yt.geometry.particle_oct_container.ParticleBitmapOctreeContainer

Bases: yt.geometry.oct_container.SparseOctreeContainer

add()
allocate_domains()
domain_count()
domain_identify()
domain_ind()
domains
fcoords()
file_index_octs()
file_index_octs_with_ghost_zones()

Similar as file_index_octs, but returns the level, cell index, file index and domain of the neighbouring cells as well.

Parameters
  • selector (SelectorObject) – The selector object. It is expected to select all cells for a given oct.

  • domain_id (int) – The domain to select. Set to -1 to select all domains.

  • num_cells (int, optional) – The total number of cells (accounting for a 1-cell thick ghost zone layer).

Returns

  • levels (uint8, shape (num_cells,)) – The level of each cell of the super oct

  • cell_inds (uint8, shape (num_cells, )) – The index of each cell of the super oct within its own oct

  • file_inds (int64, shape (num_cells, )) – The on-file position of the cell. See notes below.

  • domains (int32, shape (num_cells)) – The domain to which the cells belongs. See notes below.

Notes

The algorithm constructs a “super-oct” around each oct (see sketch below, where the original oct cells are marked with an x).

Note that for sparse octrees (such as RAMSES’), the neighbouring cells may belong to another domain (this is stored in domains). If the dataset provides buffer zones between domains (such as RAMSES), this may be stored locally and can be accessed directly.

x

x

x

x

fill_index()

Get the on-file index of each cell

fill_level()
fill_level_with_domain()

Similar to fill_level but accepts a domain argument.

This is particularly useful for frontends that have buffer zones at CPU boundaries. These buffer oct cells have a different domain than the local one and are usually not read, but one has to read them e.g. to compute ghost zones.

fill_octcellindex_neighbours()

Compute the oct and cell indices of all the cells within all selected octs, extended by one cell in all directions (for ghost zones computations).

Parameters
  • selector (SelectorObject) – Selector for the octs to compute neighbour of

  • num_octs (int, optional) – The number of octs to read in

  • domain_id (int, optional) – The domain to perform the selection over

Returns

  • oct_inds (int64 ndarray (nocts*8, )) – The on-domain index of the octs containing each cell

  • cell_inds (uint8 ndarray (nocts*8, )) – The index of the cell in its parent oct

Note

oct_inds/cell_inds

fill_style
finalize()
fwidth()
get_index_base_octs()
icoords()
ires()
load_octree()
locate_positions()

This routine, meant to be called by other internal routines, returns a list of oct IDs and a dictionary of Oct info for all the positions supplied. Positions must be in code_length.

mask()
max_level
morton_index_octs()
n_ref
nocts
num_domains
oct_arrays
overlap_cells
save_octree()
selector_fill()
class yt.geometry.particle_oct_container.ParticleBitmapSelector

Bases: object

fill_masks()
find_files()
class yt.geometry.particle_oct_container.ParticleOctreeContainer

Bases: yt.geometry.oct_container.OctreeContainer

add()
allocate_domains()
allocate_root()
apply_domain()
clear_fileind()
domain_count()
domain_identify()
domain_ind()
domains
fcoords()
file_index_octs()
file_index_octs_with_ghost_zones()

Similar as file_index_octs, but returns the level, cell index, file index and domain of the neighbouring cells as well.

Parameters
  • selector (SelectorObject) – The selector object. It is expected to select all cells for a given oct.

  • domain_id (int) – The domain to select. Set to -1 to select all domains.

  • num_cells (int, optional) – The total number of cells (accounting for a 1-cell thick ghost zone layer).

Returns

  • levels (uint8, shape (num_cells,)) – The level of each cell of the super oct

  • cell_inds (uint8, shape (num_cells, )) – The index of each cell of the super oct within its own oct

  • file_inds (int64, shape (num_cells, )) – The on-file position of the cell. See notes below.

  • domains (int32, shape (num_cells)) – The domain to which the cells belongs. See notes below.

Notes

The algorithm constructs a “super-oct” around each oct (see sketch below, where the original oct cells are marked with an x).

Note that for sparse octrees (such as RAMSES’), the neighbouring cells may belong to another domain (this is stored in domains). If the dataset provides buffer zones between domains (such as RAMSES), this may be stored locally and can be accessed directly.

x

x

x

x

fill_index()

Get the on-file index of each cell

fill_level()
fill_level_with_domain()

Similar to fill_level but accepts a domain argument.

This is particularly useful for frontends that have buffer zones at CPU boundaries. These buffer oct cells have a different domain than the local one and are usually not read, but one has to read them e.g. to compute ghost zones.

fill_octcellindex_neighbours()

Compute the oct and cell indices of all the cells within all selected octs, extended by one cell in all directions (for ghost zones computations).

Parameters
  • selector (SelectorObject) – Selector for the octs to compute neighbour of

  • num_octs (int, optional) – The number of octs to read in

  • domain_id (int, optional) – The domain to perform the selection over

Returns

  • oct_inds (int64 ndarray (nocts*8, )) – The on-domain index of the octs containing each cell

  • cell_inds (uint8 ndarray (nocts*8, )) – The index of the cell in its parent oct

Note

oct_inds/cell_inds

fill_style
finalize()
fwidth()
icoords()
ires()
load_octree()
locate_positions()

This routine, meant to be called by other internal routines, returns a list of oct IDs and a dictionary of Oct info for all the positions supplied. Positions must be in code_length.

mask()
max_level
morton_index_octs()
n_ref
nocts
num_domains
oct_arrays
recursively_count()
save_octree()
selector_fill()