From 849a1759855f9ac2579ea9a86cf4a5f9f3907c61 Mon Sep 17 00:00:00 2001 From: archibate <17721388340@163.com> Date: Sat, 28 Mar 2020 00:09:50 +0800 Subject: [PATCH] modify mpm128.py to reproduce bug #633 --- examples/mpm128.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mpm128.py b/examples/mpm128.py index 0ce4170af3b12..2c4c87e307f11 100644 --- a/examples/mpm128.py +++ b/examples/mpm128.py @@ -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