当前位置:网站首页>SPH中的粒子初始排列问题(两张图解决)
SPH中的粒子初始排列问题(两张图解决)
2022-07-04 22:37:00 【beidou111】


因此对应代码为(改自太极k-ye的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 getting started complete tutorial: Key Management
- 剑指Offer 68 - II. 二叉树的最近公共祖先
- A complete tutorial for getting started with redis: redis usage scenarios
- The overview and definition of clusters can be seen at a glance
- LabVIEW中比较两个VI
- Photoshop批量给不同的图片添加不同的编号
- 浅聊一下中间件
- 该如何去选择证券公司,手机上开户安不安全
- 【机器学习】手写数字识别
- A complete tutorial for getting started with redis: redis shell
猜你喜欢

Attack and Defense World MISC Advanced Area Erik baleog and Olaf

Redis入门完整教程:HyperLogLog

Mongodb aggregation operation summary

Google Earth engine (GEE) - globfire daily fire data set based on mcd64a1

Sobel filter
![[graph theory] topological sorting](/img/2c/238ab5813fb46a3f14d8de465b8999.png)
[graph theory] topological sorting

Analysis of the self increasing and self decreasing of C language function parameters

Attack and defense world misc master advanced zone 001 normal_ png

Talk about Middleware

Redis入門完整教程:Pipeline
随机推荐
Qt个人学习总结
Tweenmax emoticon button JS special effect
LabVIEW中比较两个VI
The overview and definition of clusters can be seen at a glance
Notepad++--编辑的技巧
The difference between Max and greatest in SQL
Photoshop批量给不同的图片添加不同的编号
Attack and defense world misc master advanced zone 001 normal_ png
【机器学习】手写数字识别
攻防世界 MISC 进阶区 Erik-Baleog-and-Olaf
VIM editor knowledge summary
Set up a website with a sense of ceremony, and post it to 1/2 of the public network through the intranet
Gnawing down the big bone - sorting (II)
【图论】拓扑排序
[try to hack] wide byte injection
Redis introduction complete tutorial: slow query analysis
Install the gold warehouse database of NPC
Google Earth engine (GEE) -- take modis/006/mcd19a2 as an example to batch download the daily mean, maximum, minimum, standard deviation, statistical analysis of variance and CSV download of daily AOD
Redis入门完整教程:GEO
【室友用一局王者荣耀的时间学会了用BI报表数据处理】