4.1.2.4 pde.backends.numba.grids module
Compiled functions for dealing with grids.
Return numba type corresponding to a particular grid. |
|
Return a compiled function returning the volume of a grid cell. |
|
Factory for obtaining interpolation information. |
|
Return a compiled function for linear interpolation on the grid. |
- make_cell_volume_getter(grid, *, flat_index=False, backend=None)[source]
Return a compiled function returning the volume of a grid cell.
- Parameters:
grid (
GridBase) – Grid for which the function is definedflat_index (bool) – When True, cell_volumes are indexed by a single integer into the flattened array.
backend (
NumbaBackend) – References to the backend to read configuration details
- Returns:
returning the volume of the chosen cell
- Return type:
function
- make_interpolation_axis_data(grid, axis, *, with_ghost_cells=False, cell_coords=False)[source]
Factory for obtaining interpolation information.
- Parameters:
grid (
GridBase) – Grid for which the interpolator is definedaxis (int) – The axis along which interpolation is performed
with_ghost_cells (bool) – Flag indicating that the interpolator should work on the full data array that includes values for the ghost points. If this is the case, the boundaries are not checked and the coordinates are used as is.
cell_coords (bool) – Flag indicating whether points are given in cell coordinates or actual point coordinates.
- Returns:
A function that is called with a coordinate value for the axis. The function returns the indices of the neighboring support points as well as the associated weights.
- Return type:
callable
- make_single_interpolator(grid, *, fill=None, with_ghost_cells=False, cell_coords=False, backend=None)[source]
Return a compiled function for linear interpolation on the grid.
- Parameters:
grid (
GridBase) – Grid for which the interpolator is definedfill (Number, optional) – Determines how values out of bounds are handled. If None, ValueError is raised when out-of-bounds points are requested. Otherwise, the given value is returned.
with_ghost_cells (bool) – Flag indicating that the interpolator should work on the full data array that includes values for the ghost points. If this is the case, the boundaries are not checked and the coordinates are used as is.
cell_coords (bool) – Flag indicating whether points are given in cell coordinates or actual point coordinates.
backend (
NumbaBackend) – References to the backend to read configuration details
- Returns:
A function which returns interpolated values when called with arbitrary positions within the space of the grid. The signature of this function is (data, point), where data is the numpy array containing the field data and position denotes the position in grid coordinates.
- Return type:
callable