[Bf-blender-cvs] [eefef6179dc] fluid-mantaflow: Mantaflow: Updated Mantaflow sources files
Sebastián Barschkis
noreply at git.blender.org
Tue Jul 23 18:04:10 CEST 2019
Commit: eefef6179dc51146710489df3ba04f836ea78390
Author: Sebastián Barschkis
Date: Tue Jul 23 18:01:09 2019 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rBeefef6179dc51146710489df3ba04f836ea78390
Mantaflow: Updated Mantaflow sources files
===================================================================
M intern/mantaflow/intern/manta_develop/helper/util/vectorbase.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/omp/fluidsolver.h
M intern/mantaflow/intern/manta_develop/preprocessed/omp/gitinfo.h
M intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h
M intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/extforces.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/initplugins.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/omp/registration.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/tbb/fluidsolver.h
M intern/mantaflow/intern/manta_develop/preprocessed/tbb/gitinfo.h
M intern/mantaflow/intern/manta_develop/preprocessed/tbb/grid.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/tbb/grid.h
M intern/mantaflow/intern/manta_develop/preprocessed/tbb/plugin/extforces.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/tbb/plugin/initplugins.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/tbb/registration.cpp
M intern/mantaflow/intern/strings/smoke_script.h
===================================================================
diff --git a/intern/mantaflow/intern/manta_develop/helper/util/vectorbase.cpp b/intern/mantaflow/intern/manta_develop/helper/util/vectorbase.cpp
index 078a64b81b3..a4796415ee1 100644
--- a/intern/mantaflow/intern/manta_develop/helper/util/vectorbase.cpp
+++ b/intern/mantaflow/intern/manta_develop/helper/util/vectorbase.cpp
@@ -17,15 +17,11 @@ using namespace std;
namespace Manta {
-#if (_MSC_VER >= 1910)
- // already defined in header
-#else
- template<> const Vector3D<int> Vector3D<int>::Zero(0, 0, 0);
- template<> const Vector3D<float> Vector3D<float>::Zero(0.f, 0.f, 0.f);
- template<> const Vector3D<double> Vector3D<double>::Zero(0., 0., 0.);
- template<> const Vector3D<float> Vector3D<float>::Invalid(numeric_limits<float>::quiet_NaN(), numeric_limits<float>::quiet_NaN(), numeric_limits<float>::quiet_NaN());
- template<> const Vector3D<double> Vector3D<double>::Invalid(numeric_limits<double>::quiet_NaN(), numeric_limits<double>::quiet_NaN(), numeric_limits<double>::quiet_NaN());
-#endif
+template<> const Vector3D<int> Vector3D<int>::Zero(0, 0, 0);
+template<> const Vector3D<float> Vector3D<float>::Zero(0.f, 0.f, 0.f);
+template<> const Vector3D<double> Vector3D<double>::Zero(0., 0., 0.);
+template<> const Vector3D<float> Vector3D<float>::Invalid(numeric_limits<float>::quiet_NaN(), numeric_limits<float>::quiet_NaN(), numeric_limits<float>::quiet_NaN());
+template<> const Vector3D<double> Vector3D<double>::Invalid(numeric_limits<double>::quiet_NaN(), numeric_limits<double>::quiet_NaN(), numeric_limits<double>::quiet_NaN());
template<> bool Vector3D<float>::isValid() const { return !c_isnan(x) && !c_isnan(y) && !c_isnan(z); }
template<> bool Vector3D<double>::isValid() const { return !c_isnan(x) && !c_isnan(y) && !c_isnan(z); }
diff --git a/intern/mantaflow/intern/manta_develop/preprocessed/omp/fluidsolver.h b/intern/mantaflow/intern/manta_develop/preprocessed/omp/fluidsolver.h
index a89a3ed5ccf..87148132bb9 100644
--- a/intern/mantaflow/intern/manta_develop/preprocessed/omp/fluidsolver.h
+++ b/intern/mantaflow/intern/manta_develop/preprocessed/omp/fluidsolver.h
@@ -57,10 +57,9 @@ class FluidSolver : public PbClass {public:
pbSetError("FluidSolver::getGridSize",e.what()); return 0; }
}
- inline Real getDt() { return mDt; }
- inline Real getDx() { return 1.0 / mGridSize.max(); }
- inline Real getTime() { return mTimeTotal; }
- inline Real getFrameLength() { return mFrameLength; }
+ inline Real getDt() const { return mDt; }
+ inline Real getDx() const { return 1.0 / mGridSize.max(); }
+ inline Real getTime() const { return mTimeTotal; }
//! Check dimensionality
inline bool is2D() const { return mDim==2; }
@@ -151,23 +150,18 @@ class FluidSolver : public PbClass {public:
static int _SET_mFrameLength(PyObject* self, PyObject* val, void* cl) {
FluidSolver* pbo = dynamic_cast<FluidSolver*>(Pb::objFromPy(self)); pbo->mFrameLength = fromPy<Real >(val); return 0; }
-#ifdef BLENDER
- //! Blender needs access in order to restore value in new solver object
+
+ //! Per frame duration. Blender needs access in order to restore value in new solver object
Real mTimePerFrame;static PyObject* _GET_mTimePerFrame(PyObject* self, void* cl) {
FluidSolver* pbo = dynamic_cast<FluidSolver*>(Pb::objFromPy(self)); return toPy(pbo->mTimePerFrame); }
static int _SET_mTimePerFrame(PyObject* self, PyObject* val, void* cl) {
FluidSolver* pbo = dynamic_cast<FluidSolver*>(Pb::objFromPy(self)); pbo->mTimePerFrame = fromPy<Real >(val); return 0; }
-#endif
protected:
Vec3i mGridSize;
const int mDim;
bool mLockDt;
-#ifndef BLENDER
- //! Blender needs public access to this field, see above
- Real mTimePerFrame;
-#endif
//! subclass for managing grid memory
//! stored as a stack to allow fast allocation
diff --git a/intern/mantaflow/intern/manta_develop/preprocessed/omp/gitinfo.h b/intern/mantaflow/intern/manta_develop/preprocessed/omp/gitinfo.h
index b696431ac9e..c03b3289453 100644
--- a/intern/mantaflow/intern/manta_develop/preprocessed/omp/gitinfo.h
+++ b/intern/mantaflow/intern/manta_develop/preprocessed/omp/gitinfo.h
@@ -1,4 +1,4 @@
-#define MANTA_GIT_VERSION "commit 0793c3c5f60deedee26289afcc135a0c15de96a3"
+#define MANTA_GIT_VERSION "commit d2f1eee1562925547b0467aa1edbfb1d63c966dc"
diff --git a/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.cpp b/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.cpp
index f447a1d8aa5..f63e4ca3b1d 100644
--- a/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.cpp
+++ b/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.cpp
@@ -1507,7 +1507,7 @@ void FlagGrid::initBoundaries(const int &boundaryWidth, const int *types) {
}
}
-void FlagGrid::updateFromLevelset(LevelsetGrid& levelset, LevelsetGrid* obsLevelset) {
+void FlagGrid::updateFromLevelset(LevelsetGrid& levelset) {
FOR_IDX(*this) {
if (!isObstacle(idx) && !isOutflow(idx)) {
const Real phi = levelset[idx];
@@ -1516,12 +1516,8 @@ void FlagGrid::updateFromLevelset(LevelsetGrid& levelset, LevelsetGrid* obsLevel
mData[idx] &= ~(TypeEmpty | TypeFluid); // clear empty/fluid flags
mData[idx] |= (phi <= 0) ? TypeFluid : TypeEmpty; // set resepctive flag
}
- if (obsLevelset && isOutflow(idx)) {
- const Real phiObs = (*obsLevelset)[idx];
- if (phiObs <= 0) mData[idx] = TypeObstacle; // enforce obstacle flag
- }
}
-}
+}
void FlagGrid::fillGrid(int type) {
FOR_IDX(*this) {
diff --git a/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h b/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h
index a1283db5eee..dc65b857218 100644
--- a/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h
+++ b/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h
@@ -637,15 +637,15 @@ void initDomain( const int &boundaryWidth = 0 , const std::string &wall = "xXyYz
void initBoundaries( const int &boundaryWidth, const int *types );
//! set fluid flags inside levelset (liquids)
- void updateFromLevelset(LevelsetGrid& levelset, LevelsetGrid* obsLevelset=NULL); static PyObject* _W_37 (PyObject* _self, PyObject* _linargs, PyObject* _kwds) {
+ void updateFromLevelset(LevelsetGrid& levelset); static PyObject* _W_37 (PyObject* _self, PyObject* _linargs, PyObject* _kwds) {
try {
PbArgs _args(_linargs, _kwds); FlagGrid* pbo = dynamic_cast<FlagGrid*>(Pb::objFromPy(_self)); bool noTiming = _args.getOpt<bool>("notiming", -1, 0); pbPreparePlugin(pbo->getParent(), "FlagGrid::updateFromLevelset" , !noTiming); PyObject *_retval = 0; {
- ArgLocker _lock; LevelsetGrid& levelset = *_args.getPtr<LevelsetGrid >("levelset",0,&_lock); LevelsetGrid* obsLevelset = _args.getPtrOpt<LevelsetGrid >("obsLevelset",1,NULL,&_lock); pbo->_args.copy(_args); _retval = getPyNone(); pbo->updateFromLevelset(levelset,obsLevelset); pbo->_args.check(); }
+ ArgLocker _lock; LevelsetGrid& levelset = *_args.getPtr<LevelsetGrid >("levelset",0,&_lock); pbo->_args.copy(_args); _retval = getPyNone(); pbo->updateFromLevelset(levelset); pbo->_args.check(); }
pbFinalizePlugin(pbo->getParent(),"FlagGrid::updateFromLevelset" , !noTiming); return _retval; }
catch(std::exception& e) {
pbSetError("FlagGrid::updateFromLevelset",e.what()); return 0; }
}
-
+
//! set all cells (except obs/in/outflow) to type (fluid by default)
void fillGrid(int type=TypeFluid); static PyObject* _W_38 (PyObject* _self, PyObject* _linargs, PyObject* _kwds) {
try {
diff --git a/intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/extforces.cpp b/intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/extforces.cpp
index 693252ca1d2..d40a79d7d3c 100644
--- a/intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/extforces.cpp
+++ b/intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/extforces.cpp
@@ -407,6 +407,7 @@ extern "C" {
KnSetWallBcs(const FlagGrid& flags, MACGrid& vel, const MACGrid* obvel) : KernelBase(&flags,0) ,flags(flags),vel(vel),obvel(obvel) {
runMessage(); run(); }
inline void op(int i, int j, int k, const FlagGrid& flags, MACGrid& vel, const MACGrid* obvel ) {
+
bool curFluid = flags.isFluid(i,j,k);
bool curObs = flags.isObstacle(i,j,k);
Vec3 bcsVel(0.,0.,0.);
@@ -465,6 +466,7 @@ extern "C" {
//! set wall BCs for fill fraction mode, note - only needs obstacle SDF
+
struct KnSetWallBcsFrac : public KernelBase {
KnSetWallBcsFrac(const FlagGrid& flags, const MACGrid& vel, MACGrid& velTarget, const MACGrid* obvel, const Grid<Real>* phiObs, const int &boundaryWidth=0) : KernelBase(&flags,0) ,flags(flags),vel(vel),velTarget(velTarget),obvel(obvel),phiObs(phiObs),boundaryWidth(boundaryWidth) {
runMessage(); run(); }
diff --git a/intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/initplugins.cpp b/intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/initplugins.cpp
index a9e7c59f7e4..1678c1c90c9 100644
--- a/intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/initplugins.cpp
+++ b/intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/initplugins.cpp
@@ -27,12 +27,8 @@
#include "commonkernels.h"
#include "particle.h"
#include "noisefield.h"
-#include "mesh.h"
-
-// disable saving projected images as ppms in blender
-#if BLENDER!=1
#include "simpleimage.h"
-#endif
+#include "mesh.h"
using namespace std;
@@ -592,20 +588,17 @@ extern "C" {
-#if BLENDER!=1
+
// from simpleimage.cpp
-void projectImg(SimpleImage& img, const Grid<Real>& val, int shadeMode = 0, Real scale = 1.);
-#endif
+void projectImg( SimpleImage& img, const Grid<Real>& val, int shadeMode=0, Real scale=1.);
//! output shaded (all 3 axes at once for 3D)
//! shading modes: 0 smoke, 1 surfaces
void projectPpmFull( const Grid<Real>& val, string name, int shadeMode=0, Real scale=1.) {
- #if BLENDER!=1
SimpleImage img;
projectImg( img, val, shadeMode, scale );
img.writePpm( name );
- #endif
} static PyObject* _W_12 (PyObject* _self, PyObject* _linargs, PyObject* _kwds) {
try {
PbArgs _args(_linargs, _kwds); FluidSolver *parent = _args.obtainParent(); bool noTiming = _args.getOpt<bool>("notiming", -1, 0); pbPreparePlugin(parent, "projectPpmFull" ,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list