openpnm.topotools.generators.bcc(shape, spacing=1, mode='kdtree')[source]

Generate a body-centered cubic lattice

  • shape (array_like) – The number of unit cells in each direction. A unit cell has vertices on all 8 corners and a single pore at its center.

  • spacing (array_like or float) – The size of a unit cell in each direction. If an scalar is given it is applied in all 3 directions.

  • mode (str) –

    Dictate how neighbors are found. Options are:


    Uses scipy.spatial.KDTree to find all neighbors within the unit cell.


    Uses scipy.spatial.Delaunay to find all neighbors.


network – A dictionary containing ‘vert.coords’ and ‘edge.conns’

Return type



It is not clear whether KDTree of Delaunay are faster. In fact it is surely possible to find the neighbors formulaically but this is not implemented yet.