erizmr / taichi_sph Goto Github PK
View Code? Open in Web Editor NEWA Taichi implementation of WCSPH
A Taichi implementation of WCSPH
Please have a look at the following code:
Line 21 in 2e8780f
How to understand m_V
? Is it the mass of particle?
But, the mass should be density * v = density * (pi * (radius**2))
.
Any suggestion is appreciated~~~
Hi Mingrui
Thanks for the work.
When I change the material in the add_cube function in demo.py to 0, it almost works like a black hole and any particle passing through it will vanish. I compared this repo to your previous repo on sph solvers, I couldn't spot the reason, do you know why?
best,
Simon
I am learning this program to finish my taichiCourse01 final project. And I found three confused lines in file 'particle_system.py':
import taichi as ti
ti.init(arch=ti.cpu)
dim = 2
center_cell = ti.Vector.field(2, dtype=ti.i32, shape=2)
center_cell[0] = ti.Vector([0, 1])
center_cell[1] = ti.Vector([2, 2])
@ti.func
def is_valid_cell(cell):
flag = True
for d in ti.static(range(dim)):
flag = flag and (0 <= cell[d] < 3)
return flag
@ti.kernel
def func_test():
for i in range(2):
print(center_cell[i], ';')
for offset in ti.grouped(ti.ndrange(*((-1, 2),) * dim)):
cell = center_cell[i] + offset
print(cell, end=', ')
if not is_valid_cell(cell):
print('kill', end='! ')
continue
print()
func_test()
with an output:
[0, 1] ;
[-1, 0], kill! [-1, 1], kill! [-1, 2], kill! [0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2],
[2, 2] ;
[1, 1], [1, 2], [1, 3], kill! [2, 1], [2, 2], [2, 3], kill! [3, 1], kill! [3, 2], kill! [3, 3], kill!
environment: [Taichi] version 0.8.1, llvm 10.0.0, commit cc2dd342, win, python 3.8.1
File "D:\apps\Python38\lib\site-packages\taichi\lang\impl.py", line 450, in make_constant_expr
raise ValueError(f'Invalid constant scalar expression: {type(val)}')
ValueError: Invalid constant scalar expression: <class 'list'>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.