mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Look for materials.xml in same directory as geometry.xml for from_xml
This commit is contained in:
parent
c5632794de
commit
909c43b1e4
1 changed files with 3 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from collections import OrderedDict, defaultdict
|
||||
from collections.abc import Iterable
|
||||
from copy import deepcopy
|
||||
from pathlib import Path
|
||||
from xml.etree import ElementTree as ET
|
||||
|
||||
import numpy as np
|
||||
|
|
@ -237,7 +238,8 @@ class Geometry(object):
|
|||
|
||||
# Create dictionary to easily look up materials
|
||||
if materials is None:
|
||||
materials = openmc.Materials.from_xml()
|
||||
filename = Path(path).parent / 'materials.xml'
|
||||
materials = openmc.Materials.from_xml(str(filename))
|
||||
mats = {str(m.id): m for m in materials}
|
||||
mats['void'] = None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue