[Bf-blender-cvs] [ca6966c] fluid-mantaflow: updated manta pp files
Sebastián Barschkis
noreply at git.blender.org
Fri Aug 12 16:22:37 CEST 2016
Commit: ca6966c39d2074f73e64b873e83ce01a53a1ef35
Author: Sebastián Barschkis
Date: Fri Aug 12 15:33:59 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rBca6966c39d2074f73e64b873e83ce01a53a1ef35
updated manta pp files
===================================================================
M intern/mantaflow/CMakeLists.txt
M intern/mantaflow/intern/manta_pp/commonkernels.h
M intern/mantaflow/intern/manta_pp/conjugategrad.cpp
M intern/mantaflow/intern/manta_pp/conjugategrad.h
M intern/mantaflow/intern/manta_pp/edgecollapse.cpp
M intern/mantaflow/intern/manta_pp/edgecollapse.h
M intern/mantaflow/intern/manta_pp/fastmarch.cpp
M intern/mantaflow/intern/manta_pp/fastmarch.h
M intern/mantaflow/intern/manta_pp/fileio.cpp
M intern/mantaflow/intern/manta_pp/fileio.h
M intern/mantaflow/intern/manta_pp/fluidsolver.cpp
M intern/mantaflow/intern/manta_pp/fluidsolver.h
M intern/mantaflow/intern/manta_pp/general.cpp
M intern/mantaflow/intern/manta_pp/general.h
M intern/mantaflow/intern/manta_pp/gitinfo.h
M intern/mantaflow/intern/manta_pp/grid.cpp
M intern/mantaflow/intern/manta_pp/grid.h
M intern/mantaflow/intern/manta_pp/grid.h.reg
M intern/mantaflow/intern/manta_pp/grid.h.reg.cpp
A intern/mantaflow/intern/manta_pp/grid4d.cpp
A intern/mantaflow/intern/manta_pp/grid4d.h
A intern/mantaflow/intern/manta_pp/grid4d.h.reg
A intern/mantaflow/intern/manta_pp/grid4d.h.reg.cpp
D intern/mantaflow/intern/manta_pp/hginfo.h
M intern/mantaflow/intern/manta_pp/kernel.cpp
M intern/mantaflow/intern/manta_pp/kernel.h
M intern/mantaflow/intern/manta_pp/levelset.cpp
M intern/mantaflow/intern/manta_pp/levelset.h
M intern/mantaflow/intern/manta_pp/mesh.cpp
M intern/mantaflow/intern/manta_pp/mesh.h
M intern/mantaflow/intern/manta_pp/mesh.h.reg
M intern/mantaflow/intern/manta_pp/mesh.h.reg.cpp
M intern/mantaflow/intern/manta_pp/movingobs.cpp
M intern/mantaflow/intern/manta_pp/movingobs.h
M intern/mantaflow/intern/manta_pp/noisefield.cpp
M intern/mantaflow/intern/manta_pp/noisefield.h
M intern/mantaflow/intern/manta_pp/particle.cpp
M intern/mantaflow/intern/manta_pp/particle.h
M intern/mantaflow/intern/manta_pp/particle.h.reg
M intern/mantaflow/intern/manta_pp/particle.h.reg.cpp
M intern/mantaflow/intern/manta_pp/plugin/advection.cpp
M intern/mantaflow/intern/manta_pp/plugin/extforces.cpp
M intern/mantaflow/intern/manta_pp/plugin/fire.cpp
M intern/mantaflow/intern/manta_pp/plugin/flip.cpp
M intern/mantaflow/intern/manta_pp/plugin/initplugins.cpp
M intern/mantaflow/intern/manta_pp/plugin/kepsilon.cpp
M intern/mantaflow/intern/manta_pp/plugin/meshplugins.cpp
M intern/mantaflow/intern/manta_pp/plugin/pressure.cpp
A intern/mantaflow/intern/manta_pp/plugin/surfaceturbulence.cpp
M intern/mantaflow/intern/manta_pp/plugin/vortexplugins.cpp
M intern/mantaflow/intern/manta_pp/plugin/waveletturbulence.cpp
M intern/mantaflow/intern/manta_pp/plugin/waves.cpp
M intern/mantaflow/intern/manta_pp/pwrapper/manta.h
M intern/mantaflow/intern/manta_pp/pwrapper/pclass.cpp
M intern/mantaflow/intern/manta_pp/pwrapper/pclass.h
M intern/mantaflow/intern/manta_pp/pwrapper/pconvert.cpp
M intern/mantaflow/intern/manta_pp/pwrapper/pconvert.h
M intern/mantaflow/intern/manta_pp/pwrapper/pvec3.cpp
M intern/mantaflow/intern/manta_pp/pwrapper/registry.cpp
M intern/mantaflow/intern/manta_pp/pwrapper/registry.h
M intern/mantaflow/intern/manta_pp/python/defines.py.reg
M intern/mantaflow/intern/manta_pp/python/defines.py.reg.cpp
M intern/mantaflow/intern/manta_pp/shapes.cpp
M intern/mantaflow/intern/manta_pp/shapes.h
M intern/mantaflow/intern/manta_pp/test.cpp
M intern/mantaflow/intern/manta_pp/timing.cpp
M intern/mantaflow/intern/manta_pp/timing.h
M intern/mantaflow/intern/manta_pp/turbulencepart.cpp
M intern/mantaflow/intern/manta_pp/turbulencepart.h
M intern/mantaflow/intern/manta_pp/turbulencepart.h.reg.cpp
M intern/mantaflow/intern/manta_pp/util/interpol.h
M intern/mantaflow/intern/manta_pp/util/randomstream.h
M intern/mantaflow/intern/manta_pp/util/simpleimage.cpp
A intern/mantaflow/intern/manta_pp/util/vector4d.cpp
A intern/mantaflow/intern/manta_pp/util/vector4d.h
M intern/mantaflow/intern/manta_pp/util/vectorbase.h
M intern/mantaflow/intern/manta_pp/vortexpart.cpp
M intern/mantaflow/intern/manta_pp/vortexpart.h
M intern/mantaflow/intern/manta_pp/vortexpart.h.reg.cpp
M intern/mantaflow/intern/manta_pp/vortexsheet.cpp
M intern/mantaflow/intern/manta_pp/vortexsheet.h
===================================================================
diff --git a/intern/mantaflow/CMakeLists.txt b/intern/mantaflow/CMakeLists.txt
index e603d22..37de2bf 100644
--- a/intern/mantaflow/CMakeLists.txt
+++ b/intern/mantaflow/CMakeLists.txt
@@ -81,11 +81,15 @@ set(SRC
intern/manta_pp/general.h
intern/manta_pp/general.h.reg
intern/manta_pp/general.h.reg.cpp
+ intern/manta_pp/gitinfo.h
intern/manta_pp/grid.cpp
intern/manta_pp/grid.h
intern/manta_pp/grid.h.reg
intern/manta_pp/grid.h.reg.cpp
- intern/manta_pp/hginfo.h
+ intern/manta_pp/grid4d.cpp
+ intern/manta_pp/grid4d.h
+ intern/manta_pp/grid4d.h.reg
+ intern/manta_pp/grid4d.h.reg.cpp
intern/manta_pp/kernel.cpp
intern/manta_pp/kernel.h
intern/manta_pp/kernel.h.reg
@@ -118,6 +122,7 @@ set(SRC
intern/manta_pp/plugin/kepsilon.cpp
intern/manta_pp/plugin/meshplugins.cpp
intern/manta_pp/plugin/pressure.cpp
+ intern/manta_pp/plugin/surfaceturbulence.cpp
intern/manta_pp/plugin/vortexplugins.cpp
intern/manta_pp/plugin/waveletturbulence.cpp
intern/manta_pp/plugin/waves.cpp
@@ -156,6 +161,8 @@ set(SRC
intern/manta_pp/util/simpleimage.cpp
intern/manta_pp/util/simpleimage.h
intern/manta_pp/util/solvana.h
+ intern/manta_pp/util/vector4d.cpp
+ intern/manta_pp/util/vector4d.h
intern/manta_pp/util/vectorbase.cpp
intern/manta_pp/util/vectorbase.h
intern/manta_pp/vortexpart.cpp
diff --git a/intern/mantaflow/intern/manta_pp/commonkernels.h b/intern/mantaflow/intern/manta_pp/commonkernels.h
index 202905d..4ed6efe 100644
--- a/intern/mantaflow/intern/manta_pp/commonkernels.h
+++ b/intern/mantaflow/intern/manta_pp/commonkernels.h
@@ -9,7 +9,7 @@
-#line 1 "/Users/user/Developer/Xcode Projects/mantaflowDevelop/mantaflowgit/source/commonkernels.h"
+#line 1 "/Users/sbarschkis/Developer/Mantaflow/blenderIntegration/mantaflowgit/source/commonkernels.h"
/******************************************************************************
*
* MantaFlow fluid solver framework
@@ -35,36 +35,36 @@ namespace Manta {
//! Kernel: Invert real values, if positive and fluid
- struct InvertCheckFluid : public KernelBase { InvertCheckFluid(FlagGrid& flags, Grid<Real>& grid) : KernelBase(&flags,0) ,flags(flags),grid(grid) { run(); } inline void op(int idx, FlagGrid& flags, Grid<Real>& grid ) {
+ struct InvertCheckFluid : public KernelBase { InvertCheckFluid(FlagGrid& flags, Grid<Real>& grid) : KernelBase(&flags,0) ,flags(flags),grid(grid) { runMessage(); run(); } inline void op(IndexInt idx, FlagGrid& flags, Grid<Real>& grid ) {
if (flags.isFluid(idx) && grid[idx] > 0)
grid[idx] = 1.0 / grid[idx];
-} inline FlagGrid& getArg0() { return flags; } typedef FlagGrid type0;inline Grid<Real>& getArg1() { return grid; } typedef Grid<Real> type1; void run() { const int _sz = size;
+} inline FlagGrid& getArg0() { return flags; } typedef FlagGrid type0;inline Grid<Real>& getArg1() { return grid; } typedef Grid<Real> type1; void runMessage() { debMsg("Executing kernel InvertCheckFluid ", 2); debMsg("Kernel range" << " x "<< maxX << " y "<< maxY << " z "<< minZ<<" - "<< maxZ << " " , 3); }; void run() { const IndexInt _sz = size;
#pragma omp parallel
- { this->threadId = omp_get_thread_num(); this->threadNum = omp_get_num_threads();
+ {
#pragma omp for
- for (int i=0; i < _sz; i++) op(i,flags,grid); } } FlagGrid& flags; Grid<Real>& grid; };
+ for (IndexInt i = 0; i < _sz; i++) op(i,flags,grid); } } FlagGrid& flags; Grid<Real>& grid; };
#line 26 "commonkernels.h"
//! Kernel: Squared sum over grid
- struct GridSumSqr : public KernelBase { GridSumSqr(Grid<Real>& grid) : KernelBase(&grid,0) ,grid(grid) ,sum(0) { run(); } inline void op(int idx, Grid<Real>& grid ,double& sum) {
+ struct GridSumSqr : public KernelBase { GridSumSqr(Grid<Real>& grid) : KernelBase(&grid,0) ,grid(grid) ,sum(0) { runMessage(); run(); } inline void op(IndexInt idx, Grid<Real>& grid ,double& sum) {
sum += square((double)grid[idx]);
-} inline operator double () { return sum; } inline double & getRet() { return sum; } inline Grid<Real>& getArg0() { return grid; } typedef Grid<Real> type0; void run() { const int _sz = size;
+} inline operator double () { return sum; } inline double & getRet() { return sum; } inline Grid<Real>& getArg0() { return grid; } typedef Grid<Real> type0; void runMessage() { debMsg("Executing kernel GridSumSqr ", 2); debMsg("Kernel range" << " x "<< maxX << " y "<< maxY << " z "<< minZ<<" - "<< maxZ << " " , 3); }; void run() { const IndexInt _sz = size;
#pragma omp parallel
- { this->threadId = omp_get_thread_num(); this->threadNum = omp_get_num_threads(); double sum = 0;
+ { double sum = 0;
#pragma omp for nowait
- for (int i=0; i < _sz; i++) op(i,grid,sum);
+ for (IndexInt i = 0; i < _sz; i++) op(i,grid,sum);
#pragma omp critical
-{this->sum += sum; } } } Grid<Real>& grid; double sum; };
+{this->sum += sum; } } } Grid<Real>& grid; double sum; };
#line 33 "commonkernels.h"
//! Kernel: rotation operator \nabla x v for centered vector fields
- struct CurlOp : public KernelBase { CurlOp(const Grid<Vec3>& grid, Grid<Vec3>& dst) : KernelBase(&grid,1) ,grid(grid),dst(dst) { run(); } inline void op(int i, int j, int k, const Grid<Vec3>& grid, Grid<Vec3>& dst ) {
+ struct CurlOp : public KernelBase { CurlOp(const Grid<Vec3>& grid, Grid<Vec3>& dst) : KernelBase(&grid,1) ,grid(grid),dst(dst) { runMessage(); run(); } inline void op(int i, int j, int k, const Grid<Vec3>& grid, Grid<Vec3>& dst ) {
Vec3 v = Vec3(0. , 0. ,
0.5*((grid(i+1,j,k).y - grid(i-1,j,k).y) - (grid(i,j+1,k).x - grid(i,j-1,k).x)) );
if(dst.is3D()) {
@@ -72,13 +72,13 @@ namespace Manta {
v[1] = 0.5*((grid(i,j,k+1).x - grid(i,j,k-1).x) - (grid(i+1,j,k).z - grid(i-1,j,k).z));
}
dst(i,j,k) = v;
-} inline const Grid<Vec3>& getArg0() { return grid; } typedef Grid<Vec3> type0;inline Grid<Vec3>& getArg1() { return dst; } typedef Grid<Vec3> type1; void run() { const int _maxX = maxX; const int _maxY = maxY; if (maxZ > 1) {
+} inline const Grid<Vec3>& getArg0() { return grid; } typedef Grid<Vec3> type0;inline Grid<Vec3>& getArg1() { return dst; } typedef Grid<Vec3> type1; void runMessage() { debMsg("Executing kernel CurlOp ", 2); debMsg("Kernel range" << " x "<< maxX << " y "<< maxY << " z "<< minZ<<" - "<< maxZ << " " , 3); }; void run() { const int _maxX = maxX; const int _maxY = maxY; if (maxZ > 1) {
#pragma omp parallel
- { this->threadId = omp_get_thread_num(); this->threadNum = omp_get_num_threads();
+ {
#pragma omp for
for (int k=minZ; k < maxZ; k++) for (int j=1; j < _maxY; j++) for (int i=1; i < _maxX; i++) op(i,j,k,grid,dst); } } else { const int k=0;
#pragma omp parallel
- { this->threadId = omp_get_thread_num(); this->threadNum = omp_get_num_threads();
+ {
#pragma omp for
for (int j=1; j < _maxY; j++) for (int i=1; i < _maxX; i++) op(i,j,k,grid,dst); } } } const Grid<Vec3>& grid; Grid<Vec3>& dst; };
#line 39 "commonkernels.h"
@@ -87,18 +87,18 @@ namespace Manta {
//! Kernel: divergence operator (from MAC grid)
- struct DivergenceOpMAC : public KernelBase { DivergenceOpMAC(Grid<Real>& div, const MACGrid& grid) : KernelBase(&div,1) ,div(div),grid(grid) { run(); } inline void op(int i, int j, int k, Grid<Real>& div, const MACGrid& grid ) {
+ struct DivergenceOpMAC : public KernelBase { DivergenceOpMAC(Grid<Real>& div, const MACGrid& grid) : KernelBase(&div,1) ,div(div),grid(grid) { runMessage(); run(); } inline void op(int i, int j, int k, Grid<Real>& div, const MACGrid& grid ) {
Vec3 del = Vec3(grid(i+1,j,k).x, grid(i,j+1,k).y, 0.) - grid(i,j,k);
if(grid.is3D()) del[2] += grid(i,j,k+1).z;
else del[2] = 0.;
div(i,j,k) = del.x + del.y + del.z;
-} inline Grid<Real>& getArg0() { return div; } typedef Grid<Real> type0;inline const MACGrid& getArg1() { return grid; } typedef MACGrid type1; void run() { const int _maxX = maxX; const int _maxY = maxY; if (maxZ > 1) {
+} inline Grid<Real>& getArg0() { return div; } typedef Grid<Real> type0;inline const MACGrid& getArg1() { return grid; } typedef MACGrid type1; void runMessage() { debMsg("Executing kernel DivergenceOpMAC ", 2); debMsg("Kernel range" << " x "<< maxX << " y "<< maxY << " z "<< minZ<<" - "<< maxZ << " " , 3); }; void run() { const int _maxX = maxX; const int _maxY = maxY; if (maxZ > 1) {
#pragma omp parallel
- { this->threadId = omp_get_thread_num(); this->threadNum = omp_get_num_threads();
+ {
#pragma omp for
for (int k=minZ; k < maxZ; k++) for (int j=1; j < _maxY; j++) for (int i=1; i < _maxX; i++) op(i,j,k,div,grid); } } else { const int k=0;
#pragma omp parallel
- { this->threadId = omp_get_thread_num(); this->threadNum = omp_get_num_threads();
+ {
#pragma omp for
for (int j=1; j < _maxY; j++) for (int i=1; i < _maxX; i++) op(i,j,k,div,grid); } } } Grid<Real>& div; const MACGrid& grid; };
#line 51 "commonkernels.h"
@@ -106,18 +106,18 @@ namespace Manta {
//! Kernel: gradient operator for MAC grid
- struct GradientOpMAC : public KernelBase { GradientOpMAC(MACGrid& gradient, const Grid<Real>& grid) : KernelBase(&gradient,1) ,gradient(gradient),grid(grid) { run(); } inline void op(int i, int j, int k, MACGrid& gradient, const Grid<Real>& grid ) {
+ struct GradientOpMAC : public KernelBase { GradientOpMAC(MACGrid& gradient, const Grid<Real>& grid) : KernelBase(&gradient,1) ,gradient(gradient),grid(grid) { runMessage(); run(); } inline void op(int i, int j, int k, MACGrid& gradient, const Grid<Real>& grid ) {
Vec3 grad = (Vec3(grid(i,j,k)) - Vec3(grid(i-1,j,k), grid(i,j-1,k), 0. ));
if(grid.is3D()) grad[2] -= grid(i,j,k-1);
else grad[2] = 0.;
gradient(i,j,k) = grad;
-} inline MACGrid& getArg0() { return gradient; } typedef MACGrid type0;inline const Grid<Real>& getArg1() { return grid; } typedef Grid<Real> type1; void run() { const int _maxX = maxX; const int _maxY = maxY; if (maxZ > 1) {
+} inline MACGrid& getArg0() { return gradient; } typedef MACGrid type0;inline const Grid<Real>& getArg1() { return grid; } typedef Grid<Real> type1; void runMessage() { debMsg("Executing kernel GradientOpMAC ", 2); debMsg("Kernel range" << " x "<< max
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list