当前位置:网站首页>The initial arrangement of particles in SPH (solved by two pictures)
The initial arrangement of particles in SPH (solved by two pictures)
2022-07-04 23:08:00 【beidou111】
Therefore, the corresponding code is ( Change from Tai Chi k-ye Of pbf2d.py)
def init():
init_pos = ti.Vector([0.2,0.3,0.2])
cube_size = 0.4
spacing = 0.02
num_per_row = (int) (cube_size // spacing)
num_per_floor = num_per_row * num_per_row
for i in range(num_particles):
floor = i // (num_per_floor)
row = (i % num_per_floor) // num_per_row
col = (i % num_per_floor) % num_per_row
positions[i] = ti.Vector([row*spacing, floor*spacing, col*spacing]) + init_pos
边栏推荐
- ffmpeg快速剪辑
- Redis getting started complete tutorial: Key Management
- 高通WLAN框架学习(30)-- 支持双STA的组件
- 位运算符讲解
- [Jianzhi offer] 6-10 questions
- Common methods in string class
- Photoshop批量给不同的图片添加不同的编号
- JS 3D explosive fragment image switching JS special effect
- Redis入門完整教程:Pipeline
- Sword finger offer 68 - I. nearest common ancestor of binary search tree
猜你喜欢
On-off and on-off of quality system construction
P2181 对角线和P1030 [NOIP2001 普及组] 求先序排列
Redis: redis message publishing and subscription (understand)
JS 3D explosive fragment image switching JS special effect
Redis入门完整教程:Pipeline
Redis getting started complete tutorial: publish and subscribe
Qt个人学习总结
Redis入门完整教程:Bitmaps
Redis:Redis消息的发布与订阅(了解)
Redis入门完整教程:集合详解
随机推荐
云服务器设置ssh密钥登录
[roommate learned to use Bi report data processing in the time of King glory in one game]
Explanation of bitwise operators
智力考验看成语猜古诗句微信小程序源码
debug和release的区别
Redis入门完整教程:HyperLogLog
Redis:Redis的事务
位运算符讲解
A complete tutorial for getting started with redis: understanding and using APIs
[graph theory] topological sorting
Servlet服务器端和客户端中文输出乱码问题
Redis入门完整教程:有序集合详解
Servlet+JDBC+MySQL简单web练习
VIM editor knowledge summary
Actual combat simulation │ JWT login authentication
Redis: redis message publishing and subscription (understand)
Redis入门完整教程:Pipeline
Set up a website with a sense of ceremony, and post it to 1/2 of the public network through the intranet
mamp下缺少pcntl扩展的解决办法,Fatal error: Call to undefined function pcntl_signal()
数据库基础知识