mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Alow string shortcut to Material.add_element
This commit is contained in:
parent
d6268831c7
commit
e204952c36
1 changed files with 2 additions and 2 deletions
|
|
@ -387,7 +387,7 @@ class Material(object):
|
|||
|
||||
Parameters
|
||||
----------
|
||||
element : openmc.Element
|
||||
element : openmc.Element or str
|
||||
Element to add
|
||||
percent : float
|
||||
Atom or weight percent
|
||||
|
|
@ -401,7 +401,7 @@ class Material(object):
|
|||
'macroscopic data-set has already been added'.format(self._id)
|
||||
raise ValueError(msg)
|
||||
|
||||
if not isinstance(element, openmc.Element):
|
||||
if not isinstance(element, (openmc.Element, str)):
|
||||
msg = 'Unable to add an Element to Material ID="{0}" with a ' \
|
||||
'non-Element value "{1}"'.format(self._id, element)
|
||||
raise ValueError(msg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue