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>2021-01-13 11:49:11 +0300
committerSebastián Barschkis <sebbas@sebbas.org>2021-01-13 11:49:38 +0300
commit0b711e6758b0ba3732b2e6cfceb009aa186e525e (patch)
tree26cb94d047b04f700880272319a1e900ef5d24bc /extern
parent3f7c294a950ecdc5491c57c4ee7916bb87de4d6a (diff)
Fluid: Updated Mantaflow source files
Includes minor fixes / cleanups from the viscosity plugin.
Diffstat (limited to 'extern')
-rw-r--r--extern/mantaflow/preprocessed/conjugategrad.h16
-rw-r--r--extern/mantaflow/preprocessed/plugin/viscosity.cpp12
2 files changed, 13 insertions, 15 deletions
diff --git a/extern/mantaflow/preprocessed/conjugategrad.h b/extern/mantaflow/preprocessed/conjugategrad.h
index 4974aa6a4d6..35cb3960656 100644
--- a/extern/mantaflow/preprocessed/conjugategrad.h
+++ b/extern/mantaflow/preprocessed/conjugategrad.h
@@ -170,7 +170,7 @@ struct ApplyMatrix : public KernelBase {
unusedParameter(vecRhs); // Not needed in this matrix application
if (matrixA.size() != 4)
- errMsg("ConjugatedGrad: Invalid A matrix in apply matrix step");
+ errMsg("ConjugateGrad: Invalid A matrix in apply matrix step");
Grid<Real> &A0 = *matrixA[0];
Grid<Real> &Ai = *matrixA[1];
Grid<Real> &Aj = *matrixA[2];
@@ -256,7 +256,7 @@ struct ApplyMatrix2D : public KernelBase {
unusedParameter(vecRhs); // Not needed in this matrix application
if (matrixA.size() != 3)
- errMsg("ConjugatedGrad: Invalid A matrix in apply matrix step");
+ errMsg("ConjugateGrad: Invalid A matrix in apply matrix step");
Grid<Real> &A0 = *matrixA[0];
Grid<Real> &Ai = *matrixA[1];
Grid<Real> &Aj = *matrixA[2];
@@ -338,7 +338,7 @@ struct ApplyMatrixViscosityU : public KernelBase {
const std::vector<Grid<Real> *> vecRhs) const
{
if (matrixA.size() != 15)
- errMsg("ConjugatedGrad: Invalid A matrix in apply matrix step");
+ errMsg("ConjugateGrad: Invalid A matrix in apply matrix step");
Grid<Real> &A0 = *matrixA[0];
Grid<Real> &Aplusi = *matrixA[1];
Grid<Real> &Aplusj = *matrixA[2];
@@ -348,7 +348,7 @@ struct ApplyMatrixViscosityU : public KernelBase {
Grid<Real> &Aminusk = *matrixA[6];
if (vecRhs.size() != 2)
- errMsg("ConjugatedGrad: Invalid rhs vector in apply matrix step");
+ errMsg("ConjugateGrad: Invalid rhs vector in apply matrix step");
Grid<Real> &srcV = *vecRhs[0];
Grid<Real> &srcW = *vecRhs[1];
@@ -450,7 +450,7 @@ struct ApplyMatrixViscosityV : public KernelBase {
const std::vector<Grid<Real> *> vecRhs) const
{
if (matrixA.size() != 15)
- errMsg("ConjugatedGrad: Invalid A matrix in apply matrix step");
+ errMsg("ConjugateGrad: Invalid A matrix in apply matrix step");
Grid<Real> &A0 = *matrixA[0];
Grid<Real> &Aplusi = *matrixA[1];
Grid<Real> &Aplusj = *matrixA[2];
@@ -460,7 +460,7 @@ struct ApplyMatrixViscosityV : public KernelBase {
Grid<Real> &Aminusk = *matrixA[6];
if (vecRhs.size() != 2)
- errMsg("ConjugatedGrad: Invalid rhs vector in apply matrix step");
+ errMsg("ConjugateGrad: Invalid rhs vector in apply matrix step");
Grid<Real> &srcU = *vecRhs[0];
Grid<Real> &srcW = *vecRhs[1];
@@ -562,7 +562,7 @@ struct ApplyMatrixViscosityW : public KernelBase {
const std::vector<Grid<Real> *> vecRhs) const
{
if (matrixA.size() != 15)
- errMsg("ConjugatedGrad: Invalid A matrix in apply matrix step");
+ errMsg("ConjugateGrad: Invalid A matrix in apply matrix step");
Grid<Real> &A0 = *matrixA[0];
Grid<Real> &Aplusi = *matrixA[1];
Grid<Real> &Aplusj = *matrixA[2];
@@ -572,7 +572,7 @@ struct ApplyMatrixViscosityW : public KernelBase {
Grid<Real> &Aminusk = *matrixA[6];
if (vecRhs.size() != 2)
- errMsg("ConjugatedGrad: Invalid rhs vector in apply matrix step");
+ errMsg("ConjugateGrad: Invalid rhs vector in apply matrix step");
Grid<Real> &srcU = *vecRhs[0];
Grid<Real> &srcV = *vecRhs[1];
diff --git a/extern/mantaflow/preprocessed/plugin/viscosity.cpp b/extern/mantaflow/preprocessed/plugin/viscosity.cpp
index 5dc478b13dd..a9e1985336e 100644
--- a/extern/mantaflow/preprocessed/plugin/viscosity.cpp
+++ b/extern/mantaflow/preprocessed/plugin/viscosity.cpp
@@ -139,7 +139,7 @@ struct KnEstimateVolumeFraction : public KernelBase {
{
const Vec3 centre = startCentre + Vec3(i, j, k) * 0.5;
const Real offset = 0.5 * dx;
- const int order = 2;
+ const int order = 1; // is sufficient
Real phi000 = phi.getInterpolatedHi(centre + Vec3(-offset, -offset, -offset), order);
Real phi001 = phi.getInterpolatedHi(centre + Vec3(-offset, -offset, +offset), order);
@@ -1067,10 +1067,8 @@ void solveViscosity(const FlagGrid &flags,
Real viscTop = 0.25 * (viscosity(i, j, k) + viscosity(i, j, k - 1) + viscosity(i, j + 1, k) +
viscosity(i, j + 1, k - 1));
- ;
Real viscBottom = 0.25 * (viscosity(i, j, k) + viscosity(i, j, k - 1) +
viscosity(i, j - 1, k) + viscosity(i, j - 1, k - 1));
- ;
Real volTop = exVolLiquid(i, j + 1, k);
Real volBottom = exVolLiquid(i, j, k);
@@ -1224,7 +1222,7 @@ void solveViscosity(const FlagGrid &flags,
uSolution, uRhs, uResidual, uSearch, flags, uTmp, uMatA, uVecRhs);
}
else {
- errMsg("2D Matrix application not yet supported in viscosity solver");
+ errMsg("Viscosity: 2D Matrix application not yet supported in viscosity solver");
}
// CG solver for V
@@ -1249,7 +1247,7 @@ void solveViscosity(const FlagGrid &flags,
vSolution, vRhs, vResidual, vSearch, flags, vTmp, vMatA, vVecRhs);
}
else {
- errMsg("2D Matrix application not yet supported in viscosity solver");
+ errMsg("Viscosity: 2D Matrix application not yet supported in viscosity solver");
}
// CG solver for W
@@ -1274,7 +1272,7 @@ void solveViscosity(const FlagGrid &flags,
wSolution, wRhs, wResidual, wSearch, flags, wTmp, wMatA, wVecRhs);
}
else {
- errMsg("2D Matrix application not yet supported in viscosity solver");
+ errMsg("Viscosity: 2D Matrix application not yet supported in viscosity solver");
}
// Same accuracy for all dimensions
@@ -1308,7 +1306,7 @@ void solveViscosity(const FlagGrid &flags,
wRhs.copyFrom(wSearch);
}
debMsg(
- "Viscosity::solveViscosity done. "
+ "Viscosity: solveViscosity() done. "
"Iterations (u,v,w): ("
<< uGcg->getIterations() << "," << vGcg->getIterations() << "," << wGcg->getIterations()
<< "), "