diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-02-19 20:58:09 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-02-19 20:58:48 +0300 |
commit | 888d180164004d121511609da044ea86c3aa9cb0 (patch) | |
tree | 217442311b8023be7aa609344fbd312e28d0c2e7 /extern/mantaflow/preprocessed/plugin | |
parent | 04b7f052e14ee6ff09b5cc4c85a76c4c5a1b0383 (diff) |
Fluid: Updated manta pp files
Updates in the files include:
- New manta files now use an platform independent gzopen function
- Adjusted argument name for vorticity
Diffstat (limited to 'extern/mantaflow/preprocessed/plugin')
-rw-r--r-- | extern/mantaflow/preprocessed/plugin/extforces.cpp | 8 | ||||
-rw-r--r-- | extern/mantaflow/preprocessed/plugin/flip.cpp | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/extern/mantaflow/preprocessed/plugin/extforces.cpp b/extern/mantaflow/preprocessed/plugin/extforces.cpp index df0ddb15b33..36221fbbc10 100644 --- a/extern/mantaflow/preprocessed/plugin/extforces.cpp +++ b/extern/mantaflow/preprocessed/plugin/extforces.cpp @@ -1335,7 +1335,7 @@ struct KnConfForce : public KernelBase { void vorticityConfinement(MACGrid &vel, const FlagGrid &flags, - Real strengthGlobal = 0, + Real strength = 0, const Grid<Real> *strengthCell = NULL) { Grid<Vec3> velCenter(flags.getParent()), curl(flags.getParent()), force(flags.getParent()); @@ -1344,7 +1344,7 @@ void vorticityConfinement(MACGrid &vel, GetCentered(velCenter, vel); CurlOp(velCenter, curl); GridNorm(norm, curl); - KnConfForce(force, norm, curl, strengthGlobal, strengthCell); + KnConfForce(force, norm, curl, strength, strengthCell); KnApplyForceField(flags, vel, force, NULL, true, false); } static PyObject *_W_8(PyObject *_self, PyObject *_linargs, PyObject *_kwds) @@ -1359,11 +1359,11 @@ static PyObject *_W_8(PyObject *_self, PyObject *_linargs, PyObject *_kwds) ArgLocker _lock; MACGrid &vel = *_args.getPtr<MACGrid>("vel", 0, &_lock); const FlagGrid &flags = *_args.getPtr<FlagGrid>("flags", 1, &_lock); - Real strengthGlobal = _args.getOpt<Real>("strengthGlobal", 2, 0, &_lock); + Real strength = _args.getOpt<Real>("strength", 2, 0, &_lock); const Grid<Real> *strengthCell = _args.getPtrOpt<Grid<Real>>( "strengthCell", 3, NULL, &_lock); _retval = getPyNone(); - vorticityConfinement(vel, flags, strengthGlobal, strengthCell); + vorticityConfinement(vel, flags, strength, strengthCell); _args.check(); } pbFinalizePlugin(parent, "vorticityConfinement", !noTiming); diff --git a/extern/mantaflow/preprocessed/plugin/flip.cpp b/extern/mantaflow/preprocessed/plugin/flip.cpp index 4dfeff1d0ac..8ac167c1166 100644 --- a/extern/mantaflow/preprocessed/plugin/flip.cpp +++ b/extern/mantaflow/preprocessed/plugin/flip.cpp @@ -18,6 +18,7 @@ ******************************************************************************/ #include "particle.h" +#include "general.h" #include "grid.h" #include "commonkernels.h" #include "randomstream.h" @@ -1429,9 +1430,9 @@ struct correctLevelset : public KernelBase { Real t = (t_high - maxEV) / (t_high - t_low); correction = t * t * t - 3 * t * t + 3 * t; } - correction = (correction < 0) ? - 0 : - correction; // enforce correction factor to [0,1] (not explicitly in paper) + correction = clamp(correction, + Real(0), + Real(1)); // enforce correction factor to [0,1] (not explicitly in paper) const Vec3 gridPos = Vec3(i, j, k) + Vec3(0.5); // shifted by half cell const Real correctedPhi = fabs(norm(gridPos - pAcc(i, j, k))) - rAcc(i, j, k) * correction; |