drop_sites

openpnm.topotools.drop_sites(am, sites)[source]

Update adjacency matrix after dropping sites

Parameters
  • am (scipy.sparse matrix) – The adjacency matrix of the network in COO format.

  • sites (array_like) – A list of which sites to drop. Can either be integer indices or a boolean mask with True indicating which sites to drop.

Returns

  • am (ndarray) – An updated adjacency matrix with sites and headless bonds removed, and site indices updated accordingly

  • dropped_bonds (ndarray) – A boolean array with True values indicating which bonds were rendered headless. This can be used to drop invalid bonds from other arrays (i.e. array = array[~dropped_bonds]).