pyrtid.utils.grid.node_number_to_indices#

pyrtid.utils.grid.node_number_to_indices(node_number: Union[int, ndarray[Any, dtype[int64]], Sequence[int]], nx: int = 1, ny: int = 1, indices_start_at_one: bool = False) Tuple[Union[int, ndarray[Any, dtype[int64]], Sequence[int]], Union[int, ndarray[Any, dtype[int64]], Sequence[int]], Union[int, ndarray[Any, dtype[int64]], Sequence[int]]][source]#

Convert a node-number to indices (ix, iy, iz) for a regular grid.

For 1D and 2D, simply leave ny, and nz to their default values.

Note —-node_number_to_indices Node numbering start at zero.

Warning

This applies only for regular grids. It is not suited for vertex.

Parameters
  • nx (int) – Number of grid cells on the x-axis. The default is 1.

  • ny (int, optional) – Number of grid cells on the y-axis. The default is 1.

  • indices_start_at_one (bool, optional) – Whether the indices start at 1. Otherwise, start at 0. The default is False.

Returns

The node number.

Return type

int