forked from bartvdbraak/blender
Fluid: Optimization for smoke simulation (multigrid)
The solver will now automatically detect static scenes (no moving obstacles) and use a slightly faster pressure solve in those cases.
This commit is contained in:
parent
9867a82072
commit
5539b68009
2
extern/mantaflow/preprocessed/gitinfo.h
vendored
2
extern/mantaflow/preprocessed/gitinfo.h
vendored
@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
#define MANTA_GIT_VERSION "commit 1d52e96ad602f1974dfee75bef293bc397e4b41b"
|
#define MANTA_GIT_VERSION "commit 1d55979473c25318f39c4a6bf48a5ab77b3bf39b"
|
||||||
|
@ -1171,6 +1171,11 @@ void solvePressureSystem(Grid<Real> &rhs,
|
|||||||
maxIter = 100;
|
maxIter = 100;
|
||||||
|
|
||||||
pmg = gMapMG[parent];
|
pmg = gMapMG[parent];
|
||||||
|
// Release MG from previous step if present (e.g. if previous solve was with MGStatic)
|
||||||
|
if (pmg && preconditioner == PcMGDynamic) {
|
||||||
|
releaseMG(parent);
|
||||||
|
pmg = nullptr;
|
||||||
|
}
|
||||||
if (!pmg) {
|
if (!pmg) {
|
||||||
pmg = new GridMg(pressure.getSize());
|
pmg = new GridMg(pressure.getSize());
|
||||||
gMapMG[parent] = pmg;
|
gMapMG[parent] = pmg;
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
const std::string smoke_variables =
|
const std::string smoke_variables =
|
||||||
"\n\
|
"\n\
|
||||||
mantaMsg('Smoke variables low')\n\
|
mantaMsg('Smoke variables low')\n\
|
||||||
preconditioner_s$ID$ = PcMGDynamic\n\
|
preconditioner_s$ID$ = PcMGStatic\n\
|
||||||
using_colors_s$ID$ = $USING_COLORS$\n\
|
using_colors_s$ID$ = $USING_COLORS$\n\
|
||||||
using_heat_s$ID$ = $USING_HEAT$\n\
|
using_heat_s$ID$ = $USING_HEAT$\n\
|
||||||
using_fire_s$ID$ = $USING_FIRE$\n\
|
using_fire_s$ID$ = $USING_FIRE$\n\
|
||||||
@ -391,6 +391,8 @@ def smoke_step_$ID$():\n\
|
|||||||
mantaMsg('Walls')\n\
|
mantaMsg('Walls')\n\
|
||||||
setWallBcs(flags=flags_s$ID$, vel=vel_s$ID$, obvel=obvel_s$ID$ if using_obstacle_s$ID$ else None)\n\
|
setWallBcs(flags=flags_s$ID$, vel=vel_s$ID$, obvel=obvel_s$ID$ if using_obstacle_s$ID$ else None)\n\
|
||||||
\n\
|
\n\
|
||||||
|
preconditioner_s$ID$ = PcMGDynamic if using_obstacle_s$ID$ and obvel_s$ID$.getMax() > 0 else PcMGStatic\n\
|
||||||
|
mantaMsg('Using preconditioner: ' + str(preconditioner_s$ID$))\n\
|
||||||
if using_guiding_s$ID$:\n\
|
if using_guiding_s$ID$:\n\
|
||||||
mantaMsg('Guiding and pressure')\n\
|
mantaMsg('Guiding and pressure')\n\
|
||||||
PD_fluid_guiding(vel=vel_s$ID$, velT=velT_s$ID$, flags=flags_s$ID$, weight=weightGuide_s$ID$, blurRadius=beta_sg$ID$, pressure=pressure_s$ID$, tau=tau_sg$ID$, sigma=sigma_sg$ID$, theta=theta_sg$ID$, preconditioner=preconditioner_s$ID$, zeroPressureFixing=not doOpen_s$ID$)\n\
|
PD_fluid_guiding(vel=vel_s$ID$, velT=velT_s$ID$, flags=flags_s$ID$, weight=weightGuide_s$ID$, blurRadius=beta_sg$ID$, pressure=pressure_s$ID$, tau=tau_sg$ID$, sigma=sigma_sg$ID$, theta=theta_sg$ID$, preconditioner=preconditioner_s$ID$, zeroPressureFixing=not doOpen_s$ID$)\n\
|
||||||
|
Loading…
Reference in New Issue
Block a user