Spaces:
Sleeping
Sleeping
Scaling preset velocity fields to be between -1 and 1, instead of -0.33 and 0.33
Browse files- qlbm_embedded.py +5 -5
qlbm_embedded.py
CHANGED
|
@@ -317,11 +317,11 @@ def set_velocity_preset(preset_name):
|
|
| 317 |
if _state is None:
|
| 318 |
return
|
| 319 |
mapping = {
|
| 320 |
-
"Uniform": ("0.
|
| 321 |
-
"Swirl": ("
|
| 322 |
-
"Shear": ("abs(z-0.5)*1
|
| 323 |
-
"TGV": ("0.
|
| 324 |
-
|
| 325 |
vx, vy, vz = mapping.get(preset_name, mapping["Uniform"])
|
| 326 |
_state.qlbm_advecting_field = preset_name
|
| 327 |
_state.qlbm_vx_expr = vx
|
|
|
|
| 317 |
if _state is None:
|
| 318 |
return
|
| 319 |
mapping = {
|
| 320 |
+
"Uniform": ("0.6", "-0.5", "1"),
|
| 321 |
+
"Swirl": ("sin(-2*pi*z)", "1", "sin(2*pi*x)"),
|
| 322 |
+
"Shear": ("abs(z-0.5)*4-1", "0", "0"),
|
| 323 |
+
"TGV": ("0.5*cos(2*pi*x)*sin(2*pi*y)*sin(2*pi*z)", "-*sin(2*pi*x)*cos(2*pi*y)*sin(2*pi*z)", "0.5*sin(2*pi*x)*sin(2*pi*y)*cos(2*pi*z)"),
|
| 324 |
+
}
|
| 325 |
vx, vy, vz = mapping.get(preset_name, mapping["Uniform"])
|
| 326 |
_state.qlbm_advecting_field = preset_name
|
| 327 |
_state.qlbm_vx_expr = vx
|