diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-03-04 19:20:42 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-03-04 20:46:48 +0300 |
commit | b32fd73b244a5c72b46926ffc1d20e3796fc2138 (patch) | |
tree | 28e9a7d679e346a2fd191eadc9f9c4cf52889592 | |
parent | 2a4f35094074929fc29fe9d2c9ae46b96237a557 (diff) |
Fluid: Optimization for extrapolation functions in smoke / liquid scripts
Too much extrapolation can become expensive. Reducing it here since extrapolating levelsets into a couple of cells should be sufficient.
-rw-r--r-- | intern/mantaflow/intern/strings/fluid_script.h | 4 | ||||
-rw-r--r-- | intern/mantaflow/intern/strings/liquid_script.h | 10 | ||||
-rw-r--r-- | intern/mantaflow/intern/strings/smoke_script.h | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/intern/mantaflow/intern/strings/fluid_script.h b/intern/mantaflow/intern/strings/fluid_script.h index 477cf3ff789..6ddf97e7b3f 100644 --- a/intern/mantaflow/intern/strings/fluid_script.h +++ b/intern/mantaflow/intern/strings/fluid_script.h @@ -575,8 +575,8 @@ def bake_guiding_process_$ID$(framenr, format_guiding, path_guiding, resumable): \n\ mantaMsg('Extrapolating guiding velocity')\n\ # ensure velocities inside of guiding object, slightly add guiding vels outside of object too\n\ - extrapolateVec3Simple(vel=guidevelC_s$ID$, phi=phiGuideIn_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\ - extrapolateVec3Simple(vel=guidevelC_s$ID$, phi=phiGuideIn_s$ID$, distance=4, inside=False)\n\ + extrapolateVec3Simple(vel=guidevelC_s$ID$, phi=phiGuideIn_s$ID$, distance=6, inside=True)\n\ + extrapolateVec3Simple(vel=guidevelC_s$ID$, phi=phiGuideIn_s$ID$, distance=3, inside=False)\n\ resampleVec3ToMac(source=guidevelC_s$ID$, target=guidevel_sg$ID$)\n\ \n\ fluid_save_guiding_$ID$(path_guiding, framenr, format_guiding, resumable)\n\ diff --git a/intern/mantaflow/intern/strings/liquid_script.h b/intern/mantaflow/intern/strings/liquid_script.h index 9a494a1cb6a..d885296ec17 100644 --- a/intern/mantaflow/intern/strings/liquid_script.h +++ b/intern/mantaflow/intern/strings/liquid_script.h @@ -165,19 +165,19 @@ def liquid_adaptive_step_$ID$(framenr):\n\ if using_obstacle_s$ID$:\n\ mantaMsg('Initializing obstacle levelset')\n\ phiObsIn_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=2)\n\ - extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\ + extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=6, inside=True)\n\ extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=3, inside=False)\n\ phiObs_s$ID$.join(phiObsIn_s$ID$)\n\ \n\ # Using boundaryWidth=2 to not search beginning from walls (just a performance optimization)\n\ # Additional sanity check: fill holes in phiObs which can result after joining with phiObsIn\n\ phiObs_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=2)\n\ - extrapolateLsSimple(phi=phiObs_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\ - extrapolateLsSimple(phi=phiObs_s$ID$, distance=3, inside=False)\n\ + extrapolateLsSimple(phi=phiObs_s$ID$, distance=6, inside=True)\n\ + extrapolateLsSimple(phi=phiObs_s$ID$, distance=3)\n\ \n\ mantaMsg('Initializing fluid levelset')\n\ - extrapolateLsSimple(phi=phiIn_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\ - extrapolateLsSimple(phi=phiIn_s$ID$, distance=int(res_s$ID$/2), inside=False)\n\ + extrapolateLsSimple(phi=phiIn_s$ID$, distance=6, inside=True)\n\ + extrapolateLsSimple(phi=phiIn_s$ID$, distance=3)\n\ phi_s$ID$.join(phiIn_s$ID$)\n\ \n\ if using_obstacle_s$ID$:\n\ diff --git a/intern/mantaflow/intern/strings/smoke_script.h b/intern/mantaflow/intern/strings/smoke_script.h index 1d90aac3bd0..119f5cd0a88 100644 --- a/intern/mantaflow/intern/strings/smoke_script.h +++ b/intern/mantaflow/intern/strings/smoke_script.h @@ -278,18 +278,18 @@ def smoke_adaptive_step_$ID$(framenr):\n\ if using_obstacle_s$ID$:\n\ mantaMsg('Initializing obstacle levelset')\n\ phiObsIn_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=2)\n\ - extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\ + extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=6, inside=True)\n\ extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=3, inside=False)\n\ phiObs_s$ID$.join(phiObsIn_s$ID$)\n\ \n\ # Using boundaryWidth=2 to not search beginning from walls (just a performance optimization)\n\ # Additional sanity check: fill holes in phiObs which can result after joining with phiObsIn\n\ phiObs_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=2)\n\ - extrapolateLsSimple(phi=phiObs_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\ + extrapolateLsSimple(phi=phiObs_s$ID$, distance=6, inside=True)\n\ extrapolateLsSimple(phi=phiObs_s$ID$, distance=3, inside=False)\n\ \n\ mantaMsg('Initializing fluid levelset')\n\ - extrapolateLsSimple(phi=phiIn_s$ID$, distance=int(res_s$ID$/2), inside=True)\n\ + extrapolateLsSimple(phi=phiIn_s$ID$, distance=6, inside=True)\n\ extrapolateLsSimple(phi=phiIn_s$ID$, distance=3, inside=False)\n\ \n\ if using_outflow_s$ID$:\n\ |