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
path: root/extern
diff options
context:
space:
mode:
authorSebastián Barschkis <sebbas@sebbas.org>2020-12-06 23:56:43 +0300
committerSebastián Barschkis <sebbas@sebbas.org>2020-12-06 23:56:43 +0300
commit6f22a536e690133f7b7f9e62e6affd58d5ee2b6c (patch)
treecd86e2a4ea6195335ada638dce8fcf7a14664c30 /extern
parentee70eb96cf321e8aca2248b96c64680a33c7766f (diff)
Fluid: Updated Mantaflow source files
Includes outflow optimization - might have been the cause of instabilities.
Diffstat (limited to 'extern')
-rw-r--r--extern/mantaflow/preprocessed/gitinfo.h2
-rw-r--r--extern/mantaflow/preprocessed/plugin/advection.cpp8
-rw-r--r--extern/mantaflow/preprocessed/plugin/pressure.cpp14
3 files changed, 8 insertions, 16 deletions
diff --git a/extern/mantaflow/preprocessed/gitinfo.h b/extern/mantaflow/preprocessed/gitinfo.h
index d7a69564a3b..a0590e6a0b0 100644
--- a/extern/mantaflow/preprocessed/gitinfo.h
+++ b/extern/mantaflow/preprocessed/gitinfo.h
@@ -1,3 +1,3 @@
-#define MANTA_GIT_VERSION "commit bb7cde47b6e04fa62815c70775dc70f02065599f"
+#define MANTA_GIT_VERSION "commit 327917cd59b03bef3a953b5f58fc1637b3a83e01"
diff --git a/extern/mantaflow/preprocessed/plugin/advection.cpp b/extern/mantaflow/preprocessed/plugin/advection.cpp
index 4ccf33cc362..dd891e22088 100644
--- a/extern/mantaflow/preprocessed/plugin/advection.cpp
+++ b/extern/mantaflow/preprocessed/plugin/advection.cpp
@@ -1090,8 +1090,8 @@ struct extrapolateVelConvectiveBC : public KernelBase {
Real timeStep) const
{
if (flags.isOutflow(i, j, k)) {
- Vec3 bulkVel = getBulkVel(flags, vel, i, j, k);
- int dim = flags.is3D() ? 3 : 2;
+ const Vec3 bulkVel = getBulkVel(flags, vel, i, j, k);
+ const int dim = flags.is3D() ? 3 : 2;
const Vec3i cur = Vec3i(i, j, k);
Vec3i low, up, flLow, flUp;
int cnt = 0;
@@ -1099,8 +1099,8 @@ struct extrapolateVelConvectiveBC : public KernelBase {
for (int c = 0; c < dim; c++) {
low = up = flLow = flUp = cur;
Real factor = timeStep *
- max((Real)1.0, bulkVel[c]); // prevent the extrapolated velocity from
- // exploding when bulk velocity below 1
+ max((Real)1.0, abs(bulkVel[c])); // prevent the extrapolated velocity from
+ // exploding when bulk velocity below 1
low[c] = flLow[c] = cur[c] - 1;
up[c] = flUp[c] = cur[c] + 1;
// iterate over bWidth to allow for extrapolation into more distant outflow cells;
diff --git a/extern/mantaflow/preprocessed/plugin/pressure.cpp b/extern/mantaflow/preprocessed/plugin/pressure.cpp
index dfba8e0082b..1100a58db47 100644
--- a/extern/mantaflow/preprocessed/plugin/pressure.cpp
+++ b/extern/mantaflow/preprocessed/plugin/pressure.cpp
@@ -1147,26 +1147,18 @@ void solvePressureSystem(Grid<Real> &rhs,
gcg->setAccuracy(cgAccuracy);
gcg->setUseL2Norm(useL2Norm);
- int maxIter = 0;
+ int maxIter = (int)(cgMaxIterFac * flags.getSize().max()) * (flags.is3D() ? 1 : 4);
Grid<Real> *pca0 = nullptr, *pca1 = nullptr, *pca2 = nullptr, *pca3 = nullptr;
GridMg *pmg = nullptr;
// optional preconditioning
- if (preconditioner == PcNone || preconditioner == PcMIC) {
- maxIter = (int)(cgMaxIterFac * flags.getSize().max()) * (flags.is3D() ? 1 : 4);
-
+ if (preconditioner == PcMIC) {
pca0 = new Grid<Real>(parent);
pca1 = new Grid<Real>(parent);
pca2 = new Grid<Real>(parent);
pca3 = new Grid<Real>(parent);
-
- gcg->setICPreconditioner(preconditioner == PcMIC ? GridCgInterface::PC_mICP :
- GridCgInterface::PC_None,
- pca0,
- pca1,
- pca2,
- pca3);
+ gcg->setICPreconditioner(GridCgInterface::PC_mICP, pca0, pca1, pca2, pca3);
}
else if (preconditioner == PcMGDynamic || preconditioner == PcMGStatic) {
maxIter = 100;