You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In taichi MPM official examples, the quadratic interpolation weight should be non-negative. But a zero position particle will get a negative result. A possible reason is that base = ti.cast(Xp - 0.5, ti.i32) will get 0, causing fx = Xp - base =0 and making 0.75 - (fx - 1)**2<0.
This bug will not cause error in MPM simulation because there is a separate discussion of the edge case later. But if we run the p2g separately, it will produce the bug. This bug may cause troubles for those who copy the official examples and making it as reference. Therefore it is worthwhile to fix this bug.
To Reproduce
Please post a minimal sample code to reproduce the bug.
The developer team will put a higher priority on bugs that can be reproduced within 20 lines of code. If you want a prompt reply, please keep the sample code short and representative.
Describe the bug
In taichi MPM official examples, the quadratic interpolation weight should be non-negative. But a zero position particle will get a negative result. A possible reason is that
base = ti.cast(Xp - 0.5, ti.i32)
will get 0, causingfx = Xp - base =0
and making0.75 - (fx - 1)**2<0
.This bug will not cause error in MPM simulation because there is a separate discussion of the edge case later. But if we run the p2g separately, it will produce the bug. This bug may cause troubles for those who copy the official examples and making it as reference. Therefore it is worthwhile to fix this bug.
To Reproduce
Please post a minimal sample code to reproduce the bug.
The developer team will put a higher priority on bugs that can be reproduced within 20 lines of code. If you want a prompt reply, please keep the sample code short and representative.
Log/Screenshots
Possible solution
change to
base = ti.cast(ti.floor(Xp - 0.5), ti.i32)
The text was updated successfully, but these errors were encountered: