[Bf-blender-cvs] [5c03ccfc069] fluid-mantaflow: Mantaflow: Updated manta pp files
Sebastián Barschkis
noreply at git.blender.org
Wed Nov 20 14:40:00 CET 2019
Commit: 5c03ccfc069f4dc915a5b28c8a001712e89d90fb
Author: Sebastián Barschkis
Date: Wed Nov 20 12:41:25 2019 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rB5c03ccfc069f4dc915a5b28c8a001712e89d90fb
Mantaflow: Updated manta pp files
===================================================================
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/grid.h.reg
M intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h.reg.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/omp/mesh.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/extforces.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/fluidguiding.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/initplugins.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/omp/plugin/pressure.cpp
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/grid.h.reg
M intern/mantaflow/intern/manta_develop/preprocessed/tbb/grid.h.reg.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/tbb/mesh.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/tbb/plugin/extforces.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/tbb/plugin/fluidguiding.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/tbb/plugin/initplugins.cpp
M intern/mantaflow/intern/manta_develop/preprocessed/tbb/plugin/pressure.cpp
===================================================================
diff --git a/intern/mantaflow/intern/manta_develop/preprocessed/omp/gitinfo.h b/intern/mantaflow/intern/manta_develop/preprocessed/omp/gitinfo.h
index 8c1a007650f..38991df3ca7 100644
--- a/intern/mantaflow/intern/manta_develop/preprocessed/omp/gitinfo.h
+++ b/intern/mantaflow/intern/manta_develop/preprocessed/omp/gitinfo.h
@@ -1,3 +1,3 @@
-#define MANTA_GIT_VERSION "commit 9b5f026ea0362355499c4734bf5a9fda959e66a9"
+#define MANTA_GIT_VERSION "commit dd8240da1f8acc6d39a70035755633dc5697ffe3"
diff --git a/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.cpp b/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.cpp
index ae448776365..98a19c95659 100644
--- a/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.cpp
+++ b/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.cpp
@@ -788,7 +788,7 @@ template<class T> struct knPermuteAxes : public KernelBase {
int i0 = axis0 == 0 ? i : (axis0 == 1 ? j : k);
int i1 = axis1 == 0 ? i : (axis1 == 1 ? j : k);
int i2 = axis2 == 0 ? i : (axis2 == 1 ? j : k);
- target(i, j, k) = self(i0, i1, i2);
+ target(i0, i1, i2) = self(i, j, k);
}
inline Grid<T> &getArg0()
{
@@ -918,6 +918,20 @@ template<class T> void Grid<T>::permuteAxes(int axis0, int axis1, int axis2)
knPermuteAxes<T>(*this, tmp, axis0, axis1, axis2);
this->swap(tmp);
}
+template<class T>
+void Grid<T>::permuteAxesCopyToGrid(int axis0, int axis1, int axis2, Grid<T> &out)
+{
+ if (axis0 == axis1 || axis0 == axis2 || axis1 == axis2 || axis0 > 2 || axis1 > 2 || axis2 > 2 ||
+ axis0 < 0 || axis1 < 0 || axis2 < 0)
+ return;
+ assertMsg(this->getGridType() == out.getGridType(), "Grids must have same data type!");
+ Vec3i size = mParent->getGridSize();
+ Vec3i sizeTarget = out.getParent()->getGridSize();
+ assertMsg(sizeTarget[axis0] == size[0] && sizeTarget[axis1] == size[1] &&
+ sizeTarget[axis2] == size[2],
+ "Permuted grids must have the same dimensions!");
+ knPermuteAxes<T>(*this, out, axis0, axis1, axis2);
+}
template<> Real Grid<Real>::getMax() const
{
diff --git a/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h b/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h
index 3a9b21b73f0..a0b88efe6ad 100644
--- a/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h
+++ b/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h
@@ -910,10 +910,40 @@ template<class T> class Grid : public GridBase {
}
}
+ //! permute grid axes, e.g. switch y with z (0,2,1)
+ void permuteAxesCopyToGrid(int axis0, int axis1, int axis2, Grid<T> &out);
+ static PyObject *_W_25(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ {
+ try {
+ PbArgs _args(_linargs, _kwds);
+ Grid *pbo = dynamic_cast<Grid *>(Pb::objFromPy(_self));
+ bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
+ pbPreparePlugin(pbo->getParent(), "Grid::permuteAxesCopyToGrid", !noTiming);
+ PyObject *_retval = 0;
+ {
+ ArgLocker _lock;
+ int axis0 = _args.get<int>("axis0", 0, &_lock);
+ int axis1 = _args.get<int>("axis1", 1, &_lock);
+ int axis2 = _args.get<int>("axis2", 2, &_lock);
+ Grid<T> &out = *_args.getPtr<Grid<T>>("out", 3, &_lock);
+ pbo->_args.copy(_args);
+ _retval = getPyNone();
+ pbo->permuteAxesCopyToGrid(axis0, axis1, axis2, out);
+ pbo->_args.check();
+ }
+ pbFinalizePlugin(pbo->getParent(), "Grid::permuteAxesCopyToGrid", !noTiming);
+ return _retval;
+ }
+ catch (std::exception &e) {
+ pbSetError("Grid::permuteAxesCopyToGrid", e.what());
+ return 0;
+ }
+ }
+
// common compound operators
//! get absolute max value in grid
Real getMaxAbs() const;
- static PyObject *_W_25(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_26(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -938,7 +968,7 @@ template<class T> class Grid : public GridBase {
//! get max value in grid
Real getMax() const;
- static PyObject *_W_26(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_27(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -963,7 +993,7 @@ template<class T> class Grid : public GridBase {
//! get min value in grid
Real getMin() const;
- static PyObject *_W_27(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_28(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -988,7 +1018,7 @@ template<class T> class Grid : public GridBase {
//! calculate L1 norm of grid content
Real getL1(int bnd = 0);
- static PyObject *_W_28(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_29(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1014,7 +1044,7 @@ template<class T> class Grid : public GridBase {
//! calculate L2 norm of grid content
Real getL2(int bnd = 0);
- static PyObject *_W_29(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_30(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1040,7 +1070,7 @@ template<class T> class Grid : public GridBase {
//! set all boundary cells to constant value (Dirichlet)
void setBound(T value, int boundaryWidth = 1);
- static PyObject *_W_30(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_31(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1068,7 +1098,7 @@ template<class T> class Grid : public GridBase {
//! set all boundary cells to last inner value (Neumann)
void setBoundNeumann(int boundaryWidth = 1);
- static PyObject *_W_31(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_32(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1095,7 +1125,7 @@ template<class T> class Grid : public GridBase {
//! get data pointer of grid
std::string getDataPointer();
- static PyObject *_W_32(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_33(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1120,7 +1150,7 @@ template<class T> class Grid : public GridBase {
//! debugging helper, print grid from python. skip boundary of width bnd
void printGrid(int zSlice = -1, bool printIndex = false, int bnd = 1);
- static PyObject *_W_33(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_34(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1189,7 +1219,7 @@ class MACGrid : public Grid<Vec3> {
{
mType = (GridType)(TypeMAC | TypeVec3);
}
- static int _W_34(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static int _W_35(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
PbClass *obj = Pb::objFromPy(_self);
if (obj)
@@ -1271,7 +1301,7 @@ class MACGrid : public Grid<Vec3> {
//! set all boundary cells of a MAC grid to certain value (Dirchlet). Respects staggered grid
//! locations optionally, only set normal components
void setBoundMAC(Vec3 value, int boundaryWidth, bool normalOnly = false);
- static PyObject *_W_35(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_36(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1312,7 +1342,7 @@ class FlagGrid : public Grid<int> {
{
mType = (GridType)(TypeFlags | TypeInt);
}
- static int _W_36(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static int _W_37(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
PbClass *obj = Pb::objFromPy(_self);
if (obj)
@@ -1492,7 +1522,7 @@ class FlagGrid : public Grid<int> {
const std::string &inflow = " ",
const std::string &outflow = " ",
Grid<Real> *phiWalls = 0x00);
- static PyObject *_W_37(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_38(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1526,7 +1556,7 @@ class FlagGrid : public Grid<int> {
//! set fluid flags inside levelset (liquids)
void updateFromLevelset(LevelsetGrid &levelset);
- static PyObject *_W_38(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_39(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1553,7 +1583,7 @@ class FlagGrid : public Grid<int> {
//! set all cells (except obs/in/outflow) to type (fluid by default)
void fillGrid(int type = TypeFluid);
- static PyObject *_W_39(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_40(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1582,7 +1612,7 @@ class FlagGrid : public Grid<int> {
//! warning for large grids! only regular int returned (due to python interface)
//! optionally creates mask in RealGrid (1 where flag matches, 0 otherwise)
int countCells(int flag, int bnd = 0, Grid<Real> *mask = NULL);
- static PyObject *_W_40(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_41(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
diff --git a/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h.reg b/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h.reg
index f0fe197f218..a72c690f308 100644
--- a/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h.reg
+++ b/intern/mantaflow/intern/manta_develop/preprocessed/omp/grid.h.reg
@@ -35,27 +35,29 @@ template<> const char *Namify<Grid<$CT$>>::S = "Grid<$CT$>";
+ Grid ^ static const Pb::
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list