mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Move distrib (mat, temp, dens) from XML attribute to subelement for better compatibility with very large instance lists (#3774)
This commit is contained in:
parent
14acc762bc
commit
a632429267
6 changed files with 33 additions and 13 deletions
|
|
@ -636,8 +636,11 @@ class Cell(IDManagerMixin):
|
|||
element.set("material", str(self.fill.id))
|
||||
|
||||
elif self.fill_type == 'distribmat':
|
||||
element.set("material", ' '.join(['void' if m is None else str(m.id)
|
||||
for m in self.fill]))
|
||||
material_subelement= ET.SubElement(element, "material")
|
||||
matlist_str = " ".join(
|
||||
["void" if m is None else str(m.id) for m in self.fill]
|
||||
)
|
||||
material_subelement.text = matlist_str
|
||||
|
||||
elif self.fill_type in ('universe', 'lattice'):
|
||||
element.set("fill", str(self.fill.id))
|
||||
|
|
@ -677,14 +680,15 @@ class Cell(IDManagerMixin):
|
|||
|
||||
if self.temperature is not None:
|
||||
if isinstance(self.temperature, Iterable):
|
||||
element.set("temperature", ' '.join(
|
||||
str(t) for t in self.temperature))
|
||||
temperature_subelement= ET.SubElement(element, "temperature")
|
||||
temperature_subelement.text = ' '.join(str(t) for t in self.temperature)
|
||||
else:
|
||||
element.set("temperature", str(self.temperature))
|
||||
|
||||
if self.density is not None:
|
||||
if isinstance(self.density, Iterable):
|
||||
element.set("density", ' '.join(str(t) for t in self.density))
|
||||
density_subelement= ET.SubElement(element, "density")
|
||||
density_subelement.text = ' '.join(str(d) for d in self.density)
|
||||
else:
|
||||
element.set("density", str(self.density))
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@
|
|||
</materials>
|
||||
<geometry>
|
||||
<cell id="1" material="1" universe="1"/>
|
||||
<cell id="11" material="2 void 3 2" region="-1" universe="11"/>
|
||||
<cell id="11" region="-1" universe="11">
|
||||
<material>2 void 3 2</material>
|
||||
</cell>
|
||||
<cell id="12" material="1" region="1" universe="11"/>
|
||||
<cell id="101" fill="101" region="2 -3 4 -5" universe="0"/>
|
||||
<lattice id="101">
|
||||
|
|
|
|||
|
|
@ -47,8 +47,12 @@
|
|||
</material>
|
||||
</materials>
|
||||
<geometry>
|
||||
<cell id="8" material="1 2 3 4" region="-6" universe="8"/>
|
||||
<cell id="9" material="5 6 7 8" region="6" universe="8"/>
|
||||
<cell id="8" region="-6" universe="8">
|
||||
<material>1 2 3 4</material>
|
||||
</cell>
|
||||
<cell id="9" region="6" universe="8">
|
||||
<material>5 6 7 8</material>
|
||||
</cell>
|
||||
<cell id="10" fill="9" region="7 -8 10 -12" universe="13"/>
|
||||
<cell id="11" fill="10" region="7 -8 12 -16" universe="13"/>
|
||||
<cell id="12" fill="11" region="8 -22 10 -12" universe="13"/>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@
|
|||
</material>
|
||||
</materials>
|
||||
<geometry>
|
||||
<cell id="1" material="1" region="-1" density="10.0 20.0 10.0 20.0" universe="1"/>
|
||||
<cell id="1" material="1" region="-1" universe="1">
|
||||
<density>10.0 20.0 10.0 20.0</density>
|
||||
</cell>
|
||||
<cell id="2" material="2" region="1" universe="1"/>
|
||||
<cell id="3" fill="2" region="2 -3 4 -5" universe="3"/>
|
||||
<lattice id="2">
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@
|
|||
</materials>
|
||||
<geometry>
|
||||
<cell id="1" material="1" universe="1"/>
|
||||
<cell id="11" material="2" region="-1" temperature="500 700 0 800" universe="11"/>
|
||||
<cell id="11" material="2" region="-1" universe="11">
|
||||
<temperature>500 700 0 800</temperature>
|
||||
</cell>
|
||||
<cell id="12" material="1" region="1" universe="11"/>
|
||||
<cell id="101" fill="101" region="2 -3 4 -5" universe="0"/>
|
||||
<lattice id="101">
|
||||
|
|
|
|||
|
|
@ -12,9 +12,15 @@
|
|||
</material>
|
||||
</materials>
|
||||
<geometry>
|
||||
<cell id="1" name="fuel inner a" material="1" region="-2" density="2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0" universe="1"/>
|
||||
<cell id="2" name="fuel inner b" material="1" region="2 -3" density="2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0" universe="1"/>
|
||||
<cell id="3" name="fuel inner c" material="1" region="3 -1" density="2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0" universe="1"/>
|
||||
<cell id="1" name="fuel inner a" material="1" region="-2" universe="1">
|
||||
<density>2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0</density>
|
||||
</cell>
|
||||
<cell id="2" name="fuel inner b" material="1" region="2 -3" universe="1">
|
||||
<density>2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0</density>
|
||||
</cell>
|
||||
<cell id="3" name="fuel inner c" material="1" region="3 -1" universe="1">
|
||||
<density>2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0</density>
|
||||
</cell>
|
||||
<cell id="4" name="moderator inner a" material="2" region="1 -4" universe="1"/>
|
||||
<cell id="5" name="moderator outer b" material="2" region="4 -5" universe="1"/>
|
||||
<cell id="6" name="moderator outer c" material="2" region="5" universe="1"/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue