Here are some ideas on how we can improve the simulation code:
[ ] The poisson generator is kinda slow, it may be worth it to spend some time trying to optimize it.
[ ] Right now if we exit a mesh and we are not supposed to, we generate randomly new motions until the condition is valid. This follows the previous implementation but it is not very optimized. Instead we can make it bounce on the edge but will it still be valid? As every motion follow a specific range, if there is a bounce and the motion is not in the range then, will it make it harder to identify the diffusion coefficient.
[ ] Pretty much the same issue if the particle try to exit a domain and is not supposed to. Should it bounce?
Here are some ideas on how we can improve the simulation code: