diff --git a/openmc/material.py b/openmc/material.py index 95dae032e70..4ef16ab015a 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -642,7 +642,8 @@ def remove_macroscopic(self, macroscopic: str): def add_element(self, element: str, percent: float, percent_type: str = 'ao', enrichment: Optional[float] = None, enrichment_target: Optional[str] = None, - enrichment_type: Optional[str] = None): + enrichment_type: Optional[str] = None, + cross_sections: Optional[str] = None): """Add a natural element to the material Parameters @@ -669,6 +670,8 @@ def add_element(self, element: str, percent: float, percent_type: str = 'ao', Default is: 'ao' for two-isotope enrichment; 'wo' for U enrichment .. versionadded:: 0.12 + cross_sections : str, optional + Location of cross_sections.xml file. Notes ----- @@ -747,7 +750,8 @@ def add_element(self, element: str, percent: float, percent_type: str = 'ao', percent_type, enrichment, enrichment_target, - enrichment_type): + enrichment_type, + cross_sections): self.add_nuclide(*nuclide) def add_elements_from_formula(self, formula: str, percent_type: str = 'ao', @@ -1457,7 +1461,7 @@ def from_xml_element(cls, elem: ET.Element) -> Material: if "cfg" in elem.attrib: cfg = elem.get("cfg") return Material.from_ncrystal(cfg, material_id=mat_id) - + mat = cls(mat_id) mat.name = elem.get('name')