[Bf-blender-cvs] [11ea224ac57] fluid-mantaflow: updated manta pp files

Sebastián Barschkis noreply at git.blender.org
Fri Aug 25 12:40:24 CEST 2017


Commit: 11ea224ac575c4513a809ec5402fcd87385cc411
Author: Sebastián Barschkis
Date:   Wed Aug 23 18:18:58 2017 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB11ea224ac575c4513a809ec5402fcd87385cc411

updated manta pp files

various tweaks that are not in the official mantaflow branch - need to merge them there later

===================================================================

M	intern/mantaflow/intern/manta_pp/omp/fastmarch.cpp
M	intern/mantaflow/intern/manta_pp/omp/particle.h
M	intern/mantaflow/intern/manta_pp/omp/plugin/extforces.cpp
M	intern/mantaflow/intern/manta_pp/omp/plugin/fluidguiding.cpp
M	intern/mantaflow/intern/manta_pp/omp/registration.cpp
M	intern/mantaflow/intern/manta_pp/tbb/fastmarch.cpp
M	intern/mantaflow/intern/manta_pp/tbb/particle.h
M	intern/mantaflow/intern/manta_pp/tbb/plugin/extforces.cpp
M	intern/mantaflow/intern/manta_pp/tbb/plugin/fluidguiding.cpp
M	intern/mantaflow/intern/manta_pp/tbb/registration.cpp

===================================================================

