mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Operator pulls Materials.cross_sections from material file
Closes #1843
This commit is contained in:
parent
ef128f5609
commit
494e2faf88
1 changed files with 9 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ from collections import OrderedDict
|
|||
import os
|
||||
import xml.etree.ElementTree as ET
|
||||
from warnings import warn
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
from uncertainties import ufloat
|
||||
|
|
@ -610,6 +611,14 @@ class Operator(TransportOperator):
|
|||
for mat in materials:
|
||||
mat._nuclides.sort(key=lambda x: nuclides.index(x[0]))
|
||||
|
||||
# Grab the cross sections tag from the existing file
|
||||
mfile = Path("materials.xml")
|
||||
if mfile.exists():
|
||||
tree = ET.parse(str(mfile))
|
||||
xs = tree.find('cross_sections')
|
||||
if xs is not None:
|
||||
materials.cross_sections = xs.text
|
||||
|
||||
materials.export_to_xml()
|
||||
|
||||
def _get_tally_nuclides(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue