pisces.geometry.grids.core.GenericGrid.ones_like#

GenericGrid.ones_like(dtype: dtype | None = None, element_shape=()) ndarray#

Create a one-filled array with the same shape as the grid.

Parameters:
  • dtype (np.dtype, optional) – Desired data type. Defaults to float if not provided.

  • element_shape (tuple, optional) – Extra shape appended to grid shape (e.g., for vector/tensor fields).

Returns:

Array of shape grid.shape + element_shape, filled with ones.

Return type:

np.ndarray