yt.geometry.oct_container module¶
Oct container
- class yt.geometry.oct_container.ARTOctreeContainer¶
Bases:
OctreeContainer
- add(curdom, curlevel, pos, skip_boundary=1, count_boundary=0, levels=None)¶
- allocate_domains(domain_counts)¶
- domain_count(selector)¶
- domain_identify(selector)¶
- domain_ind(selector, domain_id=-1)¶
- domains¶
- fcoords(selector, num_cells=-1, domain_id=-1)¶
- file_index_octs(selector, domain_id, num_cells=-1)¶
- file_index_octs_with_ghost_zones(selector, domain_id, num_cells=1, n_ghost_zones=1)¶
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(selector=<yt.geometry.selection_routines.AlwaysSelector object>)¶
Get the on-file index of each cell
- fill_level(level, levels, cell_inds, file_inds, dest_fields, source_fields, offset=0)¶
- fill_level_with_domain(level, level_inds, cell_inds, file_inds, domain_inds, dest_fields, source_fields, domain, offset=0)¶
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(selector, num_octs=-1, domain_id=-1, n_ghost_zones=1)¶
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(selector, num_cells=-1, domain_id=-1)¶
- icoords(selector, num_cells=-1, domain_id=-1)¶
- ires(selector, num_cells=-1, domain_id=-1)¶
- classmethod load_octree(header)¶
- locate_positions(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(selector, num_cells=-1, domain_id=-1)¶
- max_level¶
- morton_index_octs(selector, domain_id, num_cells=-1)¶
- nocts¶
- num_domains¶
- oct_arrays¶
- save_octree()¶
- selector_fill(selector, source, dest=None, offset=0, dims=1, domain_id=-1)¶
- class yt.geometry.oct_container.OctObjectPool¶
Bases:
ObjectPool
- append(n_objs, con_id=-1)¶
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(curdom, curlevel, pos, skip_boundary=1, count_boundary=0, levels=None)¶
- allocate_domains(domain_counts)¶
- domain_count(selector)¶
- domain_identify(selector)¶
- domain_ind(selector, domain_id=-1)¶
- domains¶
- fcoords(selector, num_cells=-1, domain_id=-1)¶
- file_index_octs(selector, domain_id, num_cells=-1)¶
- file_index_octs_with_ghost_zones(selector, domain_id, num_cells=1, n_ghost_zones=1)¶
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(selector=<yt.geometry.selection_routines.AlwaysSelector object>)¶
Get the on-file index of each cell
- fill_level(level, levels, cell_inds, file_inds, dest_fields, source_fields, offset=0)¶
- fill_level_with_domain(level, level_inds, cell_inds, file_inds, domain_inds, dest_fields, source_fields, domain, offset=0)¶
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(selector, num_octs=-1, domain_id=-1, n_ghost_zones=1)¶
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(selector, num_cells=-1, domain_id=-1)¶
- icoords(selector, num_cells=-1, domain_id=-1)¶
- ires(selector, num_cells=-1, domain_id=-1)¶
- classmethod load_octree(header)¶
- locate_positions(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(selector, num_cells=-1, domain_id=-1)¶
- max_level¶
- morton_index_octs(selector, domain_id, num_cells=-1)¶
- nocts¶
- num_domains¶
- oct_arrays¶
- save_octree()¶
- selector_fill(selector, source, dest=None, offset=0, dims=1, domain_id=-1)¶
- class yt.geometry.oct_container.RAMSESOctreeContainer¶
Bases:
SparseOctreeContainer
- add(curdom, curlevel, pos, skip_boundary=1, count_boundary=0, levels=None)¶
- allocate_domains(domain_counts, root_nodes)¶
- domain_count(selector)¶
- domain_identify(selector)¶
- domain_ind(selector, domain_id=-1)¶
- domains¶
- fcoords(selector, num_cells=-1, domain_id=-1)¶
- file_index_octs(selector, domain_id, num_cells=-1)¶
- file_index_octs_with_ghost_zones(selector, domain_id, num_cells=1, n_ghost_zones=1)¶
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(selector=<yt.geometry.selection_routines.AlwaysSelector object>)¶
Get the on-file index of each cell
- fill_level(level, levels, cell_inds, file_inds, dest_fields, source_fields, offset=0)¶
- fill_level_with_domain(level, level_inds, cell_inds, file_inds, domain_inds, dest_fields, source_fields, domain, offset=0)¶
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(selector, num_octs=-1, domain_id=-1, n_ghost_zones=1)¶
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(selector, num_cells=-1, domain_id=-1)¶
- icoords(selector, num_cells=-1, domain_id=-1)¶
- ires(selector, num_cells=-1, domain_id=-1)¶
- classmethod load_octree(header)¶
- locate_positions(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(selector, num_cells=-1, domain_id=-1)¶
- max_level¶
- morton_index_octs(selector, domain_id, num_cells=-1)¶
- nocts¶
- num_domains¶
- oct_arrays¶
- save_octree()¶
- selector_fill(selector, source, dest=None, offset=0, dims=1, domain_id=-1)¶
- class yt.geometry.oct_container.SparseOctreeContainer¶
Bases:
OctreeContainer
- add(curdom, curlevel, pos, skip_boundary=1, count_boundary=0, levels=None)¶
- allocate_domains(domain_counts, root_nodes)¶
- domain_count(selector)¶
- domain_identify(selector)¶
- domain_ind(selector, domain_id=-1)¶
- domains¶
- fcoords(selector, num_cells=-1, domain_id=-1)¶
- file_index_octs(selector, domain_id, num_cells=-1)¶
- file_index_octs_with_ghost_zones(selector, domain_id, num_cells=1, n_ghost_zones=1)¶
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(selector=<yt.geometry.selection_routines.AlwaysSelector object>)¶
Get the on-file index of each cell
- fill_level(level, levels, cell_inds, file_inds, dest_fields, source_fields, offset=0)¶
- fill_level_with_domain(level, level_inds, cell_inds, file_inds, domain_inds, dest_fields, source_fields, domain, offset=0)¶
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(selector, num_octs=-1, domain_id=-1, n_ghost_zones=1)¶
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(selector, num_cells=-1, domain_id=-1)¶
- icoords(selector, num_cells=-1, domain_id=-1)¶
- ires(selector, num_cells=-1, domain_id=-1)¶
- classmethod load_octree(header)¶
- locate_positions(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(selector, num_cells=-1, domain_id=-1)¶
- max_level¶
- morton_index_octs(selector, domain_id, num_cells=-1)¶
- nocts¶
- num_domains¶
- oct_arrays¶
- save_octree()¶
- selector_fill(selector, source, dest=None, offset=0, dims=1, domain_id=-1)¶