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.
The use of
kernel.split_particle
is treated as a call by reference in Numba. The current use of the function is always followed bykernel.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.