throats#
- Air.throats(labels='all', mode='or', asmask=False, to_global=False)#
Returns throat locations where given labels exist, according to the logic specified by the
mode
argument.- Parameters
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:
mode
meaning
’or’
Throats with one or more of the given labels are returned. Also accepts ‘union’ and ‘any’.
’and’
Throats with all of the given labels are returned. Also accepts ‘intersection’ and ‘all’.
’xor’
Throats with only one of the given labels are returned. Also accepts ‘exclusive_or’.
’nor’
Throats with none of the given labels are returned. Also accepts ‘not’ and ‘none’.
’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
True
then a boolean array of length Nt is returned withTrue
values 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.
- Returns
A Numpy array containing throat indices filtered by the logic specified
in
mode
.
See also
Examples
>>> 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])