mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Fix name change on mat_to_ind, nuc_to_ind
This commit is contained in:
parent
89c33923c1
commit
18337073f4
4 changed files with 23 additions and 23 deletions
|
|
@ -334,7 +334,7 @@ class OpenMCOperator(TransportOperator):
|
|||
mat_id = str(mat.id)
|
||||
|
||||
# Get nuclide lists from geometry and depletion results
|
||||
depl_nuc = prev_res[-1].nuc_to_ind
|
||||
depl_nuc = prev_res[-1].index_nuc
|
||||
geom_nuc_densities = mat.get_nuclide_atom_densities()
|
||||
|
||||
# Merge lists of nuclides, with the same order for every calculation
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ class Results(list):
|
|||
# results, and save them to the new depleted xml file.
|
||||
for mat in mat_file:
|
||||
mat_id = str(mat.id)
|
||||
if mat_id in result.mat_to_ind:
|
||||
if mat_id in result.index_mat:
|
||||
mat.volume = result.volume[mat_id]
|
||||
|
||||
# Change density of all nuclides in material to atom/b-cm
|
||||
|
|
@ -447,7 +447,7 @@ class Results(list):
|
|||
|
||||
# For nuclides in chain that have cross sections, replace
|
||||
# density in original material with new density from results
|
||||
for nuc in result.nuc_to_ind:
|
||||
for nuc in result.index_nuc:
|
||||
if nuc not in available_cross_sections:
|
||||
continue
|
||||
atoms = result[0, mat_id, nuc]
|
||||
|
|
|
|||
|
|
@ -161,23 +161,23 @@ def _create_operator(from_nuclides,
|
|||
return op
|
||||
|
||||
def _assert_same_mats(res_ref, res_test):
|
||||
for mat in res_ref[0].mat_to_ind:
|
||||
assert mat in res_test[0].mat_to_ind, \
|
||||
for mat in res_ref[0].index_mat:
|
||||
assert mat in res_test[0].index_mat, \
|
||||
"Material {} not in new results.".format(mat)
|
||||
for nuc in res_ref[0].nuc_to_ind:
|
||||
assert nuc in res_test[0].nuc_to_ind, \
|
||||
for nuc in res_ref[0].index_nuc:
|
||||
assert nuc in res_test[0].index_nuc, \
|
||||
"Nuclide {} not in new results.".format(nuc)
|
||||
|
||||
for mat in res_test[0].mat_to_ind:
|
||||
assert mat in res_ref[0].mat_to_ind, \
|
||||
for mat in res_test[0].index_mat:
|
||||
assert mat in res_ref[0].index_mat, \
|
||||
"Material {} not in old results.".format(mat)
|
||||
for nuc in res_test[0].nuc_to_ind:
|
||||
assert nuc in res_ref[0].nuc_to_ind, \
|
||||
for nuc in res_test[0].index_nuc:
|
||||
assert nuc in res_ref[0].index_nuc, \
|
||||
"Nuclide {} not in old results.".format(nuc)
|
||||
|
||||
def _assert_atoms_equal(res_ref, res_test, tol):
|
||||
for mat in res_test[0].mat_to_ind:
|
||||
for nuc in res_test[0].nuc_to_ind:
|
||||
for mat in res_test[0].index_mat:
|
||||
for nuc in res_test[0].index_nuc:
|
||||
_, y_test = res_test.get_atoms(mat, nuc)
|
||||
_, y_old = res_ref.get_atoms(mat, nuc)
|
||||
|
||||
|
|
|
|||
|
|
@ -81,23 +81,23 @@ def test_full(run_in_tmpdir, problem, multiproc):
|
|||
res_ref = openmc.deplete.Results(path_reference)
|
||||
|
||||
# Assert same mats
|
||||
for mat in res_ref[0].mat_to_ind:
|
||||
assert mat in res_test[0].mat_to_ind, \
|
||||
for mat in res_ref[0].index_mat:
|
||||
assert mat in res_test[0].index_mat, \
|
||||
"Material {} not in new results.".format(mat)
|
||||
for nuc in res_ref[0].nuc_to_ind:
|
||||
assert nuc in res_test[0].nuc_to_ind, \
|
||||
for nuc in res_ref[0].index_nuc:
|
||||
assert nuc in res_test[0].index_nuc, \
|
||||
"Nuclide {} not in new results.".format(nuc)
|
||||
|
||||
for mat in res_test[0].mat_to_ind:
|
||||
assert mat in res_ref[0].mat_to_ind, \
|
||||
for mat in res_test[0].index_mat:
|
||||
assert mat in res_ref[0].index_mat, \
|
||||
"Material {} not in old results.".format(mat)
|
||||
for nuc in res_test[0].nuc_to_ind:
|
||||
assert nuc in res_ref[0].nuc_to_ind, \
|
||||
for nuc in res_test[0].index_nuc:
|
||||
assert nuc in res_ref[0].index_nuc, \
|
||||
"Nuclide {} not in old results.".format(nuc)
|
||||
|
||||
tol = 1.0e-6
|
||||
for mat in res_test[0].mat_to_ind:
|
||||
for nuc in res_test[0].nuc_to_ind:
|
||||
for mat in res_test[0].index_mat:
|
||||
for nuc in res_test[0].index_nuc:
|
||||
_, y_test = res_test.get_atoms(mat, nuc)
|
||||
_, y_old = res_ref.get_atoms(mat, nuc)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue