Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
nschloe committed Nov 10, 2015
1 parent d47c04e commit edb2914
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions meshio/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def _read_h5m(filename):
sets_tags = dset['sets']['tags']

cell_start_gid = conn.attrs['start_id']
# cell_gids = cell_start_gid + elems['tags']['GLOBAL_ID'][()]
# cell_end_gid = cell_start_gid + len(cell_gids) - 1
cell_gids = cell_start_gid + elems['tags']['GLOBAL_ID'][()]
cell_end_gid = cell_start_gid + len(cell_gids) - 1
# assert all(cell_gids == range(cell_start_gid, cell_end_gid + 1))

# create the sets
Expand All @@ -223,7 +223,8 @@ def _read_h5m(filename):
lengths = sets_contents[end+1:row[0]+1:2]
for start_gid, length in zip(start_gids, lengths):
end_gid = start_gid + length - 1
if start_gid >= cell_start_gid and end_gid <= cell_end_gid:
if start_gid >= cell_start_gid and \
end_gid <= cell_end_gid:
i0 = start_gid - cell_start_gid
i1 = end_gid - cell_start_gid + 1
field_data[key][i0:i1] = value[k]
Expand Down

0 comments on commit edb2914

Please sign in to comment.