Skip to content

Commit

Permalink
flac indices start at 1
Browse files Browse the repository at this point in the history
  • Loading branch information
nschloe committed Feb 24, 2022
1 parent 7f41c04 commit 7036e59
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/meshio/flac3d/_flac3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,16 @@ def write(filename, mesh: Mesh, float_fmt: str = ".16e", binary: bool = False):

# Translate the material array from meshio.cell_set data to a
# dictionary with labels as keys.
if zsets is not None:
for label, values in zsets.items():
zsets[label] = np.concatenate(values)
if fsets is not None:
for label, values in fsets.items():
fsets[label] = np.concatenate(values)
for label, values in zsets.items():
zsets[label] = np.concatenate(values)
for label, values in fsets.items():
fsets[label] = np.concatenate(values)

# flac3d indices start at 1
for label, values in zsets.items():
zsets[label] += 1
for label, values in fsets.items():
fsets[label] += 1

mode = "wb" if binary else "w"
with open_file(filename, mode) as f:
Expand Down

0 comments on commit 7036e59

Please sign in to comment.