mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-21 14:35:27 -04:00
added volume read and write to xml
This commit is contained in:
parent
7d6bdd1eef
commit
e64fb4cd41
1 changed files with 6 additions and 0 deletions
|
|
@ -634,6 +634,9 @@ class Cell(IDManagerMixin):
|
|||
if self.rotation is not None:
|
||||
element.set("rotation", ' '.join(map(str, self.rotation.ravel())))
|
||||
|
||||
if self.volume is not None:
|
||||
element.set("volume", str(self.volume))
|
||||
|
||||
return element
|
||||
|
||||
@classmethod
|
||||
|
|
@ -687,6 +690,9 @@ class Cell(IDManagerMixin):
|
|||
c.temperature = [float(t_i) for t_i in t.split()]
|
||||
else:
|
||||
c.temperature = float(t)
|
||||
v = get_text(elem, 'volume')
|
||||
if v is not None:
|
||||
c.volume = float(v)
|
||||
for key in ('temperature', 'rotation', 'translation'):
|
||||
value = get_text(elem, key)
|
||||
if value is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue