From 0f1b0a2ac6a12e3eff247815b104627747e4f2ac Mon Sep 17 00:00:00 2001 From: shikhark Date: Tue, 23 Jul 2019 21:18:16 +0000 Subject: [PATCH] Get proper indices for zero flux error --- openmc/cmfd.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openmc/cmfd.py b/openmc/cmfd.py index e4976c92c2..b0a4f55b18 100644 --- a/openmc/cmfd.py +++ b/openmc/cmfd.py @@ -1945,9 +1945,10 @@ class CMFDRun(object): np.sum(self._flux_rate, axis=4), 0.0) # Detect zero flux, abort if located and cmfd is on - if np.any(self._flux[is_accel[...,:]] < _TINY_BIT) and self._cmfd_on: + zero_flux = np.logical_and(self._flux < _TINY_BIT, is_accel[...,np.newaxis]) + if np.any(zero_flux) and self._cmfd_on: # Get index of first zero flux in flux array - idx = np.argwhere(self._flux[is_accel[...,:]] < _TINY_BIT)[0] + idx = np.argwhere(zero_flux)[0] # Throw error message (one-based indexing) # Index of group is flipped