quickpaver.rlg_nn_to_idx#

quickpaver.rlg_nn_to_idx(node_number: int | ndarray[tuple[Any, ...], dtype[int64]] | Sequence[int], nx: int = 1, ny: int = 1, indices_start_at_one: bool = False) Tuple[ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[int64]]][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 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