当前位置:网站首页>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
边栏推荐
- Wechat official account solves the cache problem of entering from the customized menu
- Redis入门完整教程:HyperLogLog
- The solution to the lack of pcntl extension under MAMP, fatal error: call to undefined function pcntl_ signal()
- Redis入门完整教程:有序集合详解
- Redis introduction complete tutorial: detailed explanation of ordered collection
- Sword finger offer 68 - ii The nearest common ancestor of binary tree
- Redis getting started complete tutorial: Geo
- Summary of wechat applet display style knowledge points
- Sword finger offer 67 Convert a string to an integer
- Redis入门完整教程:API的理解和使用
猜你喜欢

常用技术指标之一文读懂BOLL布林线指标

A complete tutorial for getting started with redis: Pipeline

PS style JS webpage graffiti board plug-in

Redis introduction complete tutorial: List explanation
![[graph theory] topological sorting](/img/2c/238ab5813fb46a3f14d8de465b8999.png)
[graph theory] topological sorting

MariaDB的Galera集群-双主双活安装设置

Complete tutorial for getting started with redis: bitmaps
![P2181 diagonal and p1030 [noip2001 popularization group] arrange in order](/img/79/36c46421bce08284838f68f11cda29.png)
P2181 diagonal and p1030 [noip2001 popularization group] arrange in order

Redis入门完整教程:发布订阅

Docker镜像的缓存特性和Dockerfile
随机推荐
Photoshop batch adds different numbers to different pictures
JS 3D explosive fragment image switching JS special effect
A complete tutorial for getting started with redis: getting to know redis for the first time
Redis introduction complete tutorial: slow query analysis
Record: how to scroll screenshots of web pages on Microsoft edge in win10 system?
A complete tutorial for getting started with redis: hyperloglog
常用技术指标之一文读懂BOLL布林线指标
智力考验看成语猜古诗句微信小程序源码
Redis introduction complete tutorial: Collection details
图片懒加载的原理
Sobel filter
SHP data making 3dfiles white film
P2181 diagonal and p1030 [noip2001 popularization group] arrange in order
The difference between Max and greatest in SQL
Excel 快捷键-随时补充
Attack and defense world misc advanced zone 2017_ Dating_ in_ Singapore
[Lua] Int64 support
How can enterprises cross the digital divide? In cloud native 2.0
Serial port data frame
【剑指offer】1-5题