Define cmfd_src on all procs

This commit is contained in:
Shikhar Kumar 2021-02-09 13:47:04 -05:00
parent 34275f4c72
commit ee077b4d61
2 changed files with 7 additions and 3 deletions

View file

@ -1090,6 +1090,12 @@ class CMFDRun:
# Initialize parameters for CMFD tally windows
self._set_tally_window()
# Extract spatial and energy indices
nx, ny, nz, ng = self._indices
# Initialize CMFD source to all ones
self._cmfd_src = np.ones((nx, ny, nz, ng))
# Define all variables that will exist only on master process
if openmc.lib.master():
# Set global albedo
@ -1101,9 +1107,6 @@ class CMFDRun:
# Set up CMFD coremap
self._set_coremap()
# Extract spatial and energy indices
nx, ny, nz, ng = self._indices
# Allocate parameters that need to be stored for tally window
self._openmc_src_rate = np.zeros((nx, ny, nz, ng, 0))
self._flux_rate = np.zeros((nx, ny, nz, ng, 0))

View file

@ -3,6 +3,7 @@ from ctypes import (c_int, c_int32, c_char_p, c_double, POINTER,
create_string_buffer)
from weakref import WeakValueDictionary
import numpy as np
from numpy.ctypeslib import as_array
from ..exceptions import AllocationError, InvalidIDError