From 625f60a6e2e9db168938a3db4f910219a650cdb5 Mon Sep 17 00:00:00 2001 From: Jaewook Lee Date: Mon, 6 Nov 2023 13:09:46 +0100 Subject: [PATCH] export mrng before dual --- gustaf/io/mixd.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gustaf/io/mixd.py b/gustaf/io/mixd.py index 64a377d5a..60025d8dc 100644 --- a/gustaf/io/mixd.py +++ b/gustaf/io/mixd.py @@ -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) @@ -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")