- openpnm.topotools.drop_sites(am, sites)¶
Update adjacency matrix after dropping sites
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
Trueindicating which sites to drop.
am (ndarray) – An updated adjacency matrix with sites and headless bonds removed, and site indices updated accordingly
dropped_bonds (ndarray) – A boolean array with
Truevalues indicating which bonds were rendered headless. This can be used to drop invalid bonds from other arrays (i.e. array = array[~dropped_bonds]).