From 27f3afefa472567304588edfb6fe18ab8362aa9e Mon Sep 17 00:00:00 2001 From: Skywalker <49872736+cn-skywalker@users.noreply.github.com> Date: Tue, 28 Jan 2025 15:57:27 +0800 Subject: [PATCH] Fix the bug in the Material.from_xml_element function (#3278) Co-authored-by: Paul Romano --- openmc/material.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openmc/material.py b/openmc/material.py index a6401216ad..343b2fff29 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -1582,7 +1582,6 @@ class Material(IDManagerMixin): if 'volume' in elem.attrib: mat.volume = float(elem.get('volume')) - mat.depletable = bool(elem.get('depletable')) # Get each nuclide for nuclide in elem.findall('nuclide'): @@ -1592,6 +1591,9 @@ class Material(IDManagerMixin): elif 'wo' in nuclide.attrib: mat.add_nuclide(name, float(nuclide.attrib['wo']), 'wo') + # Get depletable attribute + mat.depletable = elem.get('depletable') in ('true', '1') + # Get each S(a,b) table for sab in elem.findall('sab'): fraction = float(sab.get('fraction', 1.0))