find_connecting_throat#

Cubic.find_connecting_throat(P1, P2)#

Return the throat index connecting pairs of pores.

Parameters:
  • P1 (array_like) – The indices of the pores whose throats are sought. These can be vectors of indices, but must be the same length

  • P2 (array_like) – The indices of the pores whose throats are sought. These can be vectors of indices, but must be the same length

Returns:

Returns a list the same length as P1 (and P2) with the each element containing the throat index that connects the corresponding pores, or None` if pores are not connected.

Return type:

list

Notes

The returned list can be converted to an ndarray, which will convert the None values to nan. These can then be found using numpy.isnan.

Examples

>>> import openpnm as op
>>> pn = op.network.Cubic(shape=[5, 5, 5])
>>> Ts = pn.find_connecting_throat([0, 1, 2], [2, 2, 2])
>>> print(Ts)
[nan  1. nan]