mountaindust / Planktos

ABM framework for dispersal modeling
https://planktos.readthedocs.io
GNU General Public License v3.0
5 stars 3 forks source link

Memory concerns in time-varying fluid flows #52

Closed mountaindust closed 2 years ago

mountaindust commented 2 years ago

Time varying fluid flow is implemented by creating cubic splines at all fluid mesh points and saving them in memory. These are then consulted for the fluid flow at any time.

There appears to be no reason to keep both the original fluid data and the splines in memory at the same time. Indeed, it would seem rather undesirable from the point of view of memory intensive fluid velocity fields. We should probably replace the original data with a placeholder (e.g. a sparse matrix full of zeros) as the splines are generated.

The problem with fixing this is that there things which may still be consulting the original data... e.g. plotting routines. For time-varying fluid flows, these need to be redirected to get the info from the spline. Also, there should probably be something like a get_flow method available to the user to get info from the spline.