mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Use local variable to avoid attribute lookup in form_rxn_matrix loop (#3884)
Co-authored-by: Perry <yrrepy@users.noreply.github.com> Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
efc542825e
commit
542f949fa0
1 changed files with 7 additions and 3 deletions
|
|
@ -701,15 +701,19 @@ class Chain:
|
|||
if fission_yields is None:
|
||||
fission_yields = self.get_default_fission_yields()
|
||||
|
||||
# Save local variables to avoid attribute lookups in loop
|
||||
index_nuc = rates.index_nuc
|
||||
index_rx = rates.index_rx
|
||||
|
||||
for i, nuc in enumerate(self.nuclides):
|
||||
if nuc.name not in rates.index_nuc:
|
||||
if nuc.name not in index_nuc:
|
||||
continue
|
||||
|
||||
nuc_ind = rates.index_nuc[nuc.name]
|
||||
nuc_ind = index_nuc[nuc.name]
|
||||
nuc_rates = rates[nuc_ind, :]
|
||||
|
||||
for r_type, target, _, br in nuc.reactions:
|
||||
r_id = rates.index_rx[r_type]
|
||||
r_id = index_rx[r_type]
|
||||
path_rate = nuc_rates[r_id]
|
||||
|
||||
# Loss term -- make sure we only count loss once for
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue