k-wave-python
k-wave-python copied to clipboard
[Enhancement] Improve p0 mutation behavior
I also noticed, that kspaceFirstOrderxD mutates its inputs, which is not the case in the matlab version. Is this your desired behaviour? If you run e.g. the at_array_as_sensor example with pml_inside=False, the source.p0 gets expanded, which leads to a crash in the second kspaceFirstOrder2D. To fix this we could copy some of the inputs at the beginning of kspaceFirstOrderxD.
Originally posted by @faberno in https://github.com/waltsims/k-wave-python/issues/463#issuecomment-2323102024
Copying will result in increased memory usage. I wonder if there is another way?