From 11b3a1fe7be3f64578480f8e794f4dd99f614072 Mon Sep 17 00:00:00 2001 From: Shikhar Kumar Date: Tue, 23 Jul 2019 11:27:22 -0400 Subject: [PATCH] Fix digitize bug --- openmc/cmfd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/cmfd.py b/openmc/cmfd.py index ac425d2832..0a18dffdfb 100644 --- a/openmc/cmfd.py +++ b/openmc/cmfd.py @@ -1490,7 +1490,7 @@ class CMFDRun(object): energy_bins[idx] = 0 idx = np.where((source_energies >= energy[0]) & (source_energies <= energy[-1])) - energy_bins[idx] = ng - np.digitize(source_energies, energy) + energy_bins[idx] = ng - np.digitize(source_energies[idx], energy) # Determine weight factor of each particle based on its mesh index # and energy bin and updates its weight @@ -1547,7 +1547,7 @@ class CMFDRun(object): energy_bins[idx] = ng - 1 idx = np.where((source_energies >= energy[0]) & (source_energies <= energy[-1])) - energy_bins[idx] = np.digitize(source_energies, energy) - 1 + energy_bins[idx] = np.digitize(source_energies[idx], energy) - 1 # Determine all unique combinations of mesh bin and energy bin, and # count number of particles that belong to these combinations