Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/mantaflow/preprocessed/plugin/pressure.cpp')
-rw-r--r--extern/mantaflow/preprocessed/plugin/pressure.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/extern/mantaflow/preprocessed/plugin/pressure.cpp b/extern/mantaflow/preprocessed/plugin/pressure.cpp
index 7def2669e36..780ba44a2b5 100644
--- a/extern/mantaflow/preprocessed/plugin/pressure.cpp
+++ b/extern/mantaflow/preprocessed/plugin/pressure.cpp
@@ -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;