polaris.e3sm.init.partitions.get_region_graph

polaris.e3sm.init.partitions.get_region_graph(cells_on_cell, n_edges_on_cell, in_region)[source]

The graph of a region’s cells, keeping only the edges between them.

This is the graph MpasCellCuller.x writes for a mesh culled to the region, without culling the mesh: the cells keep their order, and so does each cell’s list of neighbors.

Parameters:
  • cells_on_cell (numpy.ndarray) – The mesh’s one-based cellsOnCell.

  • n_edges_on_cell (numpy.ndarray) – The mesh’s nEdgesOnCell.

  • in_region (numpy.ndarray) – Whether each cell is in the region.

Returns:

  • cells (numpy.ndarray) – The index in the mesh of each cell in the region.

  • xadj (numpy.ndarray) – Where each cell’s neighbors start in adjncy, with one more entry than there are cells.

  • adjncy (numpy.ndarray) – Each cell’s neighbors in the region, by their zero-based index among the region’s cells.