added error if element added via materials.xml file

This commit is contained in:
Sam Shaner 2016-10-31 12:28:01 -04:00
parent 7a500d6bfb
commit bc2a7c3201
2 changed files with 13 additions and 1 deletions

View file

@ -687,7 +687,7 @@ class Material(object):
allnucs = self._nuclides + self._elements
dist_per_type = allnucs[0][2]
for nuc in allnucs:
if not nuc[2] == dist_per_type:
if nuc[2] != dist_per_type:
msg = 'All nuclides and elements in a distributed ' \
'material must have the same type, either ao or wo'
raise ValueError(msg)

View file

@ -2198,6 +2198,7 @@ contains
type(Node), pointer :: node_sab => null()
type(NodeList), pointer :: node_mat_list => null()
type(NodeList), pointer :: node_nuc_list => null()
type(NodeList), pointer :: node_ele_list => null()
type(NodeList), pointer :: node_macro_list => null()
type(NodeList), pointer :: node_sab_list => null()
@ -2309,6 +2310,17 @@ contains
end select
end if
! Issue error if elements are provided
call get_node_list(node_mat, "element", node_ele_list)
if (get_list_size(node_ele_list) > 0) then
call fatal_error("Unable to add an element to material " &
// trim(to_str(mat % id)) // " since the element option has &
&been removed from the xml input. Elements can only be added via &
&the Python API, which will expand elements into their natural &
&nuclides.")
end if
! =======================================================================
! READ AND PARSE <nuclide> TAGS