CEMeNT-PSAAP / MCDC

MC/DC: Monte Carlo Dynamic Code
https://mcdc.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
23 stars 22 forks source link

`kernel.split_particle` returns by reference in Numba #160

Open ilhamv opened 8 months ago

ilhamv commented 8 months ago

The use of kernel.split_particle is treated as a call by reference in Numba. The current use of the function is always followed by kernel.add_particle, which passes by value to particle banks. However, if we (naively) use it to create intermediate particles for some operations (like in the embedded sensitivity method), this would cause issues. What is interesting is that the function returns by value in Python.

ilhamv commented 2 months ago

I plan to update the embedded sensitivity method soon; when I do that, I'll reference this issue.