imod.prepare.create_partition_labels#

imod.prepare.create_partition_labels(simulation: ISimulation, npartitions: int, weights: DataArray | UgridDataArray | None = None) DataArray | UgridDataArray[source]#

Returns a label array: a 2d array with a similar size to the top layer of idomain. Every array element is the partition number to which the column of gridblocks of idomain at that location belong. This is provided to imod.mf6.Modflow6Simulation.split() to partition the model.

Parameters:
  • simulation (Modflow6Simulation) – The simulation to partition. It must have exactly one flow model.

  • npartitions (int) – The number of partitions to create.

  • weights (xarray.DataArray, xugrid.UgridDataArray, optional) – The weights to use for partitioning. The weights should be a 2d array with the same size as the top layer of idomain. The weights are used to determine the size of each partition. The weights should be positive integers. If not provided, active cells (idomain > 0) are summed across layers and passed on as weights.