Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/mantaflow/preprocessed')
-rw-r--r--extern/mantaflow/preprocessed/fileio/iogrids.cpp43
-rw-r--r--extern/mantaflow/preprocessed/fileio/iomeshes.cpp19
-rw-r--r--extern/mantaflow/preprocessed/fileio/ioparticles.cpp1
-rw-r--r--extern/mantaflow/preprocessed/fileio/ioutil.cpp21
-rw-r--r--extern/mantaflow/preprocessed/gitinfo.h2
-rw-r--r--extern/mantaflow/preprocessed/mesh.cpp38
-rw-r--r--extern/mantaflow/preprocessed/mesh.h117
-rw-r--r--extern/mantaflow/preprocessed/mesh.h.reg.cpp16
-rw-r--r--extern/mantaflow/preprocessed/particle.cpp6
-rw-r--r--extern/mantaflow/preprocessed/particle.h108
-rw-r--r--extern/mantaflow/preprocessed/particle.h.reg.cpp227
-rw-r--r--extern/mantaflow/preprocessed/plugin/initplugins.cpp144
-rw-r--r--extern/mantaflow/preprocessed/registration.cpp4
13 files changed, 446 insertions, 300 deletions
diff --git a/extern/mantaflow/preprocessed/fileio/iogrids.cpp b/extern/mantaflow/preprocessed/fileio/iogrids.cpp
index e2550d6db8b..825ce0ae8b5 100644
--- a/extern/mantaflow/preprocessed/fileio/iogrids.cpp
+++ b/extern/mantaflow/preprocessed/fileio/iogrids.cpp
@@ -27,7 +27,10 @@ extern "C" {
}
#endif
-#include "cnpy.h"
+#if NO_CNPY != 1
+# include "cnpy.h"
+#endif
+
#include "mantaio.h"
#include "grid.h"
#include "vector4d.h"
@@ -965,12 +968,16 @@ int readGrid4dUni(
};
void readGrid4dUniCleanup(void **fileHandle)
{
+#if NO_ZLIB != 1
gzFile gzf = NULL;
if (fileHandle) {
gzf = (gzFile)(*fileHandle);
gzclose(gzf);
*fileHandle = NULL;
}
+#else
+ debMsg("file format not supported without zlib", 1);
+#endif
}
template<class T> int writeGrid4dRaw(const string &name, Grid4d<T> *grid)
@@ -1021,15 +1028,13 @@ template<class T> int readGrid4dRaw(const string &name, Grid4d<T> *grid)
template<class T> int writeGridNumpy(const string &name, Grid<T> *grid)
{
-#if NO_ZLIB == 1
- debMsg("file format not supported without zlib", 1);
- return 0;
-#endif
+
#if FLOATINGPOINT_PRECISION != 1
errMsg("writeGridNumpy: Double precision not yet supported");
return 0;
#endif
+#if NO_CNPY != 1
// find suffix to differentiate between npy <-> npz , TODO: check for actual "npy" string
std::string::size_type idx;
bool bUseNpz = false;
@@ -1075,19 +1080,21 @@ template<class T> int writeGridNumpy(const string &name, Grid<T> *grid)
cnpy::npy_save(name, &grid[0], shape, "w");
}
return 1;
-};
+#else
+ debMsg("file format not supported without cnpy", 1);
+ return 0;
+#endif
+}
template<class T> int readGridNumpy(const string &name, Grid<T> *grid)
{
-#if NO_ZLIB == 1
- debMsg("file format not supported without zlib", 1);
- return 0;
-#endif
+
#if FLOATINGPOINT_PRECISION != 1
errMsg("readGridNumpy: Double precision not yet supported");
return 0;
#endif
+#if NO_CNPY != 1
// find suffix to differentiate between npy <-> npz
std::string::size_type idx;
bool bUseNpz = false;
@@ -1144,7 +1151,11 @@ template<class T> int readGridNumpy(const string &name, Grid<T> *grid)
gridArr.data<T>(),
sizeof(T) * grid->getSizeX() * grid->getSizeY() * grid->getSizeZ());
return 1;
-};
+#else
+ debMsg("file format not supported without cnpy", 1);
+ return 0;
+#endif
+}
int writeGridsNumpy(const string &name, std::vector<PbClass *> *grids)
{
@@ -1163,13 +1174,12 @@ void getNpzFileSize(
const string &name, int &x, int &y, int &z, int *t = NULL, std::string *info = NULL)
{
x = y = z = 0;
-#if NO_ZLIB != 1
- debMsg("file format not supported without zlib", 1);
- return;
-#endif
+
#if FLOATINGPOINT_PRECISION != 1
errMsg("getNpzFileSize: Double precision not yet supported");
#endif
+
+#if NO_CNPY != 1
// find suffix to differentiate between npy <-> npz
cnpy::NpyArray gridArr;
cnpy::npz_t fNpz = cnpy::npz_load(name);
@@ -1180,6 +1190,9 @@ void getNpzFileSize(
x = gridArr.shape[2];
if (t)
(*t) = 0; // unused for now
+#else
+ debMsg("file format not supported without cnpy", 1);
+#endif
}
Vec3 getNpzFileSize(const string &name)
{
diff --git a/extern/mantaflow/preprocessed/fileio/iomeshes.cpp b/extern/mantaflow/preprocessed/fileio/iomeshes.cpp
index 1c50376de77..b5e51625077 100644
--- a/extern/mantaflow/preprocessed/fileio/iomeshes.cpp
+++ b/extern/mantaflow/preprocessed/fileio/iomeshes.cpp
@@ -315,10 +315,14 @@ int readObjFile(const std::string &name, Mesh *mesh, bool append)
return 0;
}
+ const Real dx = mesh->getParent()->getDx();
+ const Vec3 gs = toVec3(mesh->getParent()->getGridSize());
+
if (!append)
mesh->clear();
int nodebase = mesh->numNodes();
- int cnt = nodebase;
+ int cntNodes = nodebase, cntNormals = nodebase;
+
while (ifs.good() && !ifs.eof()) {
string id;
ifs >> id;
@@ -333,19 +337,23 @@ int readObjFile(const std::string &name, Mesh *mesh, bool append)
}
else if (id == "vn") {
// normals
- if (!mesh->numNodes()) {
+ if (mesh->numNodes() != cntNodes) {
errMsg("invalid amount of nodes");
return 0;
}
- Node n = mesh->nodes(cnt);
- ifs >> n.normal.x >> n.normal.y >> n.normal.z;
- cnt++;
+ Node *n = &mesh->nodes(cntNormals);
+ ifs >> n->normal.x >> n->normal.y >> n->normal.z;
+ cntNormals++;
}
else if (id == "v") {
// vertex
Node n;
ifs >> n.pos.x >> n.pos.y >> n.pos.z;
+ // convert to grid space
+ n.pos /= dx;
+ n.pos += gs * 0.5;
mesh->addNode(n);
+ cntNodes++;
}
else if (id == "g") {
// group
@@ -408,7 +416,6 @@ int writeObjFile(const string &name, Mesh *mesh)
// write normals
for (int i = 0; i < numVerts; i++) {
Vector3D<float> n = toVec3f(mesh->nodes(i).normal);
- // normalize to unit cube around 0
ofs << "vn " << n.value[0] << " " << n.value[1] << " " << n.value[2] << " "
<< "\n";
}
diff --git a/extern/mantaflow/preprocessed/fileio/ioparticles.cpp b/extern/mantaflow/preprocessed/fileio/ioparticles.cpp
index 84283a25b07..36e10aa1644 100644
--- a/extern/mantaflow/preprocessed/fileio/ioparticles.cpp
+++ b/extern/mantaflow/preprocessed/fileio/ioparticles.cpp
@@ -322,6 +322,7 @@ template<class T> int readPdataUni(const std::string &name, ParticleDataImpl<T>
UniPartHeader head;
assertMsg(gzread(gzf, &head, sizeof(UniPartHeader)) == sizeof(UniPartHeader),
"can't read file, no header present");
+ pdata->getParticleSys()->resize(head.dim); // ensure that parent particle system has same size
pdata->resize(head.dim);
assertMsg(head.dim == pdata->size(), "pdata size doesn't match");
diff --git a/extern/mantaflow/preprocessed/fileio/ioutil.cpp b/extern/mantaflow/preprocessed/fileio/ioutil.cpp
index cc63cf87ac1..cf40d71fcc4 100644
--- a/extern/mantaflow/preprocessed/fileio/ioutil.cpp
+++ b/extern/mantaflow/preprocessed/fileio/ioutil.cpp
@@ -26,17 +26,18 @@
extern "C" {
# include <zlib.h>
}
+#endif
-# if defined(WIN32) || defined(_WIN32)
-# include <windows.h>
-# include <string>
-# endif
+#if defined(WIN32) || defined(_WIN32)
+# include <windows.h>
+# include <string>
+#endif
using namespace std;
namespace Manta {
-# if defined(WIN32) || defined(_WIN32)
+#if defined(WIN32) || defined(_WIN32)
static wstring stringToWstring(const char *str)
{
const int length_wc = MultiByteToWideChar(CP_UTF8, 0, str, strlen(str), NULL, 0);
@@ -44,10 +45,11 @@ static wstring stringToWstring(const char *str)
MultiByteToWideChar(CP_UTF8, 0, str, strlen(str), &strWide[0], length_wc);
return strWide;
}
-# endif // WIN32==1
+#endif // WIN32==1
void *safeGzopen(const char *filename, const char *mode)
{
+#if NO_ZLIB != 1
gzFile gzfile;
# if defined(WIN32) || defined(_WIN32)
@@ -58,8 +60,11 @@ void *safeGzopen(const char *filename, const char *mode)
# endif
return gzfile;
-}
+#else
+ debMsg("safeGzopen not supported without zlib", 1);
+ return nullptr;
#endif // NO_ZLIB != 1
+}
#if defined(OPENVDB)
// Convert from OpenVDB value to Manta value.
@@ -109,4 +114,4 @@ template<> void convertTo(openvdb::Vec3s *out, Vec3 &in)
}
#endif // OPENVDB==1
-} // namespace
+} // namespace Manta
diff --git a/extern/mantaflow/preprocessed/gitinfo.h b/extern/mantaflow/preprocessed/gitinfo.h
index 73ff70b10a0..ce088d6c400 100644
--- a/extern/mantaflow/preprocessed/gitinfo.h
+++ b/extern/mantaflow/preprocessed/gitinfo.h
@@ -1,3 +1,3 @@
-#define MANTA_GIT_VERSION "commit d80d3c821de74315ab26b5efd153d41477b976c4"
+#define MANTA_GIT_VERSION "commit 841bfd09c068dfb95637c0ec14fa78305286a433"
diff --git a/extern/mantaflow/preprocessed/mesh.cpp b/extern/mantaflow/preprocessed/mesh.cpp
index d93c2ac04c0..6a9b0283bef 100644
--- a/extern/mantaflow/preprocessed/mesh.cpp
+++ b/extern/mantaflow/preprocessed/mesh.cpp
@@ -213,34 +213,36 @@ Mesh &Mesh::operator=(const Mesh &o)
return *this;
}
-void Mesh::load(string name, bool append)
+int Mesh::load(string name, bool append)
{
if (name.find_last_of('.') == string::npos)
errMsg("file '" + name + "' does not have an extension");
string ext = name.substr(name.find_last_of('.'));
if (ext == ".gz") // assume bobj gz
- readBobjFile(name, this, append);
+ return readBobjFile(name, this, append);
else if (ext == ".obj")
- readObjFile(name, this, append);
+ return readObjFile(name, this, append);
else
errMsg("file '" + name + "' filetype not supported");
// dont always rebuild...
// rebuildCorners();
// rebuildLookup();
+ return 0;
}
-void Mesh::save(string name)
+int Mesh::save(string name)
{
if (name.find_last_of('.') == string::npos)
errMsg("file '" + name + "' does not have an extension");
string ext = name.substr(name.find_last_of('.'));
if (ext == ".obj")
- writeObjFile(name, this);
+ return writeObjFile(name, this);
else if (ext == ".gz")
- writeBobjFile(name, this);
+ return writeBobjFile(name, this);
else
errMsg("file '" + name + "' filetype not supported");
+ return 0;
}
void Mesh::fromShape(Shape &shape, bool append)
@@ -1339,8 +1341,8 @@ template<class T> void MeshDataImpl<T>::setSource(Grid<T> *grid, bool isMAC)
{
mpGridSource = grid;
mGridSourceMAC = isMAC;
- if (isMAC)
- assertMsg(dynamic_cast<MACGrid *>(grid) != NULL, "Given grid is not a valid MAC grid");
+ if (grid && isMAC)
+ assertMsg(grid->getType() & GridBase::TypeMAC, "Given grid is not a valid MAC grid");
}
template<class T> void MeshDataImpl<T>::initNewValue(IndexInt idx, Vec3 pos)
@@ -1371,38 +1373,40 @@ void Mesh::updateDataFields()
for (size_t i = 0; i < mNodes.size(); ++i) {
Vec3 pos = mNodes[i].pos;
for (IndexInt md = 0; md < (IndexInt)mMdataReal.size(); ++md)
- mMdataReal[md]->initNewValue(i, mNodes[i].pos);
+ mMdataReal[md]->initNewValue(i, pos);
for (IndexInt md = 0; md < (IndexInt)mMdataVec3.size(); ++md)
- mMdataVec3[md]->initNewValue(i, mNodes[i].pos);
+ mMdataVec3[md]->initNewValue(i, pos);
for (IndexInt md = 0; md < (IndexInt)mMdataInt.size(); ++md)
- mMdataInt[md]->initNewValue(i, mNodes[i].pos);
+ mMdataInt[md]->initNewValue(i, pos);
}
}
-template<typename T> void MeshDataImpl<T>::load(string name)
+template<typename T> int MeshDataImpl<T>::load(string name)
{
if (name.find_last_of('.') == string::npos)
errMsg("file '" + name + "' does not have an extension");
string ext = name.substr(name.find_last_of('.'));
if (ext == ".uni")
- readMdataUni<T>(name, this);
+ return readMdataUni<T>(name, this);
else if (ext == ".raw") // raw = uni for now
- readMdataUni<T>(name, this);
+ return readMdataUni<T>(name, this);
else
errMsg("mesh data '" + name + "' filetype not supported for loading");
+ return 0;
}
-template<typename T> void MeshDataImpl<T>::save(string name)
+template<typename T> int MeshDataImpl<T>::save(string name)
{
if (name.find_last_of('.') == string::npos)
errMsg("file '" + name + "' does not have an extension");
string ext = name.substr(name.find_last_of('.'));
if (ext == ".uni")
- writeMdataUni<T>(name, this);
+ return writeMdataUni<T>(name, this);
else if (ext == ".raw") // raw = uni for now
- writeMdataUni<T>(name, this);
+ return writeMdataUni<T>(name, this);
else
errMsg("mesh data '" + name + "' filetype not supported for saving");
+ return 0;
}
// specializations
diff --git a/extern/mantaflow/preprocessed/mesh.h b/extern/mantaflow/preprocessed/mesh.h
index f49619515ce..4235b9508af 100644
--- a/extern/mantaflow/preprocessed/mesh.h
+++ b/extern/mantaflow/preprocessed/mesh.h
@@ -240,215 +240,214 @@ class Mesh : public PbClass {
}
}
- void load(std::string name, bool append = false);
+ void fromShape(Shape &shape, bool append = false);
static PyObject *_W_2(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::load", !noTiming);
+ pbPreparePlugin(pbo->getParent(), "Mesh::fromShape", !noTiming);
PyObject *_retval = 0;
{
ArgLocker _lock;
- std::string name = _args.get<std::string>("name", 0, &_lock);
+ Shape &shape = *_args.getPtr<Shape>("shape", 0, &_lock);
bool append = _args.getOpt<bool>("append", 1, false, &_lock);
pbo->_args.copy(_args);
_retval = getPyNone();
- pbo->load(name, append);
+ pbo->fromShape(shape, append);
pbo->_args.check();
}
- pbFinalizePlugin(pbo->getParent(), "Mesh::load", !noTiming);
+ pbFinalizePlugin(pbo->getParent(), "Mesh::fromShape", !noTiming);
return _retval;
}
catch (std::exception &e) {
- pbSetError("Mesh::load", e.what());
+ pbSetError("Mesh::fromShape", e.what());
return 0;
}
}
- void fromShape(Shape &shape, bool append = false);
+ void advectInGrid(FlagGrid &flags, MACGrid &vel, int integrationMode);
static PyObject *_W_3(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::fromShape", !noTiming);
+ pbPreparePlugin(pbo->getParent(), "Mesh::advectInGrid", !noTiming);
PyObject *_retval = 0;
{
ArgLocker _lock;
- Shape &shape = *_args.getPtr<Shape>("shape", 0, &_lock);
- bool append = _args.getOpt<bool>("append", 1, false, &_lock);
+ FlagGrid &flags = *_args.getPtr<FlagGrid>("flags", 0, &_lock);
+ MACGrid &vel = *_args.getPtr<MACGrid>("vel", 1, &_lock);
+ int integrationMode = _args.get<int>("integrationMode", 2, &_lock);
pbo->_args.copy(_args);
_retval = getPyNone();
- pbo->fromShape(shape, append);
+ pbo->advectInGrid(flags, vel, integrationMode);
pbo->_args.check();
}
- pbFinalizePlugin(pbo->getParent(), "Mesh::fromShape", !noTiming);
+ pbFinalizePlugin(pbo->getParent(), "Mesh::advectInGrid", !noTiming);
return _retval;
}
catch (std::exception &e) {
- pbSetError("Mesh::fromShape", e.what());
+ pbSetError("Mesh::advectInGrid", e.what());
return 0;
}
}
- void save(std::string name);
+ void scale(Vec3 s);
static PyObject *_W_4(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::save", !noTiming);
+ pbPreparePlugin(pbo->getParent(), "Mesh::scale", !noTiming);
PyObject *_retval = 0;
{
ArgLocker _lock;
- std::string name = _args.get<std::string>("name", 0, &_lock);
+ Vec3 s = _args.get<Vec3>("s", 0, &_lock);
pbo->_args.copy(_args);
_retval = getPyNone();
- pbo->save(name);
+ pbo->scale(s);
pbo->_args.check();
}
- pbFinalizePlugin(pbo->getParent(), "Mesh::save", !noTiming);
+ pbFinalizePlugin(pbo->getParent(), "Mesh::scale", !noTiming);
return _retval;
}
catch (std::exception &e) {
- pbSetError("Mesh::save", e.what());
+ pbSetError("Mesh::scale", e.what());
return 0;
}
}
- void advectInGrid(FlagGrid &flags, MACGrid &vel, int integrationMode);
+ void offset(Vec3 o);
static PyObject *_W_5(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::advectInGrid", !noTiming);
+ pbPreparePlugin(pbo->getParent(), "Mesh::offset", !noTiming);
PyObject *_retval = 0;
{
ArgLocker _lock;
- FlagGrid &flags = *_args.getPtr<FlagGrid>("flags", 0, &_lock);
- MACGrid &vel = *_args.getPtr<MACGrid>("vel", 1, &_lock);
- int integrationMode = _args.get<int>("integrationMode", 2, &_lock);
+ Vec3 o = _args.get<Vec3>("o", 0, &_lock);
pbo->_args.copy(_args);
_retval = getPyNone();
- pbo->advectInGrid(flags, vel, integrationMode);
+ pbo->offset(o);
pbo->_args.check();
}
- pbFinalizePlugin(pbo->getParent(), "Mesh::advectInGrid", !noTiming);
+ pbFinalizePlugin(pbo->getParent(), "Mesh::offset", !noTiming);
return _retval;
}
catch (std::exception &e) {
- pbSetError("Mesh::advectInGrid", e.what());
+ pbSetError("Mesh::offset", e.what());
return 0;
}
}
- void scale(Vec3 s);
+ void rotate(Vec3 thetas);
static PyObject *_W_6(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::scale", !noTiming);
+ pbPreparePlugin(pbo->getParent(), "Mesh::rotate", !noTiming);
PyObject *_retval = 0;
{
ArgLocker _lock;
- Vec3 s = _args.get<Vec3>("s", 0, &_lock);
+ Vec3 thetas = _args.get<Vec3>("thetas", 0, &_lock);
pbo->_args.copy(_args);
_retval = getPyNone();
- pbo->scale(s);
+ pbo->rotate(thetas);
pbo->_args.check();
}
- pbFinalizePlugin(pbo->getParent(), "Mesh::scale", !noTiming);
+ pbFinalizePlugin(pbo->getParent(), "Mesh::rotate", !noTiming);
return _retval;
}
catch (std::exception &e) {
- pbSetError("Mesh::scale", e.what());
+ pbSetError("Mesh::rotate", e.what());
return 0;
}
}
- void offset(Vec3 o);
+ void computeVelocity(Mesh &oldMesh, MACGrid &vel);
static PyObject *_W_7(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::offset", !noTiming);
+ pbPreparePlugin(pbo->getParent(), "Mesh::computeVelocity", !noTiming);
PyObject *_retval = 0;
{
ArgLocker _lock;
- Vec3 o = _args.get<Vec3>("o", 0, &_lock);
+ Mesh &oldMesh = *_args.getPtr<Mesh>("oldMesh", 0, &_lock);
+ MACGrid &vel = *_args.getPtr<MACGrid>("vel", 1, &_lock);
pbo->_args.copy(_args);
_retval = getPyNone();
- pbo->offset(o);
+ pbo->computeVelocity(oldMesh, vel);
pbo->_args.check();
}
- pbFinalizePlugin(pbo->getParent(), "Mesh::offset", !noTiming);
+ pbFinalizePlugin(pbo->getParent(), "Mesh::computeVelocity", !noTiming);
return _retval;
}
catch (std::exception &e) {
- pbSetError("Mesh::offset", e.what());
+ pbSetError("Mesh::computeVelocity", e.what());
return 0;
}
}
- void rotate(Vec3 thetas);
+ //! file io
+ int load(std::string name, bool append = false);
static PyObject *_W_8(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::rotate", !noTiming);
+ pbPreparePlugin(pbo->getParent(), "Mesh::load", !noTiming);
PyObject *_retval = 0;
{
ArgLocker _lock;
- Vec3 thetas = _args.get<Vec3>("thetas", 0, &_lock);
+ std::string name = _args.get<std::string>("name", 0, &_lock);
+ bool append = _args.getOpt<bool>("append", 1, false, &_lock);
pbo->_args.copy(_args);
- _retval = getPyNone();
- pbo->rotate(thetas);
+ _retval = toPy(pbo->load(name, append));
pbo->_args.check();
}
- pbFinalizePlugin(pbo->getParent(), "Mesh::rotate", !noTiming);
+ pbFinalizePlugin(pbo->getParent(), "Mesh::load", !noTiming);
return _retval;
}
catch (std::exception &e) {
- pbSetError("Mesh::rotate", e.what());
+ pbSetError("Mesh::load", e.what());
return 0;
}
}
- void computeVelocity(Mesh &oldMesh, MACGrid &vel);
+ int save(std::string name);
static PyObject *_W_9(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::computeVelocity", !noTiming);
+ pbPreparePlugin(pbo->getParent(), "Mesh::save", !noTiming);
PyObject *_retval = 0;
{
ArgLocker _lock;
- Mesh &oldMesh = *_args.getPtr<Mesh>("oldMesh", 0, &_lock);
- MACGrid &vel = *_args.getPtr<MACGrid>("vel", 1, &_lock);
+ std::string name = _args.get<std::string>("name", 0, &_lock);
pbo->_args.copy(_args);
- _retval = getPyNone();
- pbo->computeVelocity(oldMesh, vel);
+ _retval = toPy(pbo->save(name));
pbo->_args.check();
}
- pbFinalizePlugin(pbo->getParent(), "Mesh::computeVelocity", !noTiming);
+ pbFinalizePlugin(pbo->getParent(), "Mesh::save", !noTiming);
return _retval;
}
catch (std::exception &e) {
- pbSetError("Mesh::computeVelocity", e.what());
+ pbSetError("Mesh::save", e.what());
return 0;
}
}
@@ -1564,7 +1563,7 @@ template<class T> class MeshDataImpl : public MeshDataBase {
}
//! file io
- void save(const std::string name);
+ int save(const std::string name);
static PyObject *_W_41(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
@@ -1577,8 +1576,7 @@ template<class T> class MeshDataImpl : public MeshDataBase {
ArgLocker _lock;
const std::string name = _args.get<std::string>("name", 0, &_lock);
pbo->_args.copy(_args);
- _retval = getPyNone();
- pbo->save(name);
+ _retval = toPy(pbo->save(name));
pbo->_args.check();
}
pbFinalizePlugin(pbo->getParent(), "MeshDataImpl::save", !noTiming);
@@ -1590,7 +1588,7 @@ template<class T> class MeshDataImpl : public MeshDataBase {
}
}
- void load(const std::string name);
+ int load(const std::string name);
static PyObject *_W_42(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
@@ -1603,8 +1601,7 @@ template<class T> class MeshDataImpl : public MeshDataBase {
ArgLocker _lock;
const std::string name = _args.get<std::string>("name", 0, &_lock);
pbo->_args.copy(_args);
- _retval = getPyNone();
- pbo->load(name);
+ _retval = toPy(pbo->load(name));
pbo->_args.check();
}
pbFinalizePlugin(pbo->getParent(), "MeshDataImpl::load", !noTiming);
diff --git a/extern/mantaflow/preprocessed/mesh.h.reg.cpp b/extern/mantaflow/preprocessed/mesh.h.reg.cpp
index b2ba3e22032..664e4c3ff6e 100644
--- a/extern/mantaflow/preprocessed/mesh.h.reg.cpp
+++ b/extern/mantaflow/preprocessed/mesh.h.reg.cpp
@@ -10,14 +10,14 @@ static const Pb::Register _R_12("Mesh", "Mesh", "PbClass");
template<> const char *Namify<Mesh>::S = "Mesh";
static const Pb::Register _R_13("Mesh", "Mesh", Mesh::_W_0);
static const Pb::Register _R_14("Mesh", "clear", Mesh::_W_1);
-static const Pb::Register _R_15("Mesh", "load", Mesh::_W_2);
-static const Pb::Register _R_16("Mesh", "fromShape", Mesh::_W_3);
-static const Pb::Register _R_17("Mesh", "save", Mesh::_W_4);
-static const Pb::Register _R_18("Mesh", "advectInGrid", Mesh::_W_5);
-static const Pb::Register _R_19("Mesh", "scale", Mesh::_W_6);
-static const Pb::Register _R_20("Mesh", "offset", Mesh::_W_7);
-static const Pb::Register _R_21("Mesh", "rotate", Mesh::_W_8);
-static const Pb::Register _R_22("Mesh", "computeVelocity", Mesh::_W_9);
+static const Pb::Register _R_15("Mesh", "fromShape", Mesh::_W_2);
+static const Pb::Register _R_16("Mesh", "advectInGrid", Mesh::_W_3);
+static const Pb::Register _R_17("Mesh", "scale", Mesh::_W_4);
+static const Pb::Register _R_18("Mesh", "offset", Mesh::_W_5);
+static const Pb::Register _R_19("Mesh", "rotate", Mesh::_W_6);
+static const Pb::Register _R_20("Mesh", "computeVelocity", Mesh::_W_7);
+static const Pb::Register _R_21("Mesh", "load", Mesh::_W_8);
+static const Pb::Register _R_22("Mesh", "save", Mesh::_W_9);
static const Pb::Register _R_23("Mesh", "computeLevelset", Mesh::_W_10);
static const Pb::Register _R_24("Mesh", "getLevelset", Mesh::_W_11);
static const Pb::Register _R_25("Mesh", "applyMeshToGrid", Mesh::_W_12);
diff --git a/extern/mantaflow/preprocessed/particle.cpp b/extern/mantaflow/preprocessed/particle.cpp
index c719fc8f27d..8c26156358d 100644
--- a/extern/mantaflow/preprocessed/particle.cpp
+++ b/extern/mantaflow/preprocessed/particle.cpp
@@ -29,7 +29,7 @@ using namespace std;
namespace Manta {
ParticleBase::ParticleBase(FluidSolver *parent)
- : PbClass(parent), mAllowCompress(true), mFreePdata(false)
+ : PbClass(parent), mMaxParticles(0), mAllowCompress(true), mFreePdata(false)
{
}
@@ -359,8 +359,8 @@ template<class T> void ParticleDataImpl<T>::setSource(Grid<T> *grid, bool isMAC)
{
mpGridSource = grid;
mGridSourceMAC = isMAC;
- if (isMAC)
- assertMsg(dynamic_cast<MACGrid *>(grid) != NULL, "Given grid is not a valid MAC grid");
+ if (grid && isMAC)
+ assertMsg(grid->getType() & GridBase::TypeMAC, "Given grid is not a valid MAC grid");
}
template<class T> void ParticleDataImpl<T>::initNewValue(IndexInt idx, Vec3 pos)
diff --git a/extern/mantaflow/preprocessed/particle.h b/extern/mantaflow/preprocessed/particle.h
index 0be141ed26f..da6733b6845 100644
--- a/extern/mantaflow/preprocessed/particle.h
+++ b/extern/mantaflow/preprocessed/particle.h
@@ -100,6 +100,17 @@ class ParticleBase : public PbClass {
//! threads)
inline void addBuffered(const Vec3 &pos, int flag = 0);
+ virtual void resize(IndexInt size)
+ {
+ assertMsg(false, "Dont use, override...");
+ return;
+ }
+ virtual void resizeAll(IndexInt size)
+ {
+ assertMsg(false, "Dont use, override...");
+ return;
+ }
+
//! particle data functions
//! create a particle data object
@@ -152,6 +163,20 @@ class ParticleBase : public PbClass {
return mPartData[i];
}
+ //! expose maximum number of particles to python
+ int mMaxParticles;
+ static PyObject *_GET_mMaxParticles(PyObject *self, void *cl)
+ {
+ ParticleBase *pbo = dynamic_cast<ParticleBase *>(Pb::objFromPy(self));
+ return toPy(pbo->mMaxParticles);
+ }
+ static int _SET_mMaxParticles(PyObject *self, PyObject *val, void *cl)
+ {
+ ParticleBase *pbo = dynamic_cast<ParticleBase *>(Pb::objFromPy(self));
+ pbo->mMaxParticles = fromPy<int>(val);
+ return 0;
+ }
+
protected:
//! new particle candidates
std::vector<Vec3> mNewBufferPos;
@@ -431,8 +456,14 @@ template<class S> class ParticleSystem : public ParticleBase {
}
//! insert buffered positions as new particles, update additional particle data
void insertBufferedParticles();
+ //! resize only the data vector, only use if you know what you're doing, otherwise use
+ //! resizeAll()
+ virtual void resize(IndexInt size)
+ {
+ mData.resize(size);
+ }
//! resize data vector, and all pdata fields
- void resizeAll(IndexInt newsize);
+ virtual void resizeAll(IndexInt size);
//! adding and deleting
inline void kill(IndexInt idx);
@@ -877,11 +908,6 @@ class ParticleIndexSystem : public ParticleSystem<ParticleIndexData> {
return -1;
}
};
- //! we only need a resize function...
- void resize(IndexInt size)
- {
- mData.resize(size);
- }
public:
PbArgs _args;
}
@@ -2479,28 +2505,66 @@ template<class S> void ParticleSystem<S>::insertBufferedParticles()
for (IndexInt i = 0; i < (IndexInt)mData.size(); ++i)
mData[i].flag &= ~PNEW;
- if (mNewBufferPos.size() == 0)
+ if (mNewBufferPos.empty())
return;
- IndexInt newCnt = mData.size();
- resizeAll(newCnt + mNewBufferPos.size());
-
- for (IndexInt i = 0; i < (IndexInt)mNewBufferPos.size(); ++i) {
- int flag = (mNewBufferFlag.size() > 0) ? mNewBufferFlag[i] : 0;
- // note, other fields are not initialized here...
- mData[newCnt].pos = mNewBufferPos[i];
- mData[newCnt].flag = PNEW | flag;
+ IndexInt bufferSize = mNewBufferPos.size();
+ IndexInt partsSize = mData.size();
+
+ if (mMaxParticles > 0)
+ assertMsg(mMaxParticles >= partsSize,
+ "Particle system cannot contain more particles that the maximum allowed number");
+
+ // max number of new particles that can be inserted, adjusted buffer size when using maxParticles
+ // field
+ IndexInt numNewParts = (mMaxParticles > 0) ? mMaxParticles - mData.size() : bufferSize;
+ if (numNewParts > bufferSize)
+ numNewParts = bufferSize; // upper clamp
+
+ assertMsg(numNewParts >= 0, "Must not have negative number of new particles");
+
+ // new size of particle system
+ IndexInt newSize = mData.size() + numNewParts;
+ if (mMaxParticles > 0)
+ assertMsg(newSize <= mMaxParticles,
+ "Particle system cannot contain more particles that the maximum allowed number");
+ resizeAll(newSize);
+
+ int insertFlag;
+ Vec3 insertPos;
+ static RandomStream mRand(9832);
+ for (IndexInt i = 0; i < numNewParts; ++i) {
+
+ // get random index in newBuffer vector
+ // we are inserting particles randomly so that they are sampled uniformly in the fluid region
+ // otherwise, regions of fluid can remain completely empty once mData.size() == maxParticles is
+ // reached.
+ int randIndex = floor(mRand.getReal() * mNewBufferPos.size());
+
+ // get elements from new buffers with random index
+ std::swap(mNewBufferPos[randIndex], mNewBufferPos.back());
+ insertPos = mNewBufferPos.back();
+ mNewBufferPos.pop_back();
+
+ insertFlag = 0;
+ if (!mNewBufferFlag.empty()) {
+ std::swap(mNewBufferFlag[randIndex], mNewBufferFlag.back());
+ insertFlag = mNewBufferFlag.back();
+ mNewBufferFlag.pop_back();
+ }
+
+ mData[partsSize].pos = insertPos;
+ mData[partsSize].flag = PNEW | insertFlag;
+
// now init pdata fields from associated grids...
for (IndexInt pd = 0; pd < (IndexInt)mPdataReal.size(); ++pd)
- mPdataReal[pd]->initNewValue(newCnt, mNewBufferPos[i]);
+ mPdataReal[pd]->initNewValue(partsSize, insertPos);
for (IndexInt pd = 0; pd < (IndexInt)mPdataVec3.size(); ++pd)
- mPdataVec3[pd]->initNewValue(newCnt, mNewBufferPos[i]);
+ mPdataVec3[pd]->initNewValue(partsSize, insertPos);
for (IndexInt pd = 0; pd < (IndexInt)mPdataInt.size(); ++pd)
- mPdataInt[pd]->initNewValue(newCnt, mNewBufferPos[i]);
- newCnt++;
+ mPdataInt[pd]->initNewValue(partsSize, insertPos);
+ partsSize++;
}
- if (mNewBufferPos.size() > 0)
- debMsg("Added & initialized " << (IndexInt)mNewBufferPos.size() << " particles",
- 2); // debug info
+ debMsg("Added & initialized " << numNewParts << " particles", 2); // debug info
mNewBufferPos.clear();
mNewBufferFlag.clear();
}
diff --git a/extern/mantaflow/preprocessed/particle.h.reg.cpp b/extern/mantaflow/preprocessed/particle.h.reg.cpp
index 6e0466d0203..e9e538ad097 100644
--- a/extern/mantaflow/preprocessed/particle.h.reg.cpp
+++ b/extern/mantaflow/preprocessed/particle.h.reg.cpp
@@ -29,279 +29,283 @@ static const Pb::Register _R_21("ParticleBase", "ParticleBase", "PbClass");
template<> const char *Namify<ParticleBase>::S = "ParticleBase";
static const Pb::Register _R_22("ParticleBase", "ParticleBase", ParticleBase::_W_0);
static const Pb::Register _R_23("ParticleBase", "create", ParticleBase::_W_1);
+static const Pb::Register _R_24("ParticleBase",
+ "maxParticles",
+ ParticleBase::_GET_mMaxParticles,
+ ParticleBase::_SET_mMaxParticles);
#endif
#ifdef _C_ParticleDataBase
-static const Pb::Register _R_24("ParticleDataBase", "ParticleDataBase", "PbClass");
+static const Pb::Register _R_25("ParticleDataBase", "ParticleDataBase", "PbClass");
template<> const char *Namify<ParticleDataBase>::S = "ParticleDataBase";
-static const Pb::Register _R_25("ParticleDataBase", "ParticleDataBase", ParticleDataBase::_W_21);
+static const Pb::Register _R_26("ParticleDataBase", "ParticleDataBase", ParticleDataBase::_W_21);
#endif
#ifdef _C_ParticleDataImpl
-static const Pb::Register _R_26("ParticleDataImpl<int>",
+static const Pb::Register _R_27("ParticleDataImpl<int>",
"ParticleDataImpl<int>",
"ParticleDataBase");
template<> const char *Namify<ParticleDataImpl<int>>::S = "ParticleDataImpl<int>";
-static const Pb::Register _R_27("ParticleDataImpl<int>",
+static const Pb::Register _R_28("ParticleDataImpl<int>",
"ParticleDataImpl",
ParticleDataImpl<int>::_W_22);
-static const Pb::Register _R_28("ParticleDataImpl<int>", "clear", ParticleDataImpl<int>::_W_23);
-static const Pb::Register _R_29("ParticleDataImpl<int>",
+static const Pb::Register _R_29("ParticleDataImpl<int>", "clear", ParticleDataImpl<int>::_W_23);
+static const Pb::Register _R_30("ParticleDataImpl<int>",
"setSource",
ParticleDataImpl<int>::_W_24);
-static const Pb::Register _R_30("ParticleDataImpl<int>", "copyFrom", ParticleDataImpl<int>::_W_25);
-static const Pb::Register _R_31("ParticleDataImpl<int>", "setConst", ParticleDataImpl<int>::_W_26);
-static const Pb::Register _R_32("ParticleDataImpl<int>",
+static const Pb::Register _R_31("ParticleDataImpl<int>", "copyFrom", ParticleDataImpl<int>::_W_25);
+static const Pb::Register _R_32("ParticleDataImpl<int>", "setConst", ParticleDataImpl<int>::_W_26);
+static const Pb::Register _R_33("ParticleDataImpl<int>",
"setConstRange",
ParticleDataImpl<int>::_W_27);
-static const Pb::Register _R_33("ParticleDataImpl<int>", "add", ParticleDataImpl<int>::_W_28);
-static const Pb::Register _R_34("ParticleDataImpl<int>", "sub", ParticleDataImpl<int>::_W_29);
-static const Pb::Register _R_35("ParticleDataImpl<int>", "addConst", ParticleDataImpl<int>::_W_30);
-static const Pb::Register _R_36("ParticleDataImpl<int>",
+static const Pb::Register _R_34("ParticleDataImpl<int>", "add", ParticleDataImpl<int>::_W_28);
+static const Pb::Register _R_35("ParticleDataImpl<int>", "sub", ParticleDataImpl<int>::_W_29);
+static const Pb::Register _R_36("ParticleDataImpl<int>", "addConst", ParticleDataImpl<int>::_W_30);
+static const Pb::Register _R_37("ParticleDataImpl<int>",
"addScaled",
ParticleDataImpl<int>::_W_31);
-static const Pb::Register _R_37("ParticleDataImpl<int>", "mult", ParticleDataImpl<int>::_W_32);
-static const Pb::Register _R_38("ParticleDataImpl<int>",
+static const Pb::Register _R_38("ParticleDataImpl<int>", "mult", ParticleDataImpl<int>::_W_32);
+static const Pb::Register _R_39("ParticleDataImpl<int>",
"multConst",
ParticleDataImpl<int>::_W_33);
-static const Pb::Register _R_39("ParticleDataImpl<int>", "safeDiv", ParticleDataImpl<int>::_W_34);
-static const Pb::Register _R_40("ParticleDataImpl<int>", "clamp", ParticleDataImpl<int>::_W_35);
-static const Pb::Register _R_41("ParticleDataImpl<int>", "clampMin", ParticleDataImpl<int>::_W_36);
-static const Pb::Register _R_42("ParticleDataImpl<int>", "clampMax", ParticleDataImpl<int>::_W_37);
-static const Pb::Register _R_43("ParticleDataImpl<int>",
+static const Pb::Register _R_40("ParticleDataImpl<int>", "safeDiv", ParticleDataImpl<int>::_W_34);
+static const Pb::Register _R_41("ParticleDataImpl<int>", "clamp", ParticleDataImpl<int>::_W_35);
+static const Pb::Register _R_42("ParticleDataImpl<int>", "clampMin", ParticleDataImpl<int>::_W_36);
+static const Pb::Register _R_43("ParticleDataImpl<int>", "clampMax", ParticleDataImpl<int>::_W_37);
+static const Pb::Register _R_44("ParticleDataImpl<int>",
"getMaxAbs",
ParticleDataImpl<int>::_W_38);
-static const Pb::Register _R_44("ParticleDataImpl<int>", "getMax", ParticleDataImpl<int>::_W_39);
-static const Pb::Register _R_45("ParticleDataImpl<int>", "getMin", ParticleDataImpl<int>::_W_40);
-static const Pb::Register _R_46("ParticleDataImpl<int>", "sum", ParticleDataImpl<int>::_W_41);
-static const Pb::Register _R_47("ParticleDataImpl<int>",
+static const Pb::Register _R_45("ParticleDataImpl<int>", "getMax", ParticleDataImpl<int>::_W_39);
+static const Pb::Register _R_46("ParticleDataImpl<int>", "getMin", ParticleDataImpl<int>::_W_40);
+static const Pb::Register _R_47("ParticleDataImpl<int>", "sum", ParticleDataImpl<int>::_W_41);
+static const Pb::Register _R_48("ParticleDataImpl<int>",
"sumSquare",
ParticleDataImpl<int>::_W_42);
-static const Pb::Register _R_48("ParticleDataImpl<int>",
+static const Pb::Register _R_49("ParticleDataImpl<int>",
"sumMagnitude",
ParticleDataImpl<int>::_W_43);
-static const Pb::Register _R_49("ParticleDataImpl<int>",
+static const Pb::Register _R_50("ParticleDataImpl<int>",
"setConstIntFlag",
ParticleDataImpl<int>::_W_44);
-static const Pb::Register _R_50("ParticleDataImpl<int>",
+static const Pb::Register _R_51("ParticleDataImpl<int>",
"printPdata",
ParticleDataImpl<int>::_W_45);
-static const Pb::Register _R_51("ParticleDataImpl<int>", "save", ParticleDataImpl<int>::_W_46);
-static const Pb::Register _R_52("ParticleDataImpl<int>", "load", ParticleDataImpl<int>::_W_47);
-static const Pb::Register _R_53("ParticleDataImpl<int>",
+static const Pb::Register _R_52("ParticleDataImpl<int>", "save", ParticleDataImpl<int>::_W_46);
+static const Pb::Register _R_53("ParticleDataImpl<int>", "load", ParticleDataImpl<int>::_W_47);
+static const Pb::Register _R_54("ParticleDataImpl<int>",
"getDataPointer",
ParticleDataImpl<int>::_W_48);
-static const Pb::Register _R_54("ParticleDataImpl<Real>",
+static const Pb::Register _R_55("ParticleDataImpl<Real>",
"ParticleDataImpl<Real>",
"ParticleDataBase");
template<> const char *Namify<ParticleDataImpl<Real>>::S = "ParticleDataImpl<Real>";
-static const Pb::Register _R_55("ParticleDataImpl<Real>",
+static const Pb::Register _R_56("ParticleDataImpl<Real>",
"ParticleDataImpl",
ParticleDataImpl<Real>::_W_22);
-static const Pb::Register _R_56("ParticleDataImpl<Real>", "clear", ParticleDataImpl<Real>::_W_23);
-static const Pb::Register _R_57("ParticleDataImpl<Real>",
+static const Pb::Register _R_57("ParticleDataImpl<Real>", "clear", ParticleDataImpl<Real>::_W_23);
+static const Pb::Register _R_58("ParticleDataImpl<Real>",
"setSource",
ParticleDataImpl<Real>::_W_24);
-static const Pb::Register _R_58("ParticleDataImpl<Real>",
+static const Pb::Register _R_59("ParticleDataImpl<Real>",
"copyFrom",
ParticleDataImpl<Real>::_W_25);
-static const Pb::Register _R_59("ParticleDataImpl<Real>",
+static const Pb::Register _R_60("ParticleDataImpl<Real>",
"setConst",
ParticleDataImpl<Real>::_W_26);
-static const Pb::Register _R_60("ParticleDataImpl<Real>",
+static const Pb::Register _R_61("ParticleDataImpl<Real>",
"setConstRange",
ParticleDataImpl<Real>::_W_27);
-static const Pb::Register _R_61("ParticleDataImpl<Real>", "add", ParticleDataImpl<Real>::_W_28);
-static const Pb::Register _R_62("ParticleDataImpl<Real>", "sub", ParticleDataImpl<Real>::_W_29);
-static const Pb::Register _R_63("ParticleDataImpl<Real>",
+static const Pb::Register _R_62("ParticleDataImpl<Real>", "add", ParticleDataImpl<Real>::_W_28);
+static const Pb::Register _R_63("ParticleDataImpl<Real>", "sub", ParticleDataImpl<Real>::_W_29);
+static const Pb::Register _R_64("ParticleDataImpl<Real>",
"addConst",
ParticleDataImpl<Real>::_W_30);
-static const Pb::Register _R_64("ParticleDataImpl<Real>",
+static const Pb::Register _R_65("ParticleDataImpl<Real>",
"addScaled",
ParticleDataImpl<Real>::_W_31);
-static const Pb::Register _R_65("ParticleDataImpl<Real>", "mult", ParticleDataImpl<Real>::_W_32);
-static const Pb::Register _R_66("ParticleDataImpl<Real>",
+static const Pb::Register _R_66("ParticleDataImpl<Real>", "mult", ParticleDataImpl<Real>::_W_32);
+static const Pb::Register _R_67("ParticleDataImpl<Real>",
"multConst",
ParticleDataImpl<Real>::_W_33);
-static const Pb::Register _R_67("ParticleDataImpl<Real>",
+static const Pb::Register _R_68("ParticleDataImpl<Real>",
"safeDiv",
ParticleDataImpl<Real>::_W_34);
-static const Pb::Register _R_68("ParticleDataImpl<Real>", "clamp", ParticleDataImpl<Real>::_W_35);
-static const Pb::Register _R_69("ParticleDataImpl<Real>",
+static const Pb::Register _R_69("ParticleDataImpl<Real>", "clamp", ParticleDataImpl<Real>::_W_35);
+static const Pb::Register _R_70("ParticleDataImpl<Real>",
"clampMin",
ParticleDataImpl<Real>::_W_36);
-static const Pb::Register _R_70("ParticleDataImpl<Real>",
+static const Pb::Register _R_71("ParticleDataImpl<Real>",
"clampMax",
ParticleDataImpl<Real>::_W_37);
-static const Pb::Register _R_71("ParticleDataImpl<Real>",
+static const Pb::Register _R_72("ParticleDataImpl<Real>",
"getMaxAbs",
ParticleDataImpl<Real>::_W_38);
-static const Pb::Register _R_72("ParticleDataImpl<Real>", "getMax", ParticleDataImpl<Real>::_W_39);
-static const Pb::Register _R_73("ParticleDataImpl<Real>", "getMin", ParticleDataImpl<Real>::_W_40);
-static const Pb::Register _R_74("ParticleDataImpl<Real>", "sum", ParticleDataImpl<Real>::_W_41);
-static const Pb::Register _R_75("ParticleDataImpl<Real>",
+static const Pb::Register _R_73("ParticleDataImpl<Real>", "getMax", ParticleDataImpl<Real>::_W_39);
+static const Pb::Register _R_74("ParticleDataImpl<Real>", "getMin", ParticleDataImpl<Real>::_W_40);
+static const Pb::Register _R_75("ParticleDataImpl<Real>", "sum", ParticleDataImpl<Real>::_W_41);
+static const Pb::Register _R_76("ParticleDataImpl<Real>",
"sumSquare",
ParticleDataImpl<Real>::_W_42);
-static const Pb::Register _R_76("ParticleDataImpl<Real>",
+static const Pb::Register _R_77("ParticleDataImpl<Real>",
"sumMagnitude",
ParticleDataImpl<Real>::_W_43);
-static const Pb::Register _R_77("ParticleDataImpl<Real>",
+static const Pb::Register _R_78("ParticleDataImpl<Real>",
"setConstIntFlag",
ParticleDataImpl<Real>::_W_44);
-static const Pb::Register _R_78("ParticleDataImpl<Real>",
+static const Pb::Register _R_79("ParticleDataImpl<Real>",
"printPdata",
ParticleDataImpl<Real>::_W_45);
-static const Pb::Register _R_79("ParticleDataImpl<Real>", "save", ParticleDataImpl<Real>::_W_46);
-static const Pb::Register _R_80("ParticleDataImpl<Real>", "load", ParticleDataImpl<Real>::_W_47);
-static const Pb::Register _R_81("ParticleDataImpl<Real>",
+static const Pb::Register _R_80("ParticleDataImpl<Real>", "save", ParticleDataImpl<Real>::_W_46);
+static const Pb::Register _R_81("ParticleDataImpl<Real>", "load", ParticleDataImpl<Real>::_W_47);
+static const Pb::Register _R_82("ParticleDataImpl<Real>",
"getDataPointer",
ParticleDataImpl<Real>::_W_48);
-static const Pb::Register _R_82("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_83("ParticleDataImpl<Vec3>",
"ParticleDataImpl<Vec3>",
"ParticleDataBase");
template<> const char *Namify<ParticleDataImpl<Vec3>>::S = "ParticleDataImpl<Vec3>";
-static const Pb::Register _R_83("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_84("ParticleDataImpl<Vec3>",
"ParticleDataImpl",
ParticleDataImpl<Vec3>::_W_22);
-static const Pb::Register _R_84("ParticleDataImpl<Vec3>", "clear", ParticleDataImpl<Vec3>::_W_23);
-static const Pb::Register _R_85("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_85("ParticleDataImpl<Vec3>", "clear", ParticleDataImpl<Vec3>::_W_23);
+static const Pb::Register _R_86("ParticleDataImpl<Vec3>",
"setSource",
ParticleDataImpl<Vec3>::_W_24);
-static const Pb::Register _R_86("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_87("ParticleDataImpl<Vec3>",
"copyFrom",
ParticleDataImpl<Vec3>::_W_25);
-static const Pb::Register _R_87("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_88("ParticleDataImpl<Vec3>",
"setConst",
ParticleDataImpl<Vec3>::_W_26);
-static const Pb::Register _R_88("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_89("ParticleDataImpl<Vec3>",
"setConstRange",
ParticleDataImpl<Vec3>::_W_27);
-static const Pb::Register _R_89("ParticleDataImpl<Vec3>", "add", ParticleDataImpl<Vec3>::_W_28);
-static const Pb::Register _R_90("ParticleDataImpl<Vec3>", "sub", ParticleDataImpl<Vec3>::_W_29);
-static const Pb::Register _R_91("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_90("ParticleDataImpl<Vec3>", "add", ParticleDataImpl<Vec3>::_W_28);
+static const Pb::Register _R_91("ParticleDataImpl<Vec3>", "sub", ParticleDataImpl<Vec3>::_W_29);
+static const Pb::Register _R_92("ParticleDataImpl<Vec3>",
"addConst",
ParticleDataImpl<Vec3>::_W_30);
-static const Pb::Register _R_92("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_93("ParticleDataImpl<Vec3>",
"addScaled",
ParticleDataImpl<Vec3>::_W_31);
-static const Pb::Register _R_93("ParticleDataImpl<Vec3>", "mult", ParticleDataImpl<Vec3>::_W_32);
-static const Pb::Register _R_94("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_94("ParticleDataImpl<Vec3>", "mult", ParticleDataImpl<Vec3>::_W_32);
+static const Pb::Register _R_95("ParticleDataImpl<Vec3>",
"multConst",
ParticleDataImpl<Vec3>::_W_33);
-static const Pb::Register _R_95("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_96("ParticleDataImpl<Vec3>",
"safeDiv",
ParticleDataImpl<Vec3>::_W_34);
-static const Pb::Register _R_96("ParticleDataImpl<Vec3>", "clamp", ParticleDataImpl<Vec3>::_W_35);
-static const Pb::Register _R_97("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_97("ParticleDataImpl<Vec3>", "clamp", ParticleDataImpl<Vec3>::_W_35);
+static const Pb::Register _R_98("ParticleDataImpl<Vec3>",
"clampMin",
ParticleDataImpl<Vec3>::_W_36);
-static const Pb::Register _R_98("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_99("ParticleDataImpl<Vec3>",
"clampMax",
ParticleDataImpl<Vec3>::_W_37);
-static const Pb::Register _R_99("ParticleDataImpl<Vec3>",
- "getMaxAbs",
- ParticleDataImpl<Vec3>::_W_38);
static const Pb::Register _R_100("ParticleDataImpl<Vec3>",
+ "getMaxAbs",
+ ParticleDataImpl<Vec3>::_W_38);
+static const Pb::Register _R_101("ParticleDataImpl<Vec3>",
"getMax",
ParticleDataImpl<Vec3>::_W_39);
-static const Pb::Register _R_101("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_102("ParticleDataImpl<Vec3>",
"getMin",
ParticleDataImpl<Vec3>::_W_40);
-static const Pb::Register _R_102("ParticleDataImpl<Vec3>", "sum", ParticleDataImpl<Vec3>::_W_41);
-static const Pb::Register _R_103("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_103("ParticleDataImpl<Vec3>", "sum", ParticleDataImpl<Vec3>::_W_41);
+static const Pb::Register _R_104("ParticleDataImpl<Vec3>",
"sumSquare",
ParticleDataImpl<Vec3>::_W_42);
-static const Pb::Register _R_104("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_105("ParticleDataImpl<Vec3>",
"sumMagnitude",
ParticleDataImpl<Vec3>::_W_43);
-static const Pb::Register _R_105("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_106("ParticleDataImpl<Vec3>",
"setConstIntFlag",
ParticleDataImpl<Vec3>::_W_44);
-static const Pb::Register _R_106("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_107("ParticleDataImpl<Vec3>",
"printPdata",
ParticleDataImpl<Vec3>::_W_45);
-static const Pb::Register _R_107("ParticleDataImpl<Vec3>", "save", ParticleDataImpl<Vec3>::_W_46);
-static const Pb::Register _R_108("ParticleDataImpl<Vec3>", "load", ParticleDataImpl<Vec3>::_W_47);
-static const Pb::Register _R_109("ParticleDataImpl<Vec3>",
+static const Pb::Register _R_108("ParticleDataImpl<Vec3>", "save", ParticleDataImpl<Vec3>::_W_46);
+static const Pb::Register _R_109("ParticleDataImpl<Vec3>", "load", ParticleDataImpl<Vec3>::_W_47);
+static const Pb::Register _R_110("ParticleDataImpl<Vec3>",
"getDataPointer",
ParticleDataImpl<Vec3>::_W_48);
#endif
#ifdef _C_ParticleIndexSystem
-static const Pb::Register _R_110("ParticleIndexSystem",
+static const Pb::Register _R_111("ParticleIndexSystem",
"ParticleIndexSystem",
"ParticleSystem<ParticleIndexData>");
template<> const char *Namify<ParticleIndexSystem>::S = "ParticleIndexSystem";
-static const Pb::Register _R_111("ParticleIndexSystem",
+static const Pb::Register _R_112("ParticleIndexSystem",
"ParticleIndexSystem",
ParticleIndexSystem::_W_19);
#endif
#ifdef _C_ParticleSystem
-static const Pb::Register _R_112("ParticleSystem<BasicParticleData>",
+static const Pb::Register _R_113("ParticleSystem<BasicParticleData>",
"ParticleSystem<BasicParticleData>",
"ParticleBase");
template<>
const char *Namify<ParticleSystem<BasicParticleData>>::S = "ParticleSystem<BasicParticleData>";
-static const Pb::Register _R_113("ParticleSystem<BasicParticleData>",
+static const Pb::Register _R_114("ParticleSystem<BasicParticleData>",
"ParticleSystem",
ParticleSystem<BasicParticleData>::_W_2);
-static const Pb::Register _R_114("ParticleSystem<BasicParticleData>",
+static const Pb::Register _R_115("ParticleSystem<BasicParticleData>",
"pySize",
ParticleSystem<BasicParticleData>::_W_3);
-static const Pb::Register _R_115("ParticleSystem<BasicParticleData>",
+static const Pb::Register _R_116("ParticleSystem<BasicParticleData>",
"setPos",
ParticleSystem<BasicParticleData>::_W_4);
-static const Pb::Register _R_116("ParticleSystem<BasicParticleData>",
+static const Pb::Register _R_117("ParticleSystem<BasicParticleData>",
"getPos",
ParticleSystem<BasicParticleData>::_W_5);
-static const Pb::Register _R_117("ParticleSystem<BasicParticleData>",
+static const Pb::Register _R_118("ParticleSystem<BasicParticleData>",
"getPosPdata",
ParticleSystem<BasicParticleData>::_W_6);
-static const Pb::Register _R_118("ParticleSystem<BasicParticleData>",
+static const Pb::Register _R_119("ParticleSystem<BasicParticleData>",
"setPosPdata",
ParticleSystem<BasicParticleData>::_W_7);
-static const Pb::Register _R_119("ParticleSystem<BasicParticleData>",
+static const Pb::Register _R_120("ParticleSystem<BasicParticleData>",
"clear",
ParticleSystem<BasicParticleData>::_W_8);
-static const Pb::Register _R_120("ParticleSystem<BasicParticleData>",
+static const Pb::Register _R_121("ParticleSystem<BasicParticleData>",
"advectInGrid",
ParticleSystem<BasicParticleData>::_W_9);
-static const Pb::Register _R_121("ParticleSystem<BasicParticleData>",
+static const Pb::Register _R_122("ParticleSystem<BasicParticleData>",
"projectOutside",
ParticleSystem<BasicParticleData>::_W_10);
-static const Pb::Register _R_122("ParticleSystem<BasicParticleData>",
+static const Pb::Register _R_123("ParticleSystem<BasicParticleData>",
"projectOutOfBnd",
ParticleSystem<BasicParticleData>::_W_11);
-static const Pb::Register _R_123("ParticleSystem<ParticleIndexData>",
+static const Pb::Register _R_124("ParticleSystem<ParticleIndexData>",
"ParticleSystem<ParticleIndexData>",
"ParticleBase");
template<>
const char *Namify<ParticleSystem<ParticleIndexData>>::S = "ParticleSystem<ParticleIndexData>";
-static const Pb::Register _R_124("ParticleSystem<ParticleIndexData>",
+static const Pb::Register _R_125("ParticleSystem<ParticleIndexData>",
"ParticleSystem",
ParticleSystem<ParticleIndexData>::_W_2);
-static const Pb::Register _R_125("ParticleSystem<ParticleIndexData>",
+static const Pb::Register _R_126("ParticleSystem<ParticleIndexData>",
"pySize",
ParticleSystem<ParticleIndexData>::_W_3);
-static const Pb::Register _R_126("ParticleSystem<ParticleIndexData>",
+static const Pb::Register _R_127("ParticleSystem<ParticleIndexData>",
"setPos",
ParticleSystem<ParticleIndexData>::_W_4);
-static const Pb::Register _R_127("ParticleSystem<ParticleIndexData>",
+static const Pb::Register _R_128("ParticleSystem<ParticleIndexData>",
"getPos",
ParticleSystem<ParticleIndexData>::_W_5);
-static const Pb::Register _R_128("ParticleSystem<ParticleIndexData>",
+static const Pb::Register _R_129("ParticleSystem<ParticleIndexData>",
"getPosPdata",
ParticleSystem<ParticleIndexData>::_W_6);
-static const Pb::Register _R_129("ParticleSystem<ParticleIndexData>",
+static const Pb::Register _R_130("ParticleSystem<ParticleIndexData>",
"setPosPdata",
ParticleSystem<ParticleIndexData>::_W_7);
-static const Pb::Register _R_130("ParticleSystem<ParticleIndexData>",
+static const Pb::Register _R_131("ParticleSystem<ParticleIndexData>",
"clear",
ParticleSystem<ParticleIndexData>::_W_8);
-static const Pb::Register _R_131("ParticleSystem<ParticleIndexData>",
+static const Pb::Register _R_132("ParticleSystem<ParticleIndexData>",
"advectInGrid",
ParticleSystem<ParticleIndexData>::_W_9);
-static const Pb::Register _R_132("ParticleSystem<ParticleIndexData>",
+static const Pb::Register _R_133("ParticleSystem<ParticleIndexData>",
"projectOutside",
ParticleSystem<ParticleIndexData>::_W_10);
-static const Pb::Register _R_133("ParticleSystem<ParticleIndexData>",
+static const Pb::Register _R_134("ParticleSystem<ParticleIndexData>",
"projectOutOfBnd",
ParticleSystem<ParticleIndexData>::_W_11);
#endif
@@ -432,6 +436,7 @@ void PbRegister_file_10()
KEEP_UNUSED(_R_131);
KEEP_UNUSED(_R_132);
KEEP_UNUSED(_R_133);
+ KEEP_UNUSED(_R_134);
}
}
} // namespace Manta \ No newline at end of file
diff --git a/extern/mantaflow/preprocessed/plugin/initplugins.cpp b/extern/mantaflow/preprocessed/plugin/initplugins.cpp
index 7a765813f9f..6ccd3afc8d1 100644
--- a/extern/mantaflow/preprocessed/plugin/initplugins.cpp
+++ b/extern/mantaflow/preprocessed/plugin/initplugins.cpp
@@ -1479,48 +1479,24 @@ void PbRegister_addTestParts()
}
//! calculate the difference between two pdata fields (note - slow!, not parallelized)
-
-Real pdataMaxDiff(const ParticleDataBase *a, const ParticleDataBase *b)
+template<class T> Real getPdataMaxDiff(const ParticleDataImpl<T> *a, const ParticleDataImpl<T> *b)
{
- double maxVal = 0.;
- // debMsg(" PD "<< a->getType()<<" as"<<a->getSizeSlow()<<" bs"<<b->getSizeSlow() , 1);
assertMsg(a->getType() == b->getType(), "pdataMaxDiff problem - different pdata types!");
assertMsg(a->getSizeSlow() == b->getSizeSlow(), "pdataMaxDiff problem - different pdata sizes!");
- if (a->getType() & ParticleDataBase::TypeReal) {
- const ParticleDataImpl<Real> &av = *dynamic_cast<const ParticleDataImpl<Real> *>(a);
- const ParticleDataImpl<Real> &bv = *dynamic_cast<const ParticleDataImpl<Real> *>(b);
- FOR_PARTS(av)
- {
- maxVal = std::max(maxVal, (double)fabs(av[idx] - bv[idx]));
- }
- }
- else if (a->getType() & ParticleDataBase::TypeInt) {
- const ParticleDataImpl<int> &av = *dynamic_cast<const ParticleDataImpl<int> *>(a);
- const ParticleDataImpl<int> &bv = *dynamic_cast<const ParticleDataImpl<int> *>(b);
- FOR_PARTS(av)
- {
- maxVal = std::max(maxVal, (double)fabs((double)av[idx] - bv[idx]));
- }
- }
- else if (a->getType() & ParticleDataBase::TypeVec3) {
- const ParticleDataImpl<Vec3> &av = *dynamic_cast<const ParticleDataImpl<Vec3> *>(a);
- const ParticleDataImpl<Vec3> &bv = *dynamic_cast<const ParticleDataImpl<Vec3> *>(b);
- FOR_PARTS(av)
- {
- double d = 0.;
- for (int c = 0; c < 3; ++c) {
- d += fabs((double)av[idx][c] - (double)bv[idx][c]);
- }
- maxVal = std::max(maxVal, d);
- }
- }
- else {
- errMsg("pdataMaxDiff: Grid Type is not supported (only Real, Vec3, int)");
+ Real maxVal = 0.;
+ FOR_PARTS(*a)
+ {
+ T diff = a->get(idx) - b->get(idx);
+ Real s = (Real)sum(abs(diff));
+ maxVal = std::max(maxVal, s);
}
-
return maxVal;
}
+Real pdataMaxDiff(const ParticleDataImpl<Real> *a, const ParticleDataImpl<Real> *b)
+{
+ return getPdataMaxDiff(a, b);
+}
static PyObject *_W_15(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
@@ -1531,8 +1507,8 @@ static PyObject *_W_15(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
PyObject *_retval = 0;
{
ArgLocker _lock;
- const ParticleDataBase *a = _args.getPtr<ParticleDataBase>("a", 0, &_lock);
- const ParticleDataBase *b = _args.getPtr<ParticleDataBase>("b", 1, &_lock);
+ const ParticleDataImpl<Real> *a = _args.getPtr<ParticleDataImpl<Real>>("a", 0, &_lock);
+ const ParticleDataImpl<Real> *b = _args.getPtr<ParticleDataImpl<Real>>("b", 1, &_lock);
_retval = toPy(pdataMaxDiff(a, b));
_args.check();
}
@@ -1552,6 +1528,76 @@ void PbRegister_pdataMaxDiff()
}
}
+Real pdataMaxDiffInt(const ParticleDataImpl<int> *a, const ParticleDataImpl<int> *b)
+{
+ return getPdataMaxDiff(a, b);
+}
+static PyObject *_W_16(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, "pdataMaxDiffInt", !noTiming);
+ PyObject *_retval = 0;
+ {
+ ArgLocker _lock;
+ const ParticleDataImpl<int> *a = _args.getPtr<ParticleDataImpl<int>>("a", 0, &_lock);
+ const ParticleDataImpl<int> *b = _args.getPtr<ParticleDataImpl<int>>("b", 1, &_lock);
+ _retval = toPy(pdataMaxDiffInt(a, b));
+ _args.check();
+ }
+ pbFinalizePlugin(parent, "pdataMaxDiffInt", !noTiming);
+ return _retval;
+ }
+ catch (std::exception &e) {
+ pbSetError("pdataMaxDiffInt", e.what());
+ return 0;
+ }
+}
+static const Pb::Register _RP_pdataMaxDiffInt("", "pdataMaxDiffInt", _W_16);
+extern "C" {
+void PbRegister_pdataMaxDiffInt()
+{
+ KEEP_UNUSED(_RP_pdataMaxDiffInt);
+}
+}
+
+Real pdataMaxDiffVec3(const ParticleDataImpl<Vec3> *a, const ParticleDataImpl<Vec3> *b)
+{
+ return getPdataMaxDiff(a, b);
+}
+static PyObject *_W_17(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, "pdataMaxDiffVec3", !noTiming);
+ PyObject *_retval = 0;
+ {
+ ArgLocker _lock;
+ const ParticleDataImpl<Vec3> *a = _args.getPtr<ParticleDataImpl<Vec3>>("a", 0, &_lock);
+ const ParticleDataImpl<Vec3> *b = _args.getPtr<ParticleDataImpl<Vec3>>("b", 1, &_lock);
+ _retval = toPy(pdataMaxDiffVec3(a, b));
+ _args.check();
+ }
+ pbFinalizePlugin(parent, "pdataMaxDiffVec3", !noTiming);
+ return _retval;
+ }
+ catch (std::exception &e) {
+ pbSetError("pdataMaxDiffVec3", e.what());
+ return 0;
+ }
+}
+static const Pb::Register _RP_pdataMaxDiffVec3("", "pdataMaxDiffVec3", _W_17);
+extern "C" {
+void PbRegister_pdataMaxDiffVec3()
+{
+ KEEP_UNUSED(_RP_pdataMaxDiffVec3);
+}
+}
+
//! calculate center of mass given density grid, for re-centering
Vec3 calcCenterOfMass(const Grid<Real> &density)
@@ -1567,7 +1613,7 @@ Vec3 calcCenterOfMass(const Grid<Real> &density)
p /= w;
return p;
}
-static PyObject *_W_16(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+static PyObject *_W_18(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1589,7 +1635,7 @@ static PyObject *_W_16(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
return 0;
}
}
-static const Pb::Register _RP_calcCenterOfMass("", "calcCenterOfMass", _W_16);
+static const Pb::Register _RP_calcCenterOfMass("", "calcCenterOfMass", _W_18);
extern "C" {
void PbRegister_calcCenterOfMass()
{
@@ -1789,7 +1835,7 @@ void updateFractions(const FlagGrid &flags,
fractions.setConst(Vec3(0.));
KnUpdateFractions(flags, phiObs, fractions, boundaryWidth, fracThreshold);
}
-static PyObject *_W_17(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+static PyObject *_W_19(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1816,7 +1862,7 @@ static PyObject *_W_17(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
return 0;
}
}
-static const Pb::Register _RP_updateFractions("", "updateFractions", _W_17);
+static const Pb::Register _RP_updateFractions("", "updateFractions", _W_19);
extern "C" {
void PbRegister_updateFractions()
{
@@ -1968,7 +2014,7 @@ void setObstacleFlags(FlagGrid &flags,
{
KnUpdateFlagsObs(flags, fractions, phiObs, phiOut, phiIn, boundaryWidth);
}
-static PyObject *_W_18(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+static PyObject *_W_20(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1996,7 +2042,7 @@ static PyObject *_W_18(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
return 0;
}
}
-static const Pb::Register _RP_setObstacleFlags("", "setObstacleFlags", _W_18);
+static const Pb::Register _RP_setObstacleFlags("", "setObstacleFlags", _W_20);
extern "C" {
void PbRegister_setObstacleFlags()
{
@@ -2113,7 +2159,7 @@ void initVortexVelocity(const Grid<Real> &phiObs,
{
kninitVortexVelocity(phiObs, vel, center, radius);
}
-static PyObject *_W_19(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+static PyObject *_W_21(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -2139,7 +2185,7 @@ static PyObject *_W_19(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
return 0;
}
}
-static const Pb::Register _RP_initVortexVelocity("", "initVortexVelocity", _W_19);
+static const Pb::Register _RP_initVortexVelocity("", "initVortexVelocity", _W_21);
extern "C" {
void PbRegister_initVortexVelocity()
{
@@ -2465,7 +2511,7 @@ int blurMacGrid(MACGrid &oG, MACGrid &tG, float si)
}
return tmGK.mDim;
}
-static PyObject *_W_20(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+static PyObject *_W_22(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -2489,7 +2535,7 @@ static PyObject *_W_20(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
return 0;
}
}
-static const Pb::Register _RP_blurMacGrid("", "blurMacGrid", _W_20);
+static const Pb::Register _RP_blurMacGrid("", "blurMacGrid", _W_22);
extern "C" {
void PbRegister_blurMacGrid()
{
@@ -2501,7 +2547,7 @@ int blurRealGrid(Grid<Real> &oG, Grid<Real> &tG, float si)
{
return blurGrid<Real>(oG, tG, si);
}
-static PyObject *_W_21(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+static PyObject *_W_23(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -2525,7 +2571,7 @@ static PyObject *_W_21(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
return 0;
}
}
-static const Pb::Register _RP_blurRealGrid("", "blurRealGrid", _W_21);
+static const Pb::Register _RP_blurRealGrid("", "blurRealGrid", _W_23);
extern "C" {
void PbRegister_blurRealGrid()
{
diff --git a/extern/mantaflow/preprocessed/registration.cpp b/extern/mantaflow/preprocessed/registration.cpp
index 6c1e68e6523..d5dae479f0e 100644
--- a/extern/mantaflow/preprocessed/registration.cpp
+++ b/extern/mantaflow/preprocessed/registration.cpp
@@ -111,6 +111,8 @@ extern void PbRegister_checkSymmetryVec3();
extern void PbRegister_projectPpmFull();
extern void PbRegister_addTestParts();
extern void PbRegister_pdataMaxDiff();
+extern void PbRegister_pdataMaxDiffInt();
+extern void PbRegister_pdataMaxDiffVec3();
extern void PbRegister_calcCenterOfMass();
extern void PbRegister_updateFractions();
extern void PbRegister_setObstacleFlags();
@@ -306,6 +308,8 @@ void MantaEnsureRegistration()
PbRegister_projectPpmFull();
PbRegister_addTestParts();
PbRegister_pdataMaxDiff();
+ PbRegister_pdataMaxDiffInt();
+ PbRegister_pdataMaxDiffVec3();
PbRegister_calcCenterOfMass();
PbRegister_updateFractions();
PbRegister_setObstacleFlags();