当前位置:网站首页>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 introduction complete tutorial: Collection details

【机器学习】手写数字识别

Redis getting started complete tutorial: Key Management

A complete tutorial for getting started with redis: Pipeline

攻防世界 MISC 进阶 glance-50

A complete tutorial for getting started with redis: getting to know redis for the first time

Detailed explanation of heap sort code

Set up a website with a sense of ceremony, and post it to 1/2 of the public network through the intranet

Serial port data frame

Persistence mechanism of redis
随机推荐
Redis introduction complete tutorial: List explanation
共创软硬件协同生态:Graphcore IPU与百度飞桨的“联合提交”亮相MLPerf
A complete tutorial for getting started with redis: Pipeline
Analysis of the self increasing and self decreasing of C language function parameters
Redis入门完整教程:Pipeline
剑指 Offer 68 - I. 二叉搜索树的最近公共祖先
Photoshop批量给不同的图片添加不同的编号
On-off and on-off of quality system construction
The small program vant tab component solves the problem of too much text and incomplete display
Sword finger offer 68 - ii The nearest common ancestor of binary tree
Create Ca and issue certificate through go language
攻防世界 MISC 进阶区 hong
该如何去选择证券公司,手机上开户安不安全
Editplus-- usage -- shortcut key / configuration / background color / font size
Principle of lazy loading of pictures
剑指 Offer 65. 不用加减乘除做加法
VIM editor knowledge summary
Summary of index operations in mongodb
Qt个人学习总结
[try to hack] wide byte injection