machine-learning-and-simulation icon indicating copy to clipboard operation
machine-learning-and-simulation copied to clipboard

A lid-driven implementation in Taichi

Open houkensjtu opened this issue 1 year ago • 0 comments

Hi @Ceyron,

I watched your amazing video on Youtube and I wrote my own implementation in Taichi language : https://gist.github.com/houkensjtu/dc00a6b8ae3d819b9295d68c55df0a29

Most of the code structures resemble your Numpy version, but I had to declare more data containers (ti.field) in this implementation because managing memory dynamically on a GPU is rather difficult. (for that reason Taichi enforce you to allocate the fields beforehand)

The resulting script runs as well as your Numpy version and can have a pretty decent performance boost if you have a GPU.

Hope you will like it and give it a shot if you're interested (Taichi also has a autodiff system).

houkensjtu avatar Jun 09 '23 02:06 houkensjtu