quickpaver.span_to_node_numbers_3d#

quickpaver.span_to_node_numbers_3d(span: ndarray[tuple[Any, ...], dtype[int64]] | Tuple[slice, slice, slice] | slice, nx: int, ny: int, nz: int) ndarray[tuple[Any, ...], dtype[int64]][source]#

Convert a 3D grid span to flattened node numbers.

The input span is applied to a temporary boolean-like array with shape (nx, ny, nz). All selected cells are converted from 3D grid indices (ix, iy, iz) to flattened regular-grid node numbers using rlg_idx_to_nn().

Parameters:
  • span (Union[NDArrayInt, Tuple[slice, slice, slice], slice]) – NumPy-style selection applied to a 3D array of shape (nx, ny, nz). Examples include slice(None), (slice(0, 2), slice(None), slice(None)), or an integer index array compatible with NumPy indexing.

  • nx (int) – Number of grid cells along the x-axis.

  • ny (int) – Number of grid cells along the y-axis.

  • nz (int) – Number of grid cells along the z-axis.

Returns:

One-dimensional array of flattened node numbers corresponding to the selected cells. The returned array has dtype np.int32.

Return type:

NDArrayInt

Notes

The grid follows the internal (x, y, z) array convention, meaning that the temporary selection array has shape (nx, ny, nz).

The flattened numbering convention is:

node_number = ix + iy * nx + iz * ny * nx

This function operates on grid cells, not on grid vertices.