Fix T75681: Mantaflow crash when trying to bake a cupcake: The CG solver diverged, residual norm > 1e30

Ensures that there are no enclosed holes between an obstacle and the domain walls.
This commit is contained in:
Sebastián Barschkis 2020-04-15 13:56:47 +02:00
parent d6de81eed6
commit e21fdfc8e4
Notes: blender-bot 2023-02-14 06:00:45 +01:00
Referenced by issue #75681, Mantaflow crash when trying to bake a cupcake: The CG solver diverged, residual norm > 1e30
2 changed files with 4 additions and 4 deletions

View File

@ -173,14 +173,14 @@ def liquid_adaptive_step_$ID$(framenr):\n\
if using_obstacle_s$ID$:\n\
mantaMsg('Initializing obstacle levelset')\n\
phiObsIn_s$ID$.join(phiObsSIn_s$ID$) # Join static obstacle map\n\
phiObsIn_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=2)\n\
phiObsIn_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=1)\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\
phiObs_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=2 if using_fractions_s$ID$ else 1)\n\
extrapolateLsSimple(phi=phiObs_s$ID$, distance=6, inside=True)\n\
extrapolateLsSimple(phi=phiObs_s$ID$, distance=3)\n\
\n\

View File

@ -279,14 +279,14 @@ def smoke_adaptive_step_$ID$(framenr):\n\
if using_obstacle_s$ID$:\n\
mantaMsg('Initializing obstacle levelset')\n\
phiObsIn_s$ID$.join(phiObsSIn_s$ID$) # Join static obstacle map\n\
phiObsIn_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=2)\n\
phiObsIn_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=1)\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\
phiObs_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=1)\n\
extrapolateLsSimple(phi=phiObs_s$ID$, distance=6, inside=True)\n\
extrapolateLsSimple(phi=phiObs_s$ID$, distance=3, inside=False)\n\
\n\