Skip to content

Commit

Permalink
modify mpm128.py to reproduce bug taichi-dev#633
Browse files Browse the repository at this point in the history
  • Loading branch information
archibate committed Mar 27, 2020
1 parent 24bbc4a commit 849a175
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/mpm128.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ def substep():
v[p], C[p] = new_v, new_C
x[p] += dt * v[p] # advection

group_size = n_particles // 3
@ti.kernel
def reset():
group_size = n_particles // 3
for i in range(n_particles):
x[i] = [ti.random() * 0.2 + 0.3 + 0.10 * (i // group_size), ti.random() * 0.2 + 0.05 + 0.32 * (i // group_size)]
material[i] = i // group_size # 0: fluid 1: jelly 2: snow
Expand Down

0 comments on commit 849a175

Please sign in to comment.