taichi-dev / taichi

Productive, portable, and performant GPU programming in Python.
https://taichi-lang.org
Apache License 2.0
25.2k stars 2.26k forks source link

Simulator training examples #1007

Open PavelBlend opened 4 years ago

PavelBlend commented 4 years ago

Concisely describe the proposed feature I would like to have more examples of simulators (liquids, smoke, fire, snow...) using a variety of methods (sph, flip, pic, apic, polyPic, level set, lattice Boltzmann ...).

Describe the solution you'd like (if any) It is advisable to make these examples concise, simple, without unnecessary functions and with detailed comments. So that a person who has never programmed simulations (such as myself) can figure out the code. And it is advisable to provide documentation with a description of the method and a description of the formulas used (for example, as a PDF file, as in this repository https://github.com/rlguy/SPHFluidSim/tree/master/doc).

Additional comments I would like to have these examples for educational purposes. Since in real projects that are not aimed at education, it is difficult to understand the code. In training examples, it is desirable to give meaningful names to variables, for example, to use particle_velocity instead of u. And it is important to keep the code simple, no frills (within 50-200 lines of code). It is possible to make a step structure of examples (from the simplest to the most complex). For example, in example with number 1 show particles that I can’t interact with each other, in example 2 create particles that can only collide, in example 3 add gravity, in example 4 add boundaries and so on. So that the complexity of the simulator examples increases gradually.

yuanming-hu commented 4 years ago

Thanks for proposing this. Actually, I'm hosting an online course (http://games-cn.org/games201/ sorry it's in Chinese but most terms have English translations) and a lot more examples will be added to Taichi so that students can play with them. Most examples are tiny and will be < 200 LoC.

Of course, please feel free to add your own examples if you want.