subdivide¶
- openpnm.topotools.subdivide(network, pores, shape, labels=[])[source]¶
It trim the pores and replace them by cubic networks with the sent shape.
- Parameters
network (GenericNetwork) –
pores (array_like) – The first group of pores to be replaced
shape (array_like) – The shape of cubic networks in the target locations
Notes
It works only for cubic networks, and a check is performed to ensure this is the case.
Examples
>>> import openpnm as op >>> pn = op.network.Cubic(shape=[5, 6, 5], spacing=0.001) >>> pn.Np 150 >>> nano_pores = [2, 13, 14, 15] >>> op.topotools.subdivide(network=pn, pores=nano_pores, shape=[4, 7, 3], ... labels='nano') >>> pn.Np 482