remove_isolated_clusters

openpnm.topotools.remove_isolated_clusters(labels, inlets)[source]

Finds cluster labels not attached to the inlets, and sets them to unoccupied (-1)

Parameters
  • labels (tuple of site and bond labels) – This information is provided by the site_percolation or bond_percolation functions

  • inlets (array_like) – A list of which sites are inlets. Can be a boolean mask or an array of indices.

Returns

  • A tuple containing a list of site and bond labels, with all clusters

  • not connected to the inlet sites set to not occupied.