当前位置:网站首页>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
边栏推荐
- Redis introduction complete tutorial: slow query analysis
- QT drawing network topology diagram (connecting database, recursive function, infinite drawing, dragging nodes)
- [graph theory] topological sorting
- 剑指Offer 68 - II. 二叉树的最近公共祖先
- Network namespace
- C语言快速解决反转链表
- [machine learning] handwritten digit recognition
- 企业如何跨越数字化鸿沟?尽在云原生2.0
- 剑指 Offer 67. 把字符串转换成整数
- 智力考验看成语猜古诗句微信小程序源码
猜你喜欢
随机推荐
[Lua] Int64 support
JS 3D explosive fragment image switching JS special effect
【ODX Studio編輯PDX】-0.2-如何對比Compare兩個PDX/ODX文件
P2181 diagonal and p1030 [noip2001 popularization group] arrange in order
On-off and on-off of quality system construction
OSEK标准ISO_17356汇总介绍
位运算符讲解
Attack and defense world misc master advanced zone 001 normal_ png
How to choose a securities company? Is it safe to open an account on your mobile phone
A complete tutorial for getting started with redis: Pipeline
Photoshop批量给不同的图片添加不同的编号
MP进阶操作: 时间操作, sql,querywapper,lambdaQueryWapper(条件构造器)快速筛选 枚举类
Redis入门完整教程:键管理
Basic knowledge of database
Record: how to scroll screenshots of web pages on Microsoft edge in win10 system?
Redis: redis configuration file related configuration and redis persistence
Redis getting started complete tutorial: Geo
PICT 生成正交测试用例教程
Redis入门完整教程:哈希说明
常用技术指标之一文读懂BOLL布林线指标