use pop will modify original mesh, just ignore tags
@@ -271,18 +271,14 @@ def write(filename, mesh, add_global_ids=True):
except AttributeError:
pass
- # Ignore point_tags and cell_tags that are already
- # written under FAS
- mesh.point_data.pop("point_tags", None)
- for cell_type in mesh.cell_data:
- mesh.cell_data[cell_type].pop("cell_tags", None)
-
# Write nodal/cell data
if mesh.point_data or mesh.cell_data:
cha = f.create_group("CHA")
# Nodal data
for name, data in mesh.point_data.items():
+ if name == "point_tags": # ignore point_tags already written under FAS
+ continue
supp = "NOEU" # nodal data
_write_data(cha, mesh_name, pfl, name, supp, data)
@@ -291,6 +287,8 @@ def write(filename, mesh, add_global_ids=True):
# Or ELNO (DG) fields defined at every node per cell
for cell_type, d in mesh.cell_data.items():
for name, data in d.items():
+ if name == "cell_tags": # ignore cell_tags already written under FAS
+ continue
# Determine the nature of the cell data
# Either data.shape = (nbr, ) or (nbr, nco) -> ELEM
