Skip to content

Commit b58629b

Browse files
author
Rusty Holleman
committed
bug fix for wrong cell count
1 parent 0f428fe commit b58629b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

stompy/model/openfoam/mesh_ops.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ def load_mesh_state(case_dir,precision=15):
5252
# At what point do I need to track cells?
5353
# ultimately, it's cells that have data
5454

55-
cell_faces = np.full( (owner.nb_cell,CELL_MAX_FACES), NO_FACE, dtype=np.int32 )
56-
cell_n_faces = np.zeros( owner.nb_cell, np.int32)
55+
n_cells = max(owner.nb_cell, neigh.nb_cell)
56+
cell_faces = np.full( (n_cells, CELL_MAX_FACES), NO_FACE, dtype=np.int32 )
57+
cell_n_faces = np.zeros( n_cells, np.int32)
5758

5859
for fIdx,cIdx in enumerate(neigh.values):
5960
cell_faces[cIdx,cell_n_faces[cIdx]] = ~fIdx # one's complement indicates we're the nbr

0 commit comments

Comments
 (0)