pynetdesign.modelling.utils.reshape_grid#
- pynetdesign.modelling.utils.reshape_grid(grid_array, nx, ny, nz)[source]#
Reshape a flat grid array into a multidimensional array based on the provided grid vectors.
- Parameters:
- grid_array
numpy.ndarray The flat grid array to reshape. The first dimension should match the total number of grid points.
- nx
numpy.int Number of grid points along the x axis.
- ny
numpy.int Number of grid points along the y axis.
- nz
numpy.int Number of grid points along the z axis.
- grid_array
- Returns:
- reshaped_array
numpy.ndarray The reshaped array with shape (nx, ny, nz, …), where “…” corresponds to the remaining dimensions of the input array.
- reshaped_array
- Raises:
- ValueError
If the number of grid points does not match the product of nx, ny, and nz.