- Demo.find_connected_pores(throats=, flatten=False, mode='or')#
Return a list of pores connected to the given list of throats
throats (array_like) – List of throats numbers
flatten (bool, optional) – If
True(default) a 1D array of unique pore numbers is returned. If
Falseeach location in the the returned array contains a sub-arras of neighboring pores for each input throat, in the order they were sent.
mode (str) –
Specifies logic to filter the resulting list. Options are:
All neighbors of the input pores. Also accepts ‘any’ and ‘union’.
Only neighbors of one and only one input pore. This is useful for counting the pores that are not shared by any of the input pores. Also accepts ‘exclusive_or’.
Neighbors that are shared by two or more input pores. This is equivalent to counting all neighbors with ‘or’, minus those found with ‘xor’, and is useful for finding neighbors that the inputs have in common.
Only neighbors shared by all input pores. Also accepts ‘intersection’ and ‘all’
1D array (if
True) or ndarray of arrays (if
>>> import openpnm as op >>> pn = op.network.Cubic(shape=[5, 5, 5]) >>> Ps = pn.find_connected_pores(throats=[0, 1]) >>> print(Ps) [[0 1] [1 2]] >>> Ps = pn.find_connected_pores(throats=[0, 1], flatten=True) >>> print(Ps) [0 1 2]