diff --git a/intern/mantaflow/intern/manta_pp/omp/fastmarch.cpp b/intern/mantaflow/intern/manta_pp/omp/fastmarch.cpp
index 974b967a70e..3214d52bade 100644
--- a/intern/mantaflow/intern/manta_pp/omp/fastmarch.cpp
+++ b/intern/mantaflow/intern/manta_pp/omp/fastmarch.cpp
@@ -369,7 +369,7 @@ inline Vec3 getNormal(const Grid<Real>& data, int i, int j, int k) {
 // only fluid velocities, not those at obstacles)
 
 
-void extrapolateMACSimple(FlagGrid& flags, MACGrid& vel, int distance = 4, LevelsetGrid* phiObs=NULL , bool intoObs = false ) {
+void extrapolateMACSimple(FlagGrid& flags, MACGrid& vel, int distance = 4, LevelsetGrid* phiObs=NULL , bool intoObs = false, Grid<Real>* exclude=NULL ) {
 	Grid<int> tmp( flags.getParent() );
 	int dim = (flags.is3D() ? 3:2);
 
@@ -404,7 +404,7 @@ void extrapolateMACSimple(FlagGrid& flags, MACGrid& vel, int distance = 4, Level
 
 	// copy tangential values into sides
 	knExtrapolateIntoBnd(flags, vel);
-} static PyObject* _W_0 (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, "extrapolateMACSimple" , !noTiming ); PyObject *_retval = 0; { ArgLocker _lock; FlagGrid& flags = *_args.getPtr<FlagGrid >("flags",0,&_lock); MACGrid& vel = *_args.getPtr<MACGrid >("vel",1,&_lock); int distance = _args.getOpt<int >("distance",2,4,&_lo [...]
+} static PyObject* _W_0 (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, "extrapolateMACSimple" , !noTiming ); PyObject *_retval = 0; { ArgLocker _lock; FlagGrid& flags = *_args.getPtr<FlagGrid >("flags",0,&_lock); MACGrid& vel = *_args.getPtr<MACGrid >("vel",1,&_lock); int distance = _args.getOpt<int >("distance",2,4,&_lo [...]
 
 
 
diff --git a/intern/mantaflow/intern/manta_pp/omp/particle.h b/intern/mantaflow/intern/manta_pp/omp/particle.h
index 9041782305d..f811e1bdafe 100644
--- a/intern/mantaflow/intern/manta_pp/omp/particle.h
+++ b/intern/mantaflow/intern/manta_pp/omp/particle.h
@@ -209,7 +209,7 @@ class BasicParticleSystem : public ParticleSystem<BasicParticleData> {public:
 	std::vector<BasicParticleData>& getData() { return mData; }
 
 	void printParts(IndexInt start=-1, IndexInt stop=-1, bool printIndex=false); static PyObject* _W_15 (PyObject* _self, PyObject* _linargs, PyObject* _kwds) { try { PbArgs _args(_linargs, _kwds); BasicParticleSystem* pbo = dynamic_cast<BasicParticleSystem*>(Pb::objFromPy(_self)); bool noTiming = _args.getOpt<bool>("notiming", -1, 0); pbPreparePlugin(pbo->getParent(), "BasicParticleSystem::printParts" , !noTiming); PyObject *_retval = 0; { ArgLocker _lock; IndexInt start = _args.getOpt<Ind [...]
-	 	//! get data pointer of particle data
+ 	//! get data pointer of particle data
 	std::string getDataPointer(); static PyObject* _W_16 (PyObject* _self, PyObject* _linargs, PyObject* _kwds) { try { PbArgs _args(_linargs, _kwds); BasicParticleSystem* pbo = dynamic_cast<BasicParticleSystem*>(Pb::objFromPy(_self)); bool noTiming = _args.getOpt<bool>("notiming", -1, 0); pbPreparePlugin(pbo->getParent(), "BasicParticleSystem::getDataPointer" , !noTiming); PyObject *_retval = 0; { ArgLocker _lock;  pbo->_args.copy(_args);  _retval = toPy(pbo->getDataPointer());  pbo->_args [...]
 #define _C_BasicParticleSystem
 ;
diff --git a/intern/mantaflow/intern/manta_pp/omp/plugin/extforces.cpp b/intern/mantaflow/intern/manta_pp/omp/plugin/extforces.cpp
index 39dc87e5d41..b2e6c62a111 100644
--- a/intern/mantaflow/intern/manta_pp/omp/plugin/extforces.cpp
+++ b/intern/mantaflow/intern/manta_pp/omp/plugin/extforces.cpp
@@ -487,7 +487,30 @@ void addForceField(FlagGrid& flags, MACGrid& vel, Grid<Vec3>& force) {
 void setInitialVelocity(FlagGrid& flags, MACGrid& vel, Grid<Vec3>& invel) {
 	KnAddForceIfLower(flags, vel, invel);
 } static PyObject* _W_10 (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, "setInitialVelocity" , !noTiming ); PyObject *_retval = 0; { ArgLocker _lock; FlagGrid& flags = *_args.getPtr<FlagGrid >("flags",0,&_lock); MACGrid& vel = *_args.getPtr<MACGrid >("vel",1,&_lock); Grid<Vec3>& invel = *_args.getPtr<Grid<Vec3> >("invel" [...]
+	
+ struct knSetForceIn : public KernelBase { knSetForceIn(const Grid<Real> &phiIn, MACGrid& vel, const Vec3 &force) :  KernelBase(&phiIn,0) ,phiIn(phiIn),vel(vel),force(force)   { runMessage(); run(); }  inline void op(int i, int j, int k, const Grid<Real> &phiIn, MACGrid& vel, const Vec3 &force )  {
+	if(phiIn(i,j,k) < 0.) {
+		vel(i,j,k).x = force.x;
+		vel(i,j,k).y = force.y;
+		vel(i,j,k).z = force.z;
+	}
+}   inline const Grid<Real> & getArg0() { return phiIn; } typedef Grid<Real>  type0;inline MACGrid& getArg1() { return vel; } typedef MACGrid type1;inline const Vec3& getArg2() { return force; } typedef Vec3 type2; void runMessage() { debMsg("Executing kernel knSetForceIn ", 3); debMsg("Kernel range" <<  " x "<<  maxX  << " y "<< maxY  << " z "<< minZ<<" - "<< maxZ  << " "   , 4); }; void run() {  const int _maxX = maxX; const int _maxY = maxY; if (maxZ > 1) { 
+#pragma omp parallel 
+ {  
+#pragma omp for  
+  for (int k=minZ; k < maxZ; k++) for (int j=0; j < _maxY; j++) for (int i=0; i < _maxX; i++) op(i,j,k,phiIn,vel,force);  } } else { const int k=0; 
+#pragma omp parallel 
+ {  
+#pragma omp for  
+  for (int j=0; j < _maxY; j++) for (int i=0; i < _maxX; i++) op(i,j,k,phiIn,vel,force);  } }  } const Grid<Real> & phiIn; MACGrid& vel; const Vec3& force;   };
+#line 384 "plugin/extforces.cpp"
+
 
+	
+void setForceIn(Grid<Real> &region, MACGrid& vel, const Vec3 &force) {
+	knSetForceIn(region, vel, force);
+} static PyObject* _W_11 (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, "setForceIn" , !noTiming ); PyObject *_retval = 0; { ArgLocker _lock; Grid<Real> & region = *_args.getPtr<Grid<Real>  >("region",0,&_lock); MACGrid& vel = *_args.getPtr<MACGrid >("vel",1,&_lock); const Vec3& force = _args.get<Vec3 >("force",2,&_lock) [...]
+	
 } // namespace
 
 
diff --git a/intern/mantaflow/intern/manta_pp/omp/plugin/fluidguiding.cpp b/intern/mantaflow/intern/manta_pp/omp/plugin/fluidguiding.cpp
index 8bfbdd6ac69..5c378a4f397 100644
--- a/intern/mantaflow/intern/manta_pp/omp/plugin/fluidguiding.cpp
+++ b/intern/mantaflow/intern/manta_pp/omp/plugin/fluidguiding.cpp
@@ -396,6 +396,13 @@ void PD_fluid_guiding(MACGrid& vel, MACGrid& velT, Grid<Real>& pressure, FlagGri
 	debMsg("PD_fluid_guiding iterations:" << iter, 1);
 } static PyObject* _W_2 (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, "PD_fluid_guiding" , !noTiming ); PyObject *_retval = 0; { ArgLocker _lock; MACGrid& vel = *_args.getPtr<MACGrid >("vel",0,&_lock); MACGrid& velT = *_args.getPtr<MACGrid >("velT",1,&_lock); Grid<Real>& pressure = *_args.getPtr<Grid<Real> >("pressure", [...]

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list