mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Now track OpenCG lattice names. Now strip hyphens on nuclide names
This commit is contained in:
parent
4edede450e
commit
043c56f338
2 changed files with 11 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
|||
from numbers import Integral
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
from openmc.checkvalue import check_type
|
||||
|
||||
|
|
@ -98,7 +99,14 @@ class Nuclide(object):
|
|||
@name.setter
|
||||
def name(self, name):
|
||||
check_type('name', name, basestring)
|
||||
self._name = name
|
||||
|
||||
if '-' in name:
|
||||
new_name = name.strip('-', '')
|
||||
msg = 'OpenMC nuclide names follow the GND standard. Nuclide ' \
|
||||
'"{}" is being transformed to "{}".'.format(name, new_name)
|
||||
warnings.warn(msg, DeprecationWarning)
|
||||
|
||||
self._name = name.replace('-', '')
|
||||
|
||||
@xs.setter
|
||||
def xs(self, xs):
|
||||
|
|
|
|||
|
|
@ -911,6 +911,7 @@ def get_openmc_lattice(opencg_lattice):
|
|||
if lattice_id in OPENMC_LATTICES:
|
||||
return OPENMC_LATTICES[lattice_id]
|
||||
|
||||
name = opencg_lattice.name
|
||||
dimension = opencg_lattice.dimension
|
||||
width = opencg_lattice.width
|
||||
offset = opencg_lattice.offset
|
||||
|
|
@ -941,7 +942,7 @@ def get_openmc_lattice(opencg_lattice):
|
|||
((np.array(width, dtype=np.float64) *
|
||||
np.array(dimension, dtype=np.float64))) / -2.0
|
||||
|
||||
openmc_lattice = openmc.RectLattice(lattice_id=lattice_id)
|
||||
openmc_lattice = openmc.RectLattice(lattice_id=lattice_id, name=name)
|
||||
openmc_lattice.pitch = width
|
||||
openmc_lattice.universes = universe_array
|
||||
openmc_lattice.lower_left = lower_left
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue