Remove resonance reconstruction and Cython dependency (#3111)

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Jon Shimwell 2024-08-14 15:34:17 +01:00 committed by GitHub
parent ae245e0fb7
commit 9483cce0bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 33 additions and 669 deletions

View file

@ -708,28 +708,6 @@ class ResonancesWithBackground(EqualityMixin):
self.background = background
self.mt = mt
def __call__(self, x):
# Get background cross section
xs = self.background(x)
for r in self.resonances:
if not isinstance(r, openmc.data.resonance._RESOLVED):
continue
if isinstance(x, Iterable):
# Determine which energies are within resolved resonance range
within = (r.energy_min <= x) & (x <= r.energy_max)
# Get resonance cross sections and add to background
resonant_xs = r.reconstruct(x[within])
xs[within] += resonant_xs[self.mt]
else:
if r.energy_min <= x <= r.energy_max:
resonant_xs = r.reconstruct(x)
xs += resonant_xs[self.mt]
return xs
@property
def background(self):
return self._background