Skip to content

Commit

Permalink
export mrng before dual
Browse files Browse the repository at this point in the history
  • Loading branch information
j042 committed Nov 6, 2023
1 parent bedb65a commit 625f60a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gustaf/io/mixd.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ def export(
# get boundaries of each element - subelement interface array
sub_interface = make_mrng(mesh)

# write bc first - after writing it, we can modify inplace for dual.
with open(bc_file, "wb") as bf:
for b in sub_interface:
bf.write(struct.pack(big_endian_int, b))

# if dual is True, we fill dual infos.
if dual:
sub_elements = mesh.to_subelements(False)
Expand Down Expand Up @@ -244,11 +249,6 @@ def export(
for d in sub_interface:
df.write(struct.pack(big_endian_int, d))

# write bc - same as dual as dual
with open(bc_file, "wb") as bf:
for b in sub_interface:
bf.write(struct.pack(big_endian_int, b))

# write info
with open(info_file, "w") as infof: # if and inf... just can't
infof.write(f"# dim: {dim}\n")
Expand Down

0 comments on commit 625f60a

Please sign in to comment.