Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[example] Add example "laplace equation" #6302

Merged
merged 12 commits into from
Oct 18, 2022
4 changes: 2 additions & 2 deletions python/taichi/examples/simulation/laplace_equation.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def drawArrows(_gui):
else:
arr = arrows.to_numpy()
vel = arr['vel'].reshape(1, -1)[0]
vel = (vel / vel.max() * 0xdd + 0x11) * (ti.abs(fade / fadeMax))
vel = (vel / vel.max() * 0xdd + 0x11) * (abs(fade / fadeMax))
mean = vel.mean()
if mean > 0x7f:
vel /= mean / 0x7f # make uniform stream more beautiful
Expand Down Expand Up @@ -274,7 +274,7 @@ def processGuiEvent(_gui):
else:
dipoles[i].m += 0.001 * int((dipoles[i].m >= 0.0) -
(dipoles[i].m <= 0.0))
fade = -ti.abs(fade) # fade out arrow filed
fade = -abs(fade) # fade out arrow filed
bismarckkk marked this conversation as resolved.
Show resolved Hide resolved


if __name__ == '__main__':
Expand Down