yt.geometry.oct_container module

Oct container

class yt.geometry.oct_container.ARTOctreeContainer

Bases: yt.geometry.oct_container.OctreeContainer

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()
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()
morton_index_octs()
nocts
num_domains
oct_arrays
save_octree()
selector_fill()
class yt.geometry.oct_container.OctObjectPool

Bases: yt.utilities.lib.allocation_container.ObjectPool

append()

This allocates a new batch of n_objs objects, with the container id specified as con_id. Return value is a view on them.

itemsize
to_arrays()
class yt.geometry.oct_container.OctreeContainer

Bases: object

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()
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()
morton_index_octs()
nocts
num_domains
oct_arrays
save_octree()
selector_fill()
class yt.geometry.oct_container.RAMSESOctreeContainer

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()
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()
morton_index_octs()
nocts
num_domains
oct_arrays
save_octree()
selector_fill()
class yt.geometry.oct_container.SparseOctreeContainer

Bases: yt.geometry.oct_container.OctreeContainer

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()
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()
morton_index_octs()
nocts
num_domains
oct_arrays
save_octree()
selector_fill()