You are viewing the course site for a past offering of this course. The current offering may be found here.
Lecture 20: Fluid Simulation (7)
AlexSchedel

In lecture there was a lot of emphasis placed on how this datastructure can get tricky when it comes to indexing. I assume a solution to this would just to have a normal grid and then store a stuct inside each entry that has all the values, that way there is no problem with indexing. Is there a reason we don't do this? I assume it might be a bit slower given the extra structures, but is it so much slower that it really wouldn't be worth it?

alvin-xu-5745

The reason we do not store the fluid state throughout the grid is not necessarily because of an "indexing" issue, but more that in our aim of trying to calculate gradients and other "difference" quantities it is better to use this "staggered" approach in order to not run into strange checkerboard "decoupled" calculations that result from just directly storing the value of these quantities in the middle of our cells.

You must be enrolled in the course to comment