faces#

A quick way to generate an image with 2 opposing faces set to True, which is used throughout PoreSpy to indicate inlets and outlets

import porespy as ps
import matplotlib.pyplot as plt
import numpy as np
import inspect
/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/openpnm/algorithms/_invasion_percolation.py:358: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
  def _find_trapped_pores(inv_seq, indices, indptr, outlets):  # pragma: no cover

The arguments and default values of the function can be found as follows:

inspect.signature(ps.generators.faces)
<Signature (shape, inlet=None, outlet=None)>

shape#

This would be the same shape as the actual image under study. Let’s say we have an image of blobs:

im = ps.generators.blobs(shape=[10, 10, 10])
faces = ps.generators.faces(shape=im.shape, inlet=0, outlet=0)

ax = plt.figure().add_subplot(projection='3d')
ax.voxels(faces, edgecolor='k', linewidth=0.25);
../../../_images/7060ff180ce75cb4067d961e37fc3a6599fc37206cc26540215faf2d19176247.png

inlet and outlet#

These indicate which axis the True values should be placed, with inlets placed at the start of the axis, and outlets placed at the end:

faces = ps.generators.faces(shape=im.shape, inlet=2, outlet=0)

ax = plt.figure().add_subplot(projection='3d')
ax.voxels(faces, edgecolor='k', linewidth=0.25);
../../../_images/7c40b1b087fcbff5883f54299296f605d816ff11e4784bb541cde872d567acb9.png