37using std::istringstream;
39using std::ostringstream;
46 : mCurrentID(++solverID), mMaxRes(fmd->domain->maxres)
49 cout <<
"FLUID: " << mCurrentID <<
" with res(" << res[0] <<
", " << res[1] <<
", " << res[2]
81 mTotalCells = mResX * mResY * mResZ;
82 mResGuiding = fds->
res;
101 mDensityIn =
nullptr;
108 mEmissionIn =
nullptr;
112 mDensityHigh =
nullptr;
113 mFlameHigh =
nullptr;
115 mReactHigh =
nullptr;
116 mColorRHigh =
nullptr;
117 mColorGHigh =
nullptr;
118 mColorBHigh =
nullptr;
122 mTextureU2 =
nullptr;
123 mTextureV2 =
nullptr;
124 mTextureW2 =
nullptr;
128 mPhiStaticIn =
nullptr;
130 mPhiOutStaticIn =
nullptr;
134 mMeshNodes =
nullptr;
135 mMeshTriangles =
nullptr;
136 mMeshVelocities =
nullptr;
140 mPhiObsStaticIn =
nullptr;
141 mNumObstacle =
nullptr;
142 mObVelocityX =
nullptr;
143 mObVelocityY =
nullptr;
144 mObVelocityZ =
nullptr;
147 mPhiGuideIn =
nullptr;
149 mGuideVelocityX =
nullptr;
150 mGuideVelocityY =
nullptr;
151 mGuideVelocityZ =
nullptr;
154 mInVelocityX =
nullptr;
155 mInVelocityY =
nullptr;
156 mInVelocityZ =
nullptr;
159 mFlipParticleData =
nullptr;
160 mFlipParticleVelocity =
nullptr;
161 mParticleData =
nullptr;
162 mParticleVelocity =
nullptr;
163 mParticleLife =
nullptr;
166 mFlipFromFile =
false;
167 mMeshFromFile =
false;
168 mParticlesFromFile =
false;
171 initializeMantaflow();
174 initializeRNAMap(fmd);
176 bool initSuccess =
true;
180 initSuccess &= initDomain();
182 if (mUsingObstacle) {
192 if (mUsingDrops || mUsingBubbles || mUsingFloats || mUsingTracers) {
194 mResXParticle = mUpresParticle * mResX;
195 mResYParticle = mUpresParticle * mResY;
196 mResZParticle = mUpresParticle * mResZ;
197 mTotalCellsParticles = mResXParticle * mResYParticle * mResZParticle;
205 mResXMesh = mUpresMesh * mResX;
206 mResYMesh = mUpresMesh * mResY;
207 mResZMesh = mUpresMesh * mResZ;
208 mTotalCellsMesh = mResXMesh * mResYMesh * mResZMesh;
211 initSuccess &= initMesh();
215 if (mUsingViscosity) {
219 if (mUsingDiffusion) {
227 if (mUsingFractions) {
234 initSuccess &= initDomain();
235 initSuccess &= initSmoke();
245 if (mUsingObstacle) {
262 mResXNoise = amplify * mResX;
263 mResYNoise = amplify * mResY;
264 mResZNoise = amplify * mResZ;
265 mTotalCellsHigh = mResXNoise * mResYNoise * mResZNoise;
268 initSuccess &= initNoise();
269 initSuccess &= initSmokeNoise();
294 ss <<
"set_manta_debuglevel(" <<
with_debug <<
")";
295 pythonCommands.push_back(ss.str());
299 fluid_bake_multiprocessing + fluid_bake_data + fluid_bake_noise +
300 fluid_bake_mesh + fluid_bake_particles + fluid_bake_guiding +
301 fluid_file_import + fluid_file_export + fluid_pre_step + fluid_post_step +
303 string finalString = parseScript(tmpString, fmd);
304 pythonCommands.push_back(finalString);
305 return runPythonString(pythonCommands);
312 string finalString = parseScript(tmpString, fmd);
313 pythonCommands.push_back(finalString);
315 return runPythonString(pythonCommands);
322 smoke_load_data + smoke_step;
323 string finalString = parseScript(tmpString, fmd);
324 pythonCommands.push_back(finalString);
326 return runPythonString(pythonCommands);
333 smoke_save_noise + smoke_load_noise + smoke_step_noise;
334 string finalString = parseScript(tmpString, fmd);
335 pythonCommands.push_back(finalString);
338 return runPythonString(pythonCommands);
344 vector<string> pythonCommands;
346 string finalString = parseScript(tmpString, fmd);
347 pythonCommands.push_back(finalString);
350 return runPythonString(pythonCommands);
358 vector<string> pythonCommands;
360 string finalString = parseScript(tmpString, fmd);
361 pythonCommands.push_back(finalString);
364 return runPythonString(pythonCommands);
372 vector<string> pythonCommands;
374 string finalString = parseScript(tmpString, fmd);
375 pythonCommands.push_back(finalString);
378 return runPythonString(pythonCommands);
386 vector<string> pythonCommands;
388 string finalString = parseScript(tmpString, fmd);
389 pythonCommands.push_back(finalString);
392 return runPythonString(pythonCommands);
400 vector<string> pythonCommands;
402 string finalString = parseScript(tmpString, fmd);
403 pythonCommands.push_back(finalString);
406 return runPythonString(pythonCommands);
414 vector<string> pythonCommands;
416 liquid_load_data + liquid_adaptive_step + liquid_step;
417 string finalString = parseScript(tmpString, fmd);
418 pythonCommands.push_back(finalString);
421 return runPythonString(pythonCommands);
430 string finalString = parseScript(tmpString, fmd);
431 pythonCommands.push_back(finalString);
434 return runPythonString(pythonCommands);
439 vector<string> pythonCommands;
441 string finalString = parseScript(tmpString, fmd);
442 pythonCommands.push_back(finalString);
445 return runPythonString(pythonCommands);
450 vector<string> pythonCommands;
452 string finalString = parseScript(tmpString, fmd);
453 pythonCommands.push_back(finalString);
455 mUsingViscosity =
true;
456 return runPythonString(pythonCommands);
461 std::vector<std::string> pythonCommands;
463 pythonCommands.push_back(finalString);
465 mUsingDiffusion =
true;
466 return runPythonString(pythonCommands);
472 vector<string> pythonCommands;
474 string finalString = parseScript(tmpString, fmd);
475 pythonCommands.push_back(finalString);
477 return (mUsingObstacle = runPythonString(pythonCommands));
485 vector<string> pythonCommands;
487 fluid_save_guiding + fluid_load_vel + fluid_load_guiding;
488 string finalString = parseScript(tmpString, fmd);
489 pythonCommands.push_back(finalString);
491 return (mUsingGuiding = runPythonString(pythonCommands));
498 vector<string> pythonCommands;
500 string finalString = parseScript(tmpString, fmd);
501 pythonCommands.push_back(finalString);
503 return (mUsingFractions = runPythonString(pythonCommands));
509 vector<string> pythonCommands;
511 string finalString = parseScript(tmpString, fmd);
512 pythonCommands.push_back(finalString);
514 return (mUsingInvel = runPythonString(pythonCommands));
522 vector<string> pythonCommands;
524 string finalString = parseScript(tmpString, fmd);
525 pythonCommands.push_back(finalString);
527 return (mUsingOutflow = runPythonString(pythonCommands));
534 vector<string> pythonCommands;
536 string finalString = parseScript(tmpString, fmd);
537 pythonCommands.push_back(finalString);
539 return runPythonString(pythonCommands);
544 if (!mParticleData) {
545 vector<string> pythonCommands;
548 liquid_save_particles;
549 string finalString = parseScript(tmpString, fmd);
550 pythonCommands.push_back(finalString);
552 return runPythonString(pythonCommands);
560 cout <<
"~FLUID: " << mCurrentID <<
" with res(" << mResX <<
", " << mResY <<
", " << mResZ
565 string tmpString =
"";
566 vector<string> pythonCommands;
570 tmpString += fluid_delete_all;
576 string finalString = parseScript(tmpString);
577 pythonCommands.push_back(finalString);
578 result = runPythonString(pythonCommands);
585 MANTA::terminateMantaflow();
600 PyObject *builtins = PyEval_GetBuiltins();
601 PyObject *mod_main = PyModule_New(
"__main__");
602 PyModule_AddStringConstant(mod_main,
"__name__",
"__main__");
606 PyModule_AddObject(mod_main,
"__file__", PyUnicode_InternFromString(filename));
608 PyModule_AddObjectRef(mod_main,
"__builtins__", builtins);
614 PyObject *modules = PyImport_GetModuleDict();
615 PyObject *main_mod_cmp = PyDict_GetItemString(modules,
"__main__");
616 if (mod_main == main_mod_cmp) {
621 PyDict_SetItemString(modules,
"__main__", mod_main);
626 PyObject *modules = PyImport_GetModuleDict();
627 *r_main_mod = PyDict_GetItemString(modules,
"__main__");
628 Py_XINCREF(*r_main_mod);
633 PyObject *modules = PyImport_GetModuleDict();
634 PyDict_SetItemString(modules,
"__main__", main_mod);
635 Py_XDECREF(main_mod);
666 PyGILState_STATE gilstate = PyGILState_Ensure();
669 PyObject *main_mod_backup;
678 string command = *it;
681 PyObject *return_value = PyRun_String(
682 command.c_str(), Py_file_input, globals_dict, globals_dict);
684 if (return_value ==
nullptr) {
686 if (PyErr_Occurred()) {
691 Py_DECREF(return_value);
697 PyGILState_Release(gilstate);
703void MANTA::initializeMantaflow()
706 cout <<
"Fluid: Initializing Mantaflow framework" << endl;
709 string filename =
"manta_scene_" +
to_string(mCurrentID) +
".py";
714 PyGILState_STATE gilstate = PyGILState_Ensure();
718 Pb::setup(
false, filename, fill, globals_dict);
719 PyGILState_Release(gilstate);
722void MANTA::terminateMantaflow()
725 cout <<
"Fluid: Releasing Mantaflow framework" << endl;
728 PyGILState_STATE gilstate = PyGILState_Ensure();
731 PyGILState_Release(gilstate);
737 cout <<
"MANTA::getCacheFileEnding()" << endl;
740 switch (cache_format) {
752 cerr <<
"Fluid Error -- Could not find file extension. Using default file extension."
760 return (value) ?
"True" :
"False";
766 cout <<
"MANTA::initializeRNAMap()" << endl;
773 cout <<
"Fluid: No modifier data given in RNA map setup - returning early" << endl;
781 string borderCollisions =
"";
783 borderCollisions +=
"x";
786 borderCollisions +=
"X";
789 borderCollisions +=
"y";
792 borderCollisions +=
"Y";
795 borderCollisions +=
"z";
798 borderCollisions +=
"Z";
801 string particleTypesStr =
"";
803 particleTypesStr +=
"PtypeSpray";
806 if (!particleTypesStr.empty()) {
807 particleTypesStr +=
"|";
809 particleTypesStr +=
"PtypeBubble";
812 if (!particleTypesStr.empty()) {
813 particleTypesStr +=
"|";
815 particleTypesStr +=
"PtypeFoam";
818 if (!particleTypesStr.empty()) {
819 particleTypesStr +=
"|";
821 particleTypesStr +=
"PtypeTracer";
823 if (particleTypesStr.empty()) {
824 particleTypesStr =
"0";
835 string vdbCompressionMethod =
"Compression_None";
837 vdbCompressionMethod =
"Compression_None";
840 vdbCompressionMethod =
"Compression_Zip";
843 vdbCompressionMethod =
"Compression_Blosc";
846 string vdbPrecisionHalf =
"Precision_Half";
848 vdbPrecisionHalf =
"Precision_Full";
851 vdbPrecisionHalf =
"Precision_Half";
854 vdbPrecisionHalf =
"Precision_Mini";
869 mRNAMap[
"DOMAIN_CLOSED"] =
getBooleanString(borderCollisions.compare(
"") == 0);
886 mRNAMap[
"BOUND_CONDITIONS"] = borderCollisions;
905 mRNAMap[
"NOISE_RESX"] =
to_string(mResXNoise);
908 mRNAMap[
"MESH_RESX"] =
to_string(mResXMesh);
911 mRNAMap[
"PARTICLE_RESX"] =
to_string(mResXParticle);
912 mRNAMap[
"PARTICLE_RESY"] = (is2D) ?
to_string(mResZParticle) :
to_string(mResYParticle);
914 mRNAMap[
"GUIDING_RESX"] =
to_string(mResGuiding[0]);
915 mRNAMap[
"GUIDING_RESY"] = (is2D) ?
to_string(mResGuiding[2]) :
to_string(mResGuiding[1]);
976 mRNAMap[
"FLUID_VISCOSITY"] =
to_string(viscosity);
977 mRNAMap[
"FLUID_DOMAIN_SIZE"] =
to_string(domainSize);
981 mRNAMap[
"SNDPARTICLE_TYPES"] = particleTypesStr;
988 mRNAMap[
"CACHE_DIR"] = cacheDirectory;
989 mRNAMap[
"COMPRESSION_OPENVDB"] = vdbCompressionMethod;
990 mRNAMap[
"PRECISION_OPENVDB"] = vdbPrecisionHalf;
1142string MANTA::getRealValue(
const string &varName)
1144 unordered_map<string, string>::iterator it;
1145 it = mRNAMap.find(varName);
1147 if (it == mRNAMap.end()) {
1148 cerr <<
"Fluid Error -- variable " << varName <<
" not found in RNA map " << it->second
1156string MANTA::parseLine(
const string &line)
1158 if (line.size() == 0) {
1162 int currPos = 0, start_del = 0, end_del = -1;
1163 bool readingVar =
false;
1164 const char delimiter =
'$';
1165 while (currPos < line.size()) {
1166 if (line[currPos] == delimiter && !readingVar) {
1168 start_del = currPos + 1;
1169 res += line.substr(end_del + 1, currPos - end_del - 1);
1171 else if (line[currPos] == delimiter && readingVar) {
1174 res += getRealValue(line.substr(start_del, currPos - start_del));
1178 res += line.substr(end_del + 1, line.size() - end_del);
1185 cout <<
"MANTA::parseScript()" << endl;
1188 istringstream f(setup_string);
1194 initializeRNAMap(fmd);
1196 while (getline(f, line)) {
1197 res << parseLine(line) <<
"\n";
1210 else if (c ==
'\'') {
1223 cout <<
"MANTA::writeConfiguration()" << endl;
1236 gzFile gzf = (gzFile)
BLI_gzopen(file.c_str(),
"wb1");
1238 cerr <<
"Fluid Error -- Cannot open file " << file << endl;
1243 gzwrite(gzf, &fds->
res, 3 *
sizeof(
int));
1244 gzwrite(gzf, &fds->
dx,
sizeof(
float));
1245 gzwrite(gzf, &fds->
dt,
sizeof(
float));
1246 gzwrite(gzf, &fds->
p0, 3 *
sizeof(
float));
1247 gzwrite(gzf, &fds->
p1, 3 *
sizeof(
float));
1248 gzwrite(gzf, &fds->
dp0, 3 *
sizeof(
float));
1249 gzwrite(gzf, &fds->
shift, 3 *
sizeof(
int));
1250 gzwrite(gzf, &fds->
obj_shift_f, 3 *
sizeof(
float));
1251 gzwrite(gzf, &fds->
obmat, 16 *
sizeof(
float));
1252 gzwrite(gzf, &fds->
base_res, 3 *
sizeof(
int));
1253 gzwrite(gzf, &fds->
res_min, 3 *
sizeof(
int));
1254 gzwrite(gzf, &fds->
res_max, 3 *
sizeof(
int));
1259 return (gzclose(gzf) == Z_OK);
1265 cout <<
"MANTA::writeData()" << endl;
1269 vector<string> pythonCommands;
1278 ss <<
"smoke_save_data_" << mCurrentID <<
"('" <<
escapePath(directory) <<
"', " << framenr
1279 <<
", '" << volume_format <<
"', " << resumable_cache <<
")";
1280 pythonCommands.push_back(ss.str());
1284 ss <<
"liquid_save_data_" << mCurrentID <<
"('" <<
escapePath(directory) <<
"', " << framenr
1285 <<
", '" << volume_format <<
"', " << resumable_cache <<
")";
1286 pythonCommands.push_back(ss.str());
1288 return runPythonString(pythonCommands);
1294 cout <<
"MANTA::writeNoise()" << endl;
1298 vector<string> pythonCommands;
1305 if (mUsingSmoke && mUsingNoise) {
1307 ss <<
"smoke_save_noise_" << mCurrentID <<
"('" <<
escapePath(directory) <<
"', " << framenr
1308 <<
", '" << volume_format <<
"', " << resumable_cache <<
")";
1309 pythonCommands.push_back(ss.str());
1311 return runPythonString(pythonCommands);
1317 cout <<
"MANTA::readConfiguration()" << endl;
1331 gzFile gzf = (gzFile)
BLI_gzopen(file.c_str(),
"rb");
1333 cerr <<
"Fluid Error -- Cannot open file " << file << endl;
1338 gzread(gzf, &fds->
res, 3 *
sizeof(
int));
1339 gzread(gzf, &fds->
dx,
sizeof(
float));
1340 gzread(gzf, &dummy,
sizeof(
float));
1341 gzread(gzf, &fds->
p0, 3 *
sizeof(
float));
1342 gzread(gzf, &fds->
p1, 3 *
sizeof(
float));
1343 gzread(gzf, &fds->
dp0, 3 *
sizeof(
float));
1344 gzread(gzf, &fds->
shift, 3 *
sizeof(
int));
1345 gzread(gzf, &fds->
obj_shift_f, 3 *
sizeof(
float));
1346 gzread(gzf, &fds->
obmat, 16 *
sizeof(
float));
1347 gzread(gzf, &fds->
base_res, 3 *
sizeof(
int));
1348 gzread(gzf, &fds->
res_min, 3 *
sizeof(
int));
1349 gzread(gzf, &fds->
res_max, 3 *
sizeof(
int));
1352 gzread(gzf, &fds->
cache_id, 4 *
sizeof(
char));
1356 return (gzclose(gzf) == Z_OK);
1362 cout <<
"MANTA::readData()" << endl;
1365 if (!mUsingSmoke && !mUsingLiquid) {
1370 vector<string> pythonCommands;
1376 string resumable_cache = (!resumable) ?
"False" :
"True";
1385 ss <<
"smoke_load_data_" << mCurrentID <<
"('" <<
escapePath(directory) <<
"', " << framenr
1386 <<
", '" << volume_format <<
"', " << resumable_cache <<
")";
1387 pythonCommands.push_back(ss.str());
1388 result &= runPythonString(pythonCommands);
1389 return (mSmokeFromFile = result);
1393 ss <<
"liquid_load_data_" << mCurrentID <<
"('" <<
escapePath(directory) <<
"', " << framenr
1394 <<
", '" << volume_format <<
"', " << resumable_cache <<
")";
1395 pythonCommands.push_back(ss.str());
1396 result &= runPythonString(pythonCommands);
1397 return (mFlipFromFile = result);
1405 cout <<
"MANTA::readNoise()" << endl;
1408 if (!mUsingSmoke || !mUsingNoise) {
1413 vector<string> pythonCommands;
1417 string resumable_cache = (!resumable) ?
"False" :
"True";
1430 ss <<
"smoke_load_noise_" << mCurrentID <<
"('" <<
escapePath(directory) <<
"', " << framenr
1431 <<
", '" << volume_format <<
"', " << resumable_cache <<
")";
1432 pythonCommands.push_back(ss.str());
1434 return (mNoiseFromFile = runPythonString(pythonCommands));
1440 cout <<
"MANTA::readMesh()" << endl;
1443 if (!mUsingLiquid || !mUsingMesh) {
1448 vector<string> pythonCommands;
1461 ss <<
"liquid_load_mesh_" << mCurrentID <<
"('" <<
escapePath(directory) <<
"', " << framenr
1462 <<
", '" << mesh_format <<
"')";
1463 pythonCommands.push_back(ss.str());
1467 ss <<
"liquid_load_meshvel_" << mCurrentID <<
"('" <<
escapePath(directory) <<
"', " << framenr
1468 <<
", '" << volume_format <<
"')";
1469 pythonCommands.push_back(ss.str());
1472 return (mMeshFromFile = runPythonString(pythonCommands));
1478 cout <<
"MANTA::readParticles()" << endl;
1481 if (!mUsingLiquid) {
1484 if (!mUsingDrops && !mUsingBubbles && !mUsingFloats && !mUsingTracers) {
1489 vector<string> pythonCommands;
1493 string resumable_cache = (!resumable) ?
"False" :
"True";
1506 ss <<
"liquid_load_particles_" << mCurrentID <<
"('" <<
escapePath(directory) <<
"', " << framenr
1507 <<
", '" << volume_format <<
"', " << resumable_cache <<
")";
1508 pythonCommands.push_back(ss.str());
1510 return (mParticlesFromFile = runPythonString(pythonCommands));
1516 cout <<
"MANTA::readGuiding()" << endl;
1519 if (!mUsingGuiding) {
1527 vector<string> pythonCommands;
1535 if (!
hasGuiding(fmd, framenr, sourceDomain)) {
1541 ss <<
"fluid_load_vel_" << mCurrentID <<
"('" <<
escapePath(directory) <<
"', " << framenr
1542 <<
", '" << volume_format <<
"')";
1546 ss <<
"fluid_load_guiding_" << mCurrentID <<
"('" <<
escapePath(directory) <<
"', " << framenr
1547 <<
", '" << volume_format <<
"')";
1549 pythonCommands.push_back(ss.str());
1551 return runPythonString(pythonCommands);
1557 cout <<
"MANTA::bakeData()" << endl;
1560 string tmpString, finalString;
1562 vector<string> pythonCommands;
1566 cacheDirData[0] =
'\0';
1567 cacheDirGuiding[0] =
'\0';
1578 ss <<
"bake_fluid_data_" << mCurrentID <<
"('" <<
escapePath(cacheDirData) <<
"', " << framenr
1579 <<
", '" << volume_format <<
"')";
1580 pythonCommands.push_back(ss.str());
1582 return runPythonString(pythonCommands);
1588 cout <<
"MANTA::bakeNoise()" << endl;
1592 vector<string> pythonCommands;
1596 cacheDirNoise[0] =
'\0';
1605 ss <<
"bake_noise_" << mCurrentID <<
"('" <<
escapePath(cacheDirNoise) <<
"', " << framenr
1606 <<
", '" << volume_format <<
"')";
1607 pythonCommands.push_back(ss.str());
1609 return runPythonString(pythonCommands);
1615 cout <<
"MANTA::bakeMesh()" << endl;
1619 vector<string> pythonCommands;
1623 cacheDirMesh[0] =
'\0';
1632 ss <<
"bake_mesh_" << mCurrentID <<
"('" <<
escapePath(cacheDirMesh) <<
"', " << framenr <<
", '"
1633 << volume_format <<
"', '" << mesh_format <<
"')";
1634 pythonCommands.push_back(ss.str());
1636 return runPythonString(pythonCommands);
1642 cout <<
"MANTA::bakeParticles()" << endl;
1646 vector<string> pythonCommands;
1650 cacheDirParticles[0] =
'\0';
1656 sizeof(cacheDirParticles),
1662 ss <<
"bake_particles_" << mCurrentID <<
"('" <<
escapePath(cacheDirParticles) <<
"', "
1663 << framenr <<
", '" << volume_format <<
"', " << resumable_cache <<
")";
1664 pythonCommands.push_back(ss.str());
1666 return runPythonString(pythonCommands);
1672 cout <<
"MANTA::bakeGuiding()" << endl;
1676 vector<string> pythonCommands;
1680 cacheDirGuiding[0] =
'\0';
1690 ss <<
"bake_guiding_" << mCurrentID <<
"('" <<
escapePath(cacheDirGuiding) <<
"', " << framenr
1691 <<
", '" << volume_format <<
"', " << resumable_cache <<
")";
1692 pythonCommands.push_back(ss.str());
1694 return runPythonString(pythonCommands);
1699 string tmpString, finalString;
1700 vector<string> pythonCommands;
1709 if (mUsingGuiding) {
1717 if (mUsingDrops || mUsingBubbles || mUsingFloats || mUsingTracers) {
1725 finalString = parseScript(tmpString, fmd);
1726 pythonCommands.push_back(finalString);
1728 return runPythonString(pythonCommands);
1734 cout <<
"MANTA::exportSmokeScript()" << endl;
1738 char cacheDirScript[
FILE_MAX] =
"\0";
1758 string manta_script;
1782 manta_script += header_grids + fluid_alloc +
smoke_alloc;
1802 manta_script += fluid_alloc_guiding;
1805 manta_script += fluid_alloc_obstacle;
1808 manta_script += fluid_alloc_invel;
1811 manta_script += fluid_alloc_outflow;
1823 manta_script += header_import + fluid_file_import + fluid_cache_helper + smoke_load_data;
1825 manta_script += smoke_load_noise;
1828 manta_script += fluid_load_guiding;
1832 manta_script += header_prepost + fluid_pre_step + fluid_post_step;
1835 manta_script += header_steps + smoke_adaptive_step + smoke_step;
1837 manta_script += smoke_step_noise;
1841 manta_script += header_main + smoke_standalone + fluid_standalone;
1844 string final_script = MANTA::parseScript(manta_script, fmd);
1848 myfile.open(cacheDirScript);
1849 myfile << final_script;
1852 cerr <<
"Fluid Error -- Could not export standalone Mantaflow smoke domain script";
1861 cout <<
"MANTA::exportLiquidScript()" << endl;
1865 char cacheDirScript[
FILE_MAX] =
"\0";
1888 string manta_script;
1898 if (drops || bubble || floater || tracer) {
1913 if (drops || bubble || floater || tracer) {
1924 manta_script += header_grids + fluid_alloc +
liquid_alloc;
1928 if (drops || bubble || floater || tracer) {
1932 manta_script += fluid_alloc_guiding;
1935 manta_script += fluid_alloc_obstacle;
1938 manta_script += fluid_alloc_fractions;
1941 manta_script += fluid_alloc_invel;
1944 manta_script += fluid_alloc_outflow;
1957 manta_script += header_import + fluid_file_import + fluid_cache_helper + liquid_load_data;
1959 manta_script += liquid_load_mesh;
1961 if (drops || bubble || floater || tracer) {
1962 manta_script += liquid_load_particles;
1965 manta_script += fluid_load_guiding;
1969 manta_script += header_prepost + fluid_pre_step + fluid_post_step;
1972 manta_script += header_steps + liquid_adaptive_step + liquid_step;
1974 manta_script += liquid_step_mesh;
1976 if (drops || bubble || floater || tracer) {
1977 manta_script += liquid_step_particles;
1981 manta_script += header_main + liquid_standalone + fluid_standalone;
1984 string final_script = MANTA::parseScript(manta_script, fmd);
1988 myfile.open(cacheDirScript);
1989 myfile << final_script;
1992 cerr <<
"Fluid Error -- Could not export standalone Mantaflow liquid domain script";
2007 if ((varName ==
"") || (functionName ==
"")) {
2009 cout <<
"Fluid: Missing Python variable name and/or function name -- name is: " << varName
2010 <<
", function name is: " << functionName << endl;
2015 PyGILState_STATE gilstate = PyGILState_Ensure();
2016 PyObject *var =
nullptr, *func =
nullptr, *returnedValue =
nullptr;
2023 PyGILState_Release(gilstate);
2029 PyGILState_Release(gilstate);
2035 PyGILState_Release(gilstate);
2039 func = PyObject_GetAttrString(var, functionName.c_str());
2043 PyGILState_Release(gilstate);
2048 returnedValue = PyObject_CallObject(func,
nullptr);
2052 PyGILState_Release(gilstate);
2053 return (!isAttribute) ? returnedValue : func;
2064 PyGILState_STATE gilstate = PyGILState_Ensure();
2066 PyObject *encoded = PyUnicode_AsUTF8String(inputObject);
2067 char *result = PyBytes_AsString(encoded);
2069 Py_DECREF(inputObject);
2072 istringstream in(
str);
2073 void *dataPointer =
nullptr;
2078 PyGILState_Release(gilstate);
2090 PyGILState_STATE gilstate = PyGILState_Ensure();
2094 double result = PyFloat_AS_DOUBLE(inputObject);
2095 Py_DECREF(inputObject);
2097 PyGILState_Release(gilstate);
2109 PyGILState_STATE gilstate = PyGILState_Ensure();
2111 long result = PyLong_AsLong(inputObject);
2112 Py_DECREF(inputObject);
2114 PyGILState_Release(gilstate);
2118template<
class T>
static T *
getPointer(
string pyObjectName,
string pyFunctionName)
2126 cout <<
"MANTA::getFrame()" << endl;
2129 string func =
"frame";
2131 string solver =
"s" + id;
2139 cout <<
"MANTA::getTimestep()" << endl;
2142 string func =
"timestep";
2144 string solver =
"s" + id;
2160 cout <<
"MANTA::adaptTimestep()" << endl;
2163 vector<string> pythonCommands;
2166 ss <<
"fluid_adapt_time_step_" << mCurrentID <<
"()";
2167 pythonCommands.push_back(ss.str());
2169 runPythonString(pythonCommands);
2175 cout <<
"MANTA::updatePointers()" << endl;
2194 bool parts = !flush && liquid && (drops | bubble | floater | tracer);
2198 string func =
"getDataPointer";
2199 string funcNodes =
"getNodesDataPointer";
2200 string funcTris =
"getTrisDataPointer";
2203 string s_ext =
"_s" + id;
2204 string pp_ext =
"_pp" + id;
2205 string snd_ext =
"_sp" + id;
2206 string sm_ext =
"_sm" + id;
2207 string mesh_ext =
"_mesh" + id;
2208 string sn_ext =
"_sn" + id;
2210 mFlags = (smoke || liquid) ?
getPointer<int>(
"flags" + s_ext, func) :
nullptr;
2211 mPhiIn = (smoke || liquid) ?
getPointer<float>(
"phiIn" + s_ext, func) :
nullptr;
2212 mPhiStaticIn = (smoke || liquid) ?
getPointer<float>(
"phiSIn" + s_ext, func) :
nullptr;
2213 mVelocityX = (smoke || liquid) ?
getPointer<float>(
"x_vel" + s_ext, func) :
nullptr;
2214 mVelocityY = (smoke || liquid) ?
getPointer<float>(
"y_vel" + s_ext, func) :
nullptr;
2215 mVelocityZ = (smoke || liquid) ?
getPointer<float>(
"z_vel" + s_ext, func) :
nullptr;
2216 mForceX = (smoke || liquid) ?
getPointer<float>(
"x_force" + s_ext, func) :
nullptr;
2217 mForceY = (smoke || liquid) ?
getPointer<float>(
"y_force" + s_ext, func) :
nullptr;
2218 mForceZ = (smoke || liquid) ?
getPointer<float>(
"z_force" + s_ext, func) :
nullptr;
2219 mPressure = (smoke || liquid) ?
getPointer<float>(
"pressure" + s_ext, func) :
nullptr;
2223 mPhiOutStaticIn = (outflow) ?
getPointer<float>(
"phiOutSIn" + s_ext, func) :
nullptr;
2227 mPhiObsStaticIn = (obstacle) ?
getPointer<float>(
"phiObsSIn" + s_ext, func) :
nullptr;
2228 mObVelocityX = (obstacle) ?
getPointer<float>(
"x_obvel" + s_ext, func) :
nullptr;
2229 mObVelocityY = (obstacle) ?
getPointer<float>(
"y_obvel" + s_ext, func) :
nullptr;
2230 mObVelocityZ = (obstacle) ?
getPointer<float>(
"z_obvel" + s_ext, func) :
nullptr;
2231 mNumObstacle = (obstacle) ?
getPointer<float>(
"numObs" + s_ext, func) :
nullptr;
2234 mPhiGuideIn = (guiding) ?
getPointer<float>(
"phiGuideIn" + s_ext, func) :
nullptr;
2235 mGuideVelocityX = (guiding) ?
getPointer<float>(
"x_guidevel" + s_ext, func) :
nullptr;
2236 mGuideVelocityY = (guiding) ?
getPointer<float>(
"y_guidevel" + s_ext, func) :
nullptr;
2237 mGuideVelocityZ = (guiding) ?
getPointer<float>(
"z_guidevel" + s_ext, func) :
nullptr;
2249 mEmissionIn = (smoke) ?
getPointer<float>(
"emissionIn" + s_ext, func) :
nullptr;
2280 mFlameHigh = (noise && fire) ?
getPointer<float>(
"flame" + sn_ext, func) :
nullptr;
2281 mFuelHigh = (noise && fire) ?
getPointer<float>(
"fuel" + sn_ext, func) :
nullptr;
2282 mReactHigh = (noise && fire) ?
getPointer<float>(
"react" + sn_ext, func) :
nullptr;
2285 mColorRHigh = (noise && colors) ?
getPointer<float>(
"color_r" + sn_ext, func) :
nullptr;
2286 mColorGHigh = (noise && colors) ?
getPointer<float>(
"color_g" + sn_ext, func) :
nullptr;
2287 mColorBHigh = (noise && colors) ?
getPointer<float>(
"color_b" + sn_ext, func) :
nullptr;
2291 mFlipParticleData = (liquid) ?
getPointer<vector<pData>>(
"pp" + s_ext, func) :
nullptr;
2292 mFlipParticleVelocity = (liquid) ?
getPointer<vector<pVel>>(
"pVel" + pp_ext, func) :
nullptr;
2295 mMeshNodes = (
mesh) ?
getPointer<vector<Node>>(
"mesh" + sm_ext, funcNodes) :
nullptr;
2296 mMeshTriangles = (
mesh) ?
getPointer<vector<Triangle>>(
"mesh" + sm_ext, funcTris) :
nullptr;
2299 mMeshVelocities = (meshvel) ?
getPointer<vector<pVel>>(
"mVel" + mesh_ext, func) :
nullptr;
2302 mParticleData = (parts) ?
getPointer<vector<pData>>(
"ppSnd" + snd_ext, func) :
nullptr;
2303 mParticleVelocity = (parts) ?
getPointer<vector<pVel>>(
"pVelSnd" + pp_ext, func) :
nullptr;
2304 mParticleLife = (parts) ?
getPointer<vector<float>>(
"pLifeSnd" + pp_ext, func) :
nullptr;
2306 mFlipFromFile =
false;
2307 mMeshFromFile =
false;
2308 mParticlesFromFile =
false;
2309 mSmokeFromFile =
false;
2310 mNoiseFromFile =
false;
2332 cout <<
"Fluid: Has Data: " << exists << endl;
2359 cout <<
"Fluid: Has Noise: " << exists << endl;
2377 cout <<
"Fluid: Has Mesh: " << exists << endl;
2404 cout <<
"Fluid: Has Particles: " << exists << endl;
2415 bool exists =
BLI_exists(getFile(fmd, subdirectory, filename, extension, framenr).c_str());
2420 exists =
BLI_exists(getFile(fmd, subdirectory, filename, extension, framenr).c_str());
2424 cout <<
"Fluid: Has Guiding: " << exists << endl;
2438string MANTA::getFile(
2439 FluidModifierData *fmd,
string subdirectory,
string fname,
string extension,
int framenr)
2442 string path = getDirectory(fmd, subdirectory);
2443 string filename = fname +
"_####" + extension;
2444 BLI_path_join(targetFile,
sizeof(targetFile), path.c_str(), filename.c_str());
File and directory operations.
void * BLI_gzopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BLI_dir_create_recursive(const char *dirname) ATTR_NONNULL()
bool BLI_path_make_safe(char *path) ATTR_NONNULL(1)
#define BLI_path_join(...)
bool BLI_path_frame(char *path, size_t path_maxncpy, int frame, int digits) ATTR_NONNULL(1)
@ FLUID_DOMAIN_PARTICLE_SPRAY
@ FLUID_DOMAIN_PARTICLE_FOAM
@ FLUID_DOMAIN_PARTICLE_TRACER
@ FLUID_DOMAIN_PARTICLE_BUBBLE
#define FLUID_DOMAIN_LIQUID_SCRIPT
#define FLUID_NAME_EMISSION
#define FLUID_NAME_TRAPPEDAIR_PARTICLES
#define FLUID_CACHE_VERSION
#define FLUID_NAME_FUEL_NOISE
#define FLUID_NAME_COLORG_NOISE
#define FLUID_NAME_COLORB_NOISE
#define FLUID_NAME_FLAGS_MESH
#define FLUID_DOMAIN_DIR_DATA
#define FLUID_NAME_PHIPARTS_MESH
#define FLUID_DOMAIN_DIR_PARTICLES
#define FLUID_NAME_TMPFLAGS
#define FLUID_NAME_PHIOBS_PARTICLES
#define FLUID_NAME_FORCES
#define FLUID_NAME_PHIIN_NOISE
#define FLUID_NAME_WAVECREST_PARTICLES
#define FLUID_NAME_VELOCITY_PARTICLES
#define FLUID_NAME_EMISSIONIN
#define FLUID_NAME_PHIGUIDEIN
#define FLUID_NAME_PLIFE_PARTICLES
#define FLUID_NAME_PFORCE_PARTICLES
#define FLUID_NAME_PHITMP
#define FLUID_NAME_VELOCITYOLD
#define FLUID_NAME_PHIOBSSIN
#define FLUID_NAME_PP_PARTICLES
@ FLUID_DOMAIN_TYPE_LIQUID
#define FLUID_NAME_KINETICENERGY_PARTICLES
#define FLUID_NAME_FORCE_Y
#define FLUID_NAME_PINDEX
#define FLUID_NAME_FUELIN
#define FLUID_NAME_PARTICLES
#define FLUID_DOMAIN_EXTENSION_BINOBJ
#define FLUID_NAME_FORCE_Z
#define FLUID_DOMAIN_SMOKE_SCRIPT
#define FLUID_NAME_GUIDEVEL_Z
#define FLUID_NAME_PVEL_PARTICLES
@ FLUID_DOMAIN_METHOD_APIC
#define FLUID_NAME_GUIDEVEL_X
#define FLUID_NAME_TEXTURE_U
#define FLUID_DOMAIN_DIR_MESH
#define FLUID_DOMAIN_DIR_GUIDE
#define FLUID_DOMAIN_DIR_SCRIPT
#define FLUID_NAME_PARTSVEL_PARTICLES
#define FLUID_NAME_TMPIN_NOISE
#define FLUID_NAME_OBVEL_X
#define FLUID_NAME_PHIOBS
#define FLUID_NAME_CONFIG
#define FLUID_NAME_COLORR_NOISE
#define FLUID_DOMAIN_EXTENSION_OPENVDB
#define FLUID_NAME_GPI_MESH
#define FLUID_NAME_VELOCITYZ
#define FLUID_NAME_GUIDEVELC
#define FLUID_NAME_VELOCITYTMP
@ FLUID_DOMAIN_FILE_BIN_OBJECT
@ FLUID_DOMAIN_FILE_OBJECT
@ FLUID_DOMAIN_FILE_OPENVDB
#define FLUID_NAME_VELOCITYY
#define FLUID_NAME_PINDEX_MESH
#define FLUID_NAME_PHIOUT_PARTICLES
#define FLUID_NAME_CURVATURE
#define FLUID_NAME_PHISIN
#define FLUID_NAME_VELOCITY_MESH
#define FLUID_DOMAIN_EXTENSION_OBJ
#define FLUID_NAME_INVEL_Z
#define FLUID_NAME_INVELC
@ VDB_PRECISION_MINI_FLOAT
@ VDB_PRECISION_FULL_FLOAT
@ VDB_PRECISION_HALF_FLOAT
#define FLUID_NAME_FLAGS_NOISE
#define FLUID_NAME_PARTSLIFE_PARTICLES
#define FLUID_NAME_COLORR
#define FLUID_NAME_TEXTURE_U2
#define FLUID_NAME_PHIOUT
#define FLUID_NAME_TEXTURE_V2
#define FLUID_NAME_EMISSIONIN_NOISE
#define FLUID_NAME_GUIDEVEL_Y
#define FLUID_NAME_TEXTURE_W2
#define FLUID_NAME_DENSITY_NOISE
@ FLUID_DOMAIN_ACTIVE_COLORS
@ FLUID_DOMAIN_ACTIVE_FIRE
@ FLUID_DOMAIN_ACTIVE_INVEL
@ FLUID_DOMAIN_ACTIVE_GUIDE
@ FLUID_DOMAIN_ACTIVE_OUTFLOW
@ FLUID_DOMAIN_ACTIVE_HEAT
@ FLUID_DOMAIN_ACTIVE_OBSTACLE
#define FLUID_NAME_PHIOUTIN
#define FLUID_NAME_NUMOBS
#define FLUID_NAME_COLORG
#define FLUID_NAME_PHIOUTSIN
#define FLUID_NAME_GUIDEVEL
#define FLUID_NAME_VELOCITYPARTS
#define FLUID_DOMAIN_DIR_CONFIG
#define FLUID_NAME_PHIOBS_NOISE
#define FLUID_NAME_INVEL_Y
#define FLUID_NAME_SHADOW
#define FLUID_NAME_PARTSVELOCITY
#define FLUID_NAME_OBVEL_Y
#define FLUID_NAME_VELOCITYVEC_MESH
#define FLUID_NAME_COLORB
@ FLUID_DOMAIN_DELETE_IN_OBSTACLE
@ FLUID_DOMAIN_USE_RESUMABLE_CACHE
@ FLUID_DOMAIN_USE_DISSOLVE_LOG
@ FLUID_DOMAIN_USE_DIFFUSION
@ FLUID_DOMAIN_USE_ADAPTIVE_TIME
@ FLUID_DOMAIN_USE_VISCOSITY
@ FLUID_DOMAIN_USE_SPEED_VECTORS
@ FLUID_DOMAIN_USE_FRACTIONS
@ FLUID_DOMAIN_USE_DISSOLVE
#define FLUID_NAME_OBVELC
#define FLUID_NAME_COLORGIN
#define FLUID_NAME_VELOCITY
#define FLUID_NAME_PHIOBSIN
@ SNDPARTICLE_BOUNDARY_DELETE
@ SNDPARTICLE_BOUNDARY_PUSHOUT
#define FLUID_NAME_PHI_PARTICLES
#define FLUID_NAME_FORCE_X
#define FLUID_NAME_NEIGHBORRATIO_PARTICLES
#define FLUID_NAME_PARTS_PARTICLES
#define FLUID_NAME_COLORBIN
#define FLUID_NAME_GUIDING
#define FLUID_NAME_DENSITY
#define FLUID_NAME_PARTSFORCE_PARTICLES
#define FLUID_NAME_VELOCITY_GUIDE
#define FLUID_DOMAIN_EXTENSION_UNI
#define FLUID_NAME_TEMPERATUREIN
#define FLUID_NAME_INVEL_X
#define FLUID_NAME_REACTIN
#define FLUID_NAME_PRESSURE
#define FLUID_NAME_MAPWEIGHTS
#define FLUID_NAME_FLAME_NOISE
#define FLUID_NAME_PHIOUT_NOISE
#define FLUID_NAME_VELOCITY_NOISE
#define FLUID_NAME_TEXTURE_W
#define FLUID_NAME_PP_MESH
#define FLUID_DOMAIN_DIR_NOISE
#define FLUID_NAME_OBVEL_Z
#define FLUID_NAME_PHIPARTS
#define FLUID_NAME_NUMGUIDES
#define FLUID_NAME_HEATIN
@ FLUID_DOMAIN_MESH_IMPROVED
#define FLUID_NAME_FLAGS_PARTICLES
@ FLUID_DOMAIN_BORDER_BOTTOM
@ FLUID_DOMAIN_BORDER_LEFT
@ FLUID_DOMAIN_BORDER_RIGHT
@ FLUID_DOMAIN_BORDER_FRONT
@ FLUID_DOMAIN_BORDER_TOP
@ FLUID_DOMAIN_BORDER_BACK
#define FLUID_NAME_TEMPERATURE
#define FLUID_NAME_PHI_MESH
#define FLUID_NAME_FRACTIONS
#define FLUID_NAME_REACT_NOISE
#define FLUID_NAME_TEXTURE_V
#define FLUID_NAME_COLORRIN
#define FLUID_NAME_ENERGY
#define FLUID_NAME_VELOCITYX
#define FLUID_NAME_DENSITYIN
#define FLUID_NAME_NORMAL_PARTICLES
#define FLUID_NAME_WEIGHTGUIDE
#define FLUID_DOMAIN_EXTENSION_RAW
static string getBooleanString(int value)
static PyObject * callPythonFunction(string varName, string functionName, bool isAttribute=false)
static string getCacheFileEnding(char cache_format)
static PyObject * manta_python_main_module_create(const char *filename)
static PyObject * manta_main_module
static T * getPointer(string pyObjectName, string pyFunctionName)
static string escapePath(string const &s)
static void manta_python_main_module_restore(PyObject *main_mod)
static void * pyObjectToPointer(PyObject *inputObject)
static void manta_python_main_module_clear()
static void manta_python_main_module_backup(PyObject **r_main_mod)
static PyObject * manta_python_main_module_ensure()
static void manta_python_main_module_activate(PyObject *mod_main)
static double pyObjectToDouble(PyObject *inputObject)
static long pyObjectToLong(PyObject *inputObject)
Read Guarded memory(de)allocation.
pow(value.r - subtrahend, 2.0)") .do_static_compilation(true)
const std::string fluid_with_outflow
const std::string fluid_variables_noise
const std::string fluid_with_fractions
const std::string fluid_solver_viscosity
const std::string fluid_variables_particles
const std::string fluid_with_invel
const std::string fluid_solver_particles
const std::string fluid_solver_mesh
const std::string manta_import
const std::string manta_debuglevel
const std::string fluid_with_sndparts
const std::string fluid_variables
const std::string fluid_solver_noise
const std::string fluid_variables_viscosity
const std::string fluid_time_stepping
const std::string fluid_solver
const std::string fluid_solver_guiding
const std::string fluid_variables_guiding
const std::string fluid_variables_mesh
const std::string fluid_with_obstacle
static const char * to_string(const Interpolation &interp)
const std::string liquid_alloc_viscosity
const std::string liquid_variables
const std::string liquid_variables_particles
const std::string liquid_alloc_particles
const std::string liquid_alloc
const std::string liquid_alloc_curvature
const std::string liquid_alloc_mesh
const std::string liquid_init_phi
const std::string smoke_alloc_noise
const std::string smoke_alloc_heat
const std::string smoke_alloc_colors
const std::string smoke_alloc_fire_noise
const std::string smoke_with_colors
const std::string smoke_with_fire
const std::string smoke_with_heat
const std::string smoke_variables
const std::string smoke_variables_noise
const std::string smoke_alloc_colors_noise
const std::string smoke_init_colors_noise
const std::string smoke_init_colors
const std::string smoke_wavelet_noise
const std::string smoke_alloc_fire
const std::string smoke_alloc
float sndparticle_tau_min_wc
int sndparticle_update_radius
char sndparticle_boundary
float fractions_threshold
char cache_particle_format
float particle_randomness
int sndparticle_potential_radius
float mesh_particle_radius
float flame_smoke_color[3]
float sndparticle_tau_max_wc
float sndparticle_tau_max_ta
float sndparticle_tau_min_ta
float particle_band_width
float sndparticle_tau_min_k
char cache_directory[1024]
struct Object * guide_parent
float sndparticle_tau_max_k
struct FluidDomainSettings * domain
bool exportSmokeScript(struct FluidModifierData *fmd)
bool bakeNoise(FluidModifierData *fmd, int framenr)
bool writeNoise(FluidModifierData *fmd, int framenr)
bool initFireHigh(struct FluidModifierData *fmd=nullptr)
bool hasNoise(FluidModifierData *fmd, int framenr)
bool exportLiquidScript(struct FluidModifierData *fmd)
bool readData(FluidModifierData *fmd, int framenr, bool resumable)
bool initOutflow(FluidModifierData *fmd=nullptr)
bool writeConfiguration(FluidModifierData *fmd, int framenr)
bool initFire(struct FluidModifierData *fmd=nullptr)
bool writeData(FluidModifierData *fmd, int framenr)
bool needsRealloc(FluidModifierData *fmd)
bool readParticles(FluidModifierData *fmd, int framenr, bool resumable)
bool readMesh(FluidModifierData *fmd, int framenr)
bool readGuiding(FluidModifierData *fmd, int framenr, bool sourceDomain)
bool initLiquidViscosity(FluidModifierData *fmd=nullptr)
bool bakeMesh(FluidModifierData *fmd, int framenr)
bool initLiquid(FluidModifierData *fmd=nullptr)
bool initFractions(FluidModifierData *fmd=nullptr)
bool initLiquidMesh(FluidModifierData *fmd=nullptr)
bool hasMesh(FluidModifierData *fmd, int framenr)
bool initGuiding(FluidModifierData *fmd=nullptr)
bool readConfiguration(FluidModifierData *fmd, int framenr)
bool bakeGuiding(FluidModifierData *fmd, int framenr)
static atomic< int > solverID
bool hasParticles(FluidModifierData *fmd, int framenr)
bool initColorsHigh(struct FluidModifierData *fmd=nullptr)
bool initObstacle(FluidModifierData *fmd=nullptr)
bool initColors(struct FluidModifierData *fmd=nullptr)
bool readNoise(FluidModifierData *fmd, int framenr, bool resumable)
bool initSndParts(FluidModifierData *fmd=nullptr)
bool initCurvature(FluidModifierData *fmd=nullptr)
bool hasGuiding(FluidModifierData *fmd, int framenr, bool sourceDomain)
bool initHeat(struct FluidModifierData *fmd=nullptr)
bool bakeParticles(FluidModifierData *fmd, int framenr)
MANTA(int *res, struct FluidModifierData *fmd)
bool bakeData(FluidModifierData *fmd, int framenr)
bool initInVelocity(FluidModifierData *fmd=nullptr)
void updatePointers(FluidModifierData *fmd, bool flush=false)
bool hasData(FluidModifierData *fmd, int framenr)
bool updateVariables(FluidModifierData *fmd)
bool hasConfig(FluidModifierData *fmd, int framenr)
bool initLiquidSndParts(FluidModifierData *fmd=nullptr)