RectPartition¶
- class odl.discr.partition.RectPartition(intv_prod, grid)[source]¶
Bases:
objectRectangular partition by hypercubes based on
RectGrid.In 1d, a partition of an interval is implicitly defined by a collection of points x[0], ..., x[N-1] (a grid) which are chosen to lie in the center of the subintervals. The i-th subinterval is thus given by
I[i] = [(x[i-1]+x[i])/2, (x[i]+x[i+1])/2]- Attributes:
boundary_cell_fractionsReturn a tuple of contained fractions of boundary cells.
byaxisObject to index
selfalong axes.cell_boundary_vecsReturn the cell boundaries as coordinate vectors.
cell_sidesSide lengths of all 'inner' cells of a uniform partition.
cell_sizes_vecsReturn the cell sizes as coordinate vectors.
cell_volumeVolume of the 'inner' cells of a uniform partition.
coord_vectorsCoordinate vectors of the grid.
extentReturn a vector containing the total extent (max - min).
gridRectGriddefining this partition.has_isotropic_cellsTrueifgridis uniform andcell_sidesare all equal.is_uniformTrueifgridis uniform.is_uniform_byaxisBoolean tuple showing uniformity of
self.gridper axis.max_ptMaximum coordinates of the partitioned set.
meshgridReturn the sparse meshgrid of sampling points.
mid_ptMidpoint of the partitioned set.
min_ptMinimum coordinates of the partitioned set.
ndimNumber of dimensions.
nodes_on_bdryEncoding of grid points lying on the boundary.
nodes_on_bdry_byaxisNested tuple of booleans for
nodes_on_bdry.setPartitioned set, an
IntervalProd.shapeNumber of cells per axis, equal to
self.grid.shape.sizeTotal number of cells, equal to
self.grid.size.
Methods
append(*parts)Insert
partsat the end as a block.approx_equals(other, atol)Return
Truein case of approximate equality.index(value[, floating])Return the index of a value in the domain.
insert(index, *parts)Return a copy with
partsinserted beforeindex.max()Return the maximum point of the partitioned set.
min()Return the minimum point of the partitioned set.
points([order])Return the sampling grid points.
squeeze([axis])Return the partition with removed degenerate (length 1) dimensions.
- __init__(intv_prod, grid)[source]¶
Initialize a new instance.
- Parameters:
- intv_prod
IntervalProd Set to be partitioned
- grid
RectGrid Spatial points supporting the partition. They must be contained in
intv_prod.
- intv_prod