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:
@@ -1171,6 +1171,11 @@ void solvePressureSystem(Grid<Real> &rhs,
|
||||
maxIter = 100;
|
||||
|
||||
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) {
|
||||
pmg = new GridMg(pressure.getSize());
|
||||
gMapMG[parent] = pmg;
|
||||
|
||||
Reference in New Issue
Block a user