Make mix_materials() inherit "depletable" attribute of involved materials

This commit is contained in:
Yue JIN 2020-09-09 13:36:43 +08:00
parent 4fb66912a9
commit b7a4beff5c

View file

@ -1079,6 +1079,13 @@ class Material(IDManagerMixin):
new_density = np.sum([dens for dens in mass_per_cc.values()])
new_mat.set_density('g/cm3', new_density)
# If any of the involved materials is depletable, the new material is
# depletable
for mat in materials:
if mat.depletable:
new_mat.depletable = True
break
return new_mat
@classmethod