only convert cell sets to int data if there are sets
@@ -297,6 +297,7 @@ class Mesh:
def sets_to_int_data(self):
# If possible, convert cell sets to integer cell data. This is possible if all
# cells appear exactly in one group.
+ if len(self.cell_sets) > 0:
intfun = []
for k, c in enumerate(zip(*self.cell_sets.values())):
# Go for -1 as the default value. (NaN is not int.)
@@ -313,6 +314,7 @@ class Mesh:
# now for the point sets
# Go for -1 as the default value. (NaN is not int.)
+ if len(self.point_sets) > 0:
intfun = np.full(len(self.points), -1, dtype=int)
for i, cc in enumerate(self.point_sets.values()):
intfun[cc] = i
