Skip to content

Commit

Permalink
fixing labels in fcc
Browse files Browse the repository at this point in the history
  • Loading branch information
jgostick committed Jun 21, 2023
1 parent 4950d07 commit f02be9d
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions openpnm/network/_fcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,19 @@ def __init__(self, shape, mode='sc', spacing=1, **kwargs):
net = fcc(shape=shape, spacing=spacing,
node_prefix='pore', edge_prefix='throat')
self.update(net)
# Deal with labels
Ts = self.find_neighbor_throats(pores=self.pores('corner'),
mode='xnor')
self['throat.corner_to_corner'] = False
self['throat.corner_to_corner'][Ts] = True
Ts = self.find_neighbor_throats(pores=self.pores('face'))
self['throat.corner_to_face'] = False
self['throat.corner_to_face'][Ts] = True
# Add labels
Ts1 = np.all(self['pore.corner'][self.conns], axis=1)
self['throat.corner_to_corner'] = Ts1
Ts2 = np.all(self['pore.face'][self.conns], axis=1)
self['throat.face_to_face'] = Ts2
self['throat.corner_to_face'] = ~(Ts1 + Ts2)

# Finally scale network to specified spacing
topotools.label_faces(self)
Ps = self.pores(['left', 'right', 'top', 'bottom', 'front', 'back'])
Ps = self.pores(['xmin', 'xmax', 'ymin', 'ymax', 'zmin', 'zmax'])
Ps = self.to_mask(pores=Ps)
self['pore.surface'] = Ps

# Finally scale network to specified spacing
self['pore.coords'] *= np.array(spacing)

def add_boundary_pores(self, labels, spacing):
Expand Down

0 comments on commit f02be9d

Please sign in to comment.