trim

openpnm.topotools.generators.tools.trim(network, vert_ids=None, edge_ids=None)[source]

Remove given pores or throats from a network

Parameters
  • network (dictionary) – A dictionary containing ‘vert.coords’ and ‘edge.conns’, describing the network

  • vert_ids (array_like) – The list of vertcies to trim.

  • edge_ids (array_like) – The list of edges to trim

Returns

network – The network object with the specified vertices/edges removed

Return type

dict

Notes

Only one of vert_ids or edge_ids can be given. To trim both types, call the fuction twice. This function renumbers the 'edge.conns' array when the vertices being pointed to are removed.