Remove step_index in search_for_keff calls

This commit is contained in:
Paul Romano 2026-03-12 11:09:05 -05:00
parent deb9f1d79a
commit 7ac6fcdcc3
2 changed files with 5 additions and 7 deletions

View file

@ -848,10 +848,10 @@ class Integrator(ABC):
return (self.operator.prev_res[-1].time[0],
len(self.operator.prev_res) - 1)
def _apply_keff_search_control(self, step_index, bos_conc):
def _apply_keff_search_control(self, bos_conc):
"""Apply keff search control to beginning-of-step concentrations."""
x = deepcopy(bos_conc)
return self._keff_search_control.search_for_keff(x, step_index)
return self._keff_search_control.search_for_keff(x)
def _restore_keff_search_control(self, res):
"""Restore keff search control from restart results."""
@ -870,7 +870,7 @@ class Integrator(ABC):
if step_index > 0 or self.operator.prev_res is None:
if self._keff_search_control is not None and source_rate != 0.0:
bos_conc, keff_search_root = self._apply_keff_search_control(
step_index, bos_conc)
bos_conc)
else:
keff_search_root = None
bos_conc, res = self._get_bos_data_from_operator(
@ -953,7 +953,7 @@ class Integrator(ABC):
if output and final_step and comm.rank == 0:
print(f"[openmc.deplete] t={t} (final operator evaluation)")
if self._keff_search_control is not None and source_rate != 0.0:
n, keff_search_root = self._apply_keff_search_control(i + 1, n)
n, keff_search_root = self._apply_keff_search_control(n)
else:
keff_search_root = None
res_final = self.operator(n, source_rate if final_step else 0.0)

View file

@ -41,15 +41,13 @@ class _KeffSearchControl:
self.search_kwargs['x_min'] = bracket[0]
self.search_kwargs['x_max'] = bracket[1]
def search_for_keff(self, x, step_index):
def search_for_keff(self, x):
"""Perform keff search and update the atom density vector.
Parameters
----------
x : list of numpy.ndarray
Current atom density vector (atoms per material)
step_index : int
Current depletion step index
Returns
-------