- LiquidByName.throats(labels='all', mode='or', asmask=False, to_global=False)¶
Returns throat locations where given labels exist, according to the logic specified by the
labels (str or list[str]) – The throat label(s) whose locations are requested. If omitted, ‘all’ throat inidices are returned. This argument also accepts ‘*’ for wildcard searches.
mode (str) –
Specifies how the query should be performed. The options are:
’or’, ‘union’, ‘any’ : (default) Throats with one or more of the given labels are returned.
’and’, ‘intersection’, ‘all’ : Throats with all of the given labels are returned.
’xor’, ‘exclusive_or’ : Throats with only one of the given labels are returned.
’nor’, ‘none’, ‘not’ : Throats with none of the given labels are returned.
’nand’ : Throats with not all of the given labels are returned.
’xnor’ : Throats with more than one of the given labels are returned.
asmask (bool) – If
Truethen a boolean array of length Nt is returned with
Truevalues indicating the throats that satisfy the query.
to_global (bool) – If
True, the returned indices will be indexed relative to the full domain. This only has an effect when the calling object is a Subdomain.
A Numpy array containing throat indices filtered by the logic specified
>>> import openpnm as op >>> pn = op.network.Cubic(shape=[3, 3, 3]) >>> Ts = pn.throats() >>> Ts[0:5] # Look at first 5 throat indices array([0, 1, 2, 3, 4])