[Bf-blender-cvs] [0199f41bc0] fluid-mantaflow: updated mantaflow pp files
Sebastián Barschkis
noreply at git.blender.org
Tue Mar 7 01:26:40 CET 2017
Commit: 0199f41bc0847dd9d632af3e49ba47d228a74b4c
Author: Sebastián Barschkis
Date: Thu Mar 2 13:10:45 2017 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB0199f41bc0847dd9d632af3e49ba47d228a74b4c
updated mantaflow pp files
new mantaflow files require cxx11 option because of new multigrid solver
===================================================================
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/edgecollapse.h.reg.cpp
M intern/mantaflow/intern/manta_pp/fastmarch.cpp
M intern/mantaflow/intern/manta_pp/fastmarch.h
M intern/mantaflow/intern/manta_pp/fastmarch.h.reg.cpp
M intern/mantaflow/intern/manta_pp/fileio.cpp
M intern/mantaflow/intern/manta_pp/fileio.h
M intern/mantaflow/intern/manta_pp/fileio.h.reg.cpp
M intern/mantaflow/intern/manta_pp/fluidsolver.cpp
M intern/mantaflow/intern/manta_pp/fluidsolver.h
M intern/mantaflow/intern/manta_pp/fluidsolver.h.reg.cpp
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.cpp
M intern/mantaflow/intern/manta_pp/grid4d.cpp
M intern/mantaflow/intern/manta_pp/grid4d.h
M intern/mantaflow/intern/manta_pp/grid4d.h.reg.cpp
M intern/mantaflow/intern/manta_pp/kernel.cpp
M intern/mantaflow/intern/manta_pp/kernel.h
M intern/mantaflow/intern/manta_pp/kernel.h.reg.cpp
M intern/mantaflow/intern/manta_pp/levelset.cpp
M intern/mantaflow/intern/manta_pp/levelset.h
M intern/mantaflow/intern/manta_pp/levelset.h.reg.cpp
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.cpp
M intern/mantaflow/intern/manta_pp/movingobs.cpp
M intern/mantaflow/intern/manta_pp/movingobs.h
M intern/mantaflow/intern/manta_pp/movingobs.h.reg.cpp
A intern/mantaflow/intern/manta_pp/multigrid.cpp
A intern/mantaflow/intern/manta_pp/multigrid.h
A intern/mantaflow/intern/manta_pp/multigrid.h.reg
A intern/mantaflow/intern/manta_pp/multigrid.h.reg.cpp
M intern/mantaflow/intern/manta_pp/noisefield.cpp
M intern/mantaflow/intern/manta_pp/noisefield.h
M intern/mantaflow/intern/manta_pp/noisefield.h.reg.cpp
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.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
A intern/mantaflow/intern/manta_pp/plugin/fluidguiding.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
M 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/pclass.cpp
M intern/mantaflow/intern/manta_pp/pwrapper/pconvert.h
M intern/mantaflow/intern/manta_pp/pwrapper/pymain.cpp
M intern/mantaflow/intern/manta_pp/pwrapper/registry.cpp
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/registration.cpp
M intern/mantaflow/intern/manta_pp/shapes.cpp
M intern/mantaflow/intern/manta_pp/shapes.h
M intern/mantaflow/intern/manta_pp/shapes.h.reg.cpp
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/timing.h.reg.cpp
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
A intern/mantaflow/intern/manta_pp/util/rcmatrix.h
M 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
M intern/mantaflow/intern/manta_pp/vortexsheet.h.reg.cpp
===================================================================
diff --git a/intern/mantaflow/CMakeLists.txt b/intern/mantaflow/CMakeLists.txt
index 435b914064..9dbeab1394 100644
--- a/intern/mantaflow/CMakeLists.txt
+++ b/intern/mantaflow/CMakeLists.txt
@@ -106,6 +106,10 @@ set(SRC
intern/manta_pp/movingobs.h
intern/manta_pp/movingobs.h.reg
intern/manta_pp/movingobs.h.reg.cpp
+ intern/manta_pp/multigrid.cpp
+ intern/manta_pp/multigrid.h
+ intern/manta_pp/multigrid.h.reg
+ intern/manta_pp/multigrid.h.reg.cpp
intern/manta_pp/noisefield.cpp
intern/manta_pp/noisefield.h
intern/manta_pp/noisefield.h.reg
@@ -118,6 +122,7 @@ set(SRC
intern/manta_pp/plugin/extforces.cpp
intern/manta_pp/plugin/fire.cpp
intern/manta_pp/plugin/flip.cpp
+ intern/manta_pp/plugin/fluidguiding.cpp
intern/manta_pp/plugin/initplugins.cpp
intern/manta_pp/plugin/kepsilon.cpp
intern/manta_pp/plugin/meshplugins.cpp
@@ -158,6 +163,7 @@ set(SRC
intern/manta_pp/util/mcubes.h
intern/manta_pp/util/quaternion.h
intern/manta_pp/util/randomstream.h
+ intern/manta_pp/util/rcmatrix.h
intern/manta_pp/util/simpleimage.cpp
intern/manta_pp/util/simpleimage.h
intern/manta_pp/util/solvana.h
diff --git a/intern/mantaflow/intern/manta_pp/commonkernels.h b/intern/mantaflow/intern/manta_pp/commonkernels.h
index 6e328d9304..129c9f7891 100644
--- a/intern/mantaflow/intern/manta_pp/commonkernels.h
+++ b/intern/mantaflow/intern/manta_pp/commonkernels.h
@@ -9,7 +9,7 @@
-#line 1 "/Users/sbarschkis/Developer/Mantaflow/mantaflowDevelop/mantaflowgit/source/commonkernels.h"
+#line 1 "/Users/sebbas/Developer/Mantaflow/mantaflowDevelop/mantaflowgit/source/commonkernels.h"
/******************************************************************************
*
* MantaFlow fluid solver framework
@@ -38,10 +38,10 @@ namespace Manta {
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 runMessage() { debMsg("Executing kernel InvertCheckFluid ", 2); debMsg("Kernel range" << " x "<< maxX << " y "<< maxY << " z "<< minZ<<" - "<< maxZ << " " , 3); }; void run() { const IndexInt _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 ", 3); debMsg("Kernel range" << " x "<< maxX << " y "<< maxY << " z "<< minZ<<" - "<< maxZ << " " , 4); }; void run() { const IndexInt _sz = size;
#pragma omp parallel
{
-#pragma omp for
+#pragma omp for
for (IndexInt i = 0; i < _sz; i++) op(i,flags,grid); } } FlagGrid& flags; Grid<Real>& grid; };
#line 26 "commonkernels.h"
@@ -50,11 +50,11 @@ namespace Manta {
//! Kernel: Squared sum over grid
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 runMessage() { debMsg("Executing kernel GridSumSqr ", 2); debMsg("Kernel range" << " x "<< maxX << " y "<< maxY << " z "<< minZ<<" - "<< maxZ << " " , 3); }; void run() { const IndexInt _sz = size;
+ 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 runMessage() { debMsg("Executing kernel GridSumSqr ", 3); debMsg("Kernel range" << " x "<< maxX << " y "<< maxY << " z "<< minZ<<" - "<< maxZ << " " , 4); }; void run() { const IndexInt _sz = size;
#pragma omp parallel
{ double sum = 0;
-#pragma omp for nowait
+#pragma omp for nowait
for (IndexInt i = 0; i < _sz; i++) op(i,grid,sum);
#pragma omp critical
{this->sum += sum; } } } Grid<Real>& grid; double sum; };
@@ -72,14 +72,14 @@ 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 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) {
+} 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 ", 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
+#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
{
-#pragma omp for
+#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"
@@ -92,14 +92,14 @@ namespace Manta {
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 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) {
+} 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 ", 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
+#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
{
-#pragma omp for
+#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"
@@ -111,14 +111,14 @@ namespace Manta {
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 runMessage() { debMsg("Executing kernel GradientOpMAC ", 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) {
+} 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 ", 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
+#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,gradient,grid); } } else { const int k=0;
#pragma omp parallel
{
-#pragma omp for
+#pragma omp for
for (int j=1; j < _maxY; j++) for (int i=1; i < _maxX; i++) op(i,j,k,gradient,grid); } } } MACGrid& gradient; const Grid<Real>& grid; };
#line 59 "commonkernels.h"
@@ -130,14 +130,14 @@ namespace Manta {
grid(i,j+1,k)-grid(i,j-1,k), 0.);
if(grid.is3D()) grad[2]= 0.5*( grid(i,j,k+1)-grid(i,j,k-1) );
gradient(i,j,k) = grad;
-} inline Grid<Vec3>& getArg0() { return gradient; } typedef Grid<Vec3> type0;inline const Grid<Real>& getArg1() { return grid; } typedef Grid<Real> type1; void runMessage() { debMsg("Executing kernel GradientOp ", 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) {
+} inline Grid<Vec3>& getArg0() { return gradient; } typedef Grid<Vec3> type0;inline const Grid<Real>& getArg1() { return grid; } typedef Grid<Real> type1; void runMessage() { debMsg("Executing kernel GradientOp ", 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
+#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,gradient,grid); } } else { const int k=0;
#pragma omp parallel
{
-#pragma omp for
+#pragma omp for
for (int j=1; j < _maxY; j++) for (int i=1; i < _maxX; i++) op(i,j,k,gradient,grid); } } } Grid<Vec3>& gradient; const Grid<Real>& grid; };
#line 67 "commonkernels.h"
@@ -145,15 +145,18 @@ namespace Manta {
//! Kernel: Laplace operator
struct LaplaceOp : public KernelBase { LaplaceOp(Grid<Real>& laplace, const Grid<Real>& grid) : KernelBase(&laplace,1) ,laplace(laplace),grid(grid) { runMessage(); run();
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list