Commit: 902a948f89a75ec93e17142ad18cb66c188ad0f5
Author: Sriharsha Kotcharlakot
Date:   Mon Aug 3 22:18:22 2020 +0530
Branches: soc-2020-fluid-tools
https://developer.blender.org/rB902a948f89a75ec93e17142ad18cb66c188ad0f5

Merge branch 'master' into soc-2020-fluid-tools

===================================================================



===================================================================

diff --cc intern/mantaflow/intern/MANTA_main.cpp
index 6f425c81f4f,7de1aca6e87..7070a8ff70b
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@@ -130,9 -118,8 +118,9 @@@ MANTA::MANTA(int *res, FluidModifierDat
    mFuelIn = nullptr;
    mReactIn = nullptr;
    mEmissionIn = nullptr;
 +  mPressure = nullptr;
  
-   // Smoke high res grids
+   /* Smoke high res grids. */
    mDensityHigh = nullptr;
    mFlameHigh = nullptr;
    mFuelHigh = nullptr;
@@@ -1966,128 -1999,107 +2000,108 @@@ void MANTA::updatePointers(FluidModifie
    string funcTris = "getTrisDataPointer";
  
    string id = to_string(mCurrentID);
-   string solver = "s" + id;
-   string parts = "pp" + id;
-   string snd = "sp" + id;
-   string mesh = "sm" + id;
-   string mesh2 = "mesh" + id;
-   string noise = "sn" + id;
-   string solver_ext = "_" + solver;
-   string parts_ext = "_" + parts;
-   string snd_ext = "_" + snd;
-   string mesh_ext = "_" + mesh;
-   string mesh_ext2 = "_" + mesh2;
-   string noise_ext = "_" + noise;
- 
-   mFlags = (int *)pyObjectToPointer(callPythonFunction("flags" + solver_ext, 
func));
-   mPhiIn = (float *)pyObjectToPointer(callPythonFunction("phiIn" + 
solver_ext, func));
-   mPhiStaticIn = (float *)pyObjectToPointer(callPythonFunction("phiSIn" + 
solver_ext, func));
-   mVelocityX = (float *)pyObjectToPointer(callPythonFunction("x_vel" + 
solver_ext, func));
-   mVelocityY = (float *)pyObjectToPointer(callPythonFunction("y_vel" + 
solver_ext, func));
-   mVelocityZ = (float *)pyObjectToPointer(callPythonFunction("z_vel" + 
solver_ext, func));
-   mForceX = (float *)pyObjectToPointer(callPythonFunction("x_force" + 
solver_ext, func));
-   mForceY = (float *)pyObjectToPointer(callPythonFunction("y_force" + 
solver_ext, func));
-   mForceZ = (float *)pyObjectToPointer(callPythonFunction("z_force" + 
solver_ext, func));
-   mPressure = (float *)pyObjectToPointer(callPythonFunction("pressure" + 
solver_ext, func));
- 
-   if (mUsingOutflow) {
-     mPhiOutIn = (float *)pyObjectToPointer(callPythonFunction("phiOutIn" + 
solver_ext, func));
-     mPhiOutStaticIn = (float *)pyObjectToPointer(
-         callPythonFunction("phiOutSIn" + solver_ext, func));
-   }
-   if (mUsingObstacle) {
-     mPhiObsIn = (float *)pyObjectToPointer(callPythonFunction("phiObsIn" + 
solver_ext, func));
-     mPhiObsStaticIn = (float *)pyObjectToPointer(
-         callPythonFunction("phiObsSIn" + solver_ext, func));
-     mObVelocityX = (float *)pyObjectToPointer(callPythonFunction("x_obvel" + 
solver_ext, func));
-     mObVelocityY = (float *)pyObjectToPointer(callPythonFunction("y_obvel" + 
solver_ext, func));
-     mObVelocityZ = (float *)pyObjectToPointer(callPythonFunction("z_obvel" + 
solver_ext, func));
-     mNumObstacle = (float *)pyObjectToPointer(callPythonFunction("numObs" + 
solver_ext, func));
-   }
-   if (mUsingGuiding) {
-     mPhiGuideIn = (float *)pyObjectToPointer(callPythonFunction("phiGuideIn" 
+ solver_ext, func));
-     mGuideVelocityX = (float *)pyObjectToPointer(
-         callPythonFunction("x_guidevel" + solver_ext, func));
-     mGuideVelocityY = (float *)pyObjectToPointer(
-         callPythonFunction("y_guidevel" + solver_ext, func));
-     mGuideVelocityZ = (float *)pyObjectToPointer(
-         callPythonFunction("z_guidevel" + solver_ext, func));
-     mNumGuide = (float *)pyObjectToPointer(callPythonFunction("numGuides" + 
solver_ext, func));
-   }
-   if (mUsingInvel) {
-     mInVelocityX = (float *)pyObjectToPointer(callPythonFunction("x_invel" + 
solver_ext, func));
-     mInVelocityY = (float *)pyObjectToPointer(callPythonFunction("y_invel" + 
solver_ext, func));
-     mInVelocityZ = (float *)pyObjectToPointer(callPythonFunction("z_invel" + 
solver_ext, func));
-   }
-   if (mUsingSmoke) {
-     mDensity = (float *)pyObjectToPointer(callPythonFunction("density" + 
solver_ext, func));
-     mDensityIn = (float *)pyObjectToPointer(callPythonFunction("densityIn" + 
solver_ext, func));
-     mShadow = (float *)pyObjectToPointer(callPythonFunction("shadow" + 
solver_ext, func));
-     mEmissionIn = (float *)pyObjectToPointer(callPythonFunction("emissionIn" 
+ solver_ext, func));
-   }
-   if (mUsingSmoke && mUsingHeat) {
-     mHeat = (float *)pyObjectToPointer(callPythonFunction("heat" + 
solver_ext, func));
-     mHeatIn = (float *)pyObjectToPointer(callPythonFunction("heatIn" + 
solver_ext, func));
-   }
-   if (mUsingSmoke && mUsingFire) {
-     mFlame = (float *)pyObjectToPointer(callPythonFunction("flame" + 
solver_ext, func));
-     mFuel = (float *)pyObjectToPointer(callPythonFunction("fuel" + 
solver_ext, func));
-     mReact = (float *)pyObjectToPointer(callPythonFunction("react" + 
solver_ext, func));
-     mFuelIn = (float *)pyObjectToPointer(callPythonFunction("fuelIn" + 
solver_ext, func));
-     mReactIn = (float *)pyObjectToPointer(callPythonFunction("reactIn" + 
solver_ext, func));
-   }
-   if (mUsingSmoke && mUsingColors) {
-     mColorR = (float *)pyObjectToPointer(callPythonFunction("color_r" + 
solver_ext, func));
-     mColorG = (float *)pyObjectToPointer(callPythonFunction("color_g" + 
solver_ext, func));
-     mColorB = (float *)pyObjectToPointer(callPythonFunction("color_b" + 
solver_ext, func));
-     mColorRIn = (float *)pyObjectToPointer(callPythonFunction("color_r_in" + 
solver_ext, func));
-     mColorGIn = (float *)pyObjectToPointer(callPythonFunction("color_g_in" + 
solver_ext, func));
-     mColorBIn = (float *)pyObjectToPointer(callPythonFunction("color_b_in" + 
solver_ext, func));
-   }
-   if (mUsingSmoke && mUsingNoise) {
-     mDensityHigh = (float *)pyObjectToPointer(callPythonFunction("density" + 
noise_ext, func));
-     mTextureU = (float *)pyObjectToPointer(callPythonFunction("texture_u" + 
solver_ext, func));
-     mTextureV = (float *)pyObjectToPointer(callPythonFunction("texture_v" + 
solver_ext, func));
-     mTextureW = (float *)pyObjectToPointer(callPythonFunction("texture_w" + 
solver_ext, func));
-     mTextureU2 = (float *)pyObjectToPointer(callPythonFunction("texture_u2" + 
solver_ext, func));
-     mTextureV2 = (float *)pyObjectToPointer(callPythonFunction("texture_v2" + 
solver_ext, func));
-     mTextureW2 = (float *)pyObjectToPointer(callPythonFunction("texture_w2" + 
solver_ext, func));
-   }
-   if (mUsingSmoke && mUsingNoise && mUsingFire) {
-     mFlameHigh = (float *)pyObjectToPointer(callPythonFunction("flame" + 
noise_ext, func));
-     mFuelHigh = (float *)pyObjectToPointer(callPythonFunction("fuel" + 
noise_ext, func));
-     mReactHigh = (float *)pyObjectToPointer(callPythonFunction("react" + 
noise_ext, func));
-   }
-   if (mUsingSmoke && mUsingNoise && mUsingColors) {
-     mColorRHigh = (float *)pyObjectToPointer(callPythonFunction("color_r" + 
noise_ext, func));
-     mColorGHigh = (float *)pyObjectToPointer(callPythonFunction("color_g" + 
noise_ext, func));
-     mColorBHigh = (float *)pyObjectToPointer(callPythonFunction("color_b" + 
noise_ext, func));
-   }
-   if (mUsingLiquid) {
-     mPhi = (float *)pyObjectToPointer(callPythonFunction("phi" + solver_ext, 
func));
-     mFlipParticleData = (vector<pData> *)pyObjectToPointer(
-         callPythonFunction("pp" + solver_ext, func));
-     mFlipParticleVelocity = (vector<pVel> *)pyObjectToPointer(
-         callPythonFunction("pVel" + parts_ext, func));
-   }
-   if (mUsingLiquid && mUsingMesh) {
-     mMeshNodes = (vector<Node> *)pyObjectToPointer(
-         callPythonFunction("mesh" + mesh_ext, funcNodes));
-     mMeshTriangles = (vector<Triangle> *)pyObjectToPointer(
-         callPythonFunction("mesh" + mesh_ext, funcTris));
-   }
-   if (mUsingLiquid && mUsingMVel) {
-     mMeshVelocities = (vector<pVel> *)pyObjectToPointer(
-         callPythonFunction("mVel" + mesh_ext2, func));
-   }
-   if (mUsingLiquid && (mUsingDrops | mUsingBubbles | mUsingFloats | 
mUsingTracers)) {
-     mSndParticleData = (vector<pData> *)pyObjectToPointer(
-         callPythonFunction("ppSnd" + snd_ext, func));
-     mSndParticleVelocity = (vector<pVel> *)pyObjectToPointer(
-         callPythonFunction("pVelSnd" + parts_ext, func));
-     mSndParticleLife = (vector<float> *)pyObjectToPointer(
-         callPythonFunction("pLifeSnd" + parts_ext, func));
-   }
+   string s_ext = "_s" + id;
+   string pp_ext = "_pp" + id;
+   string snd_ext = "_sp" + id;
+   string sm_ext = "_sm" + id;
+   string mesh_ext = "_mesh" + id;
+   string sn_ext = "_sn" + id;
+ 
+   mFlags = getPointer<int>("flags" + s_ext, func);
+   mPhiIn = getPointer<float>("phiIn" + s_ext, func);
+   mPhiStaticIn = getPointer<float>("phiSIn" + s_ext, func);
+   mVelocityX = getPointer<float>("x_vel" + s_ext, func);
+   mVelocityY = getPointer<float>("y_vel" + s_ext, func);
+   mVelocityZ = getPointer<float>("z_vel" + s_ext, func);
+   mForceX = getPointer<float>("x_force" + s_ext, func);
+   mForceY = getPointer<float>("y_force" + s_ext, func);
+   mForceZ = getPointer<float>("z_force" + s_ext, func);
++  mPressure = getPointer<float>("pressure" + s_ext, func);
+ 
+   /* Outflow. */
+   mPhiOutIn = (outflow) ? getPointer<float>("phiOutIn" + s_ext, func) : 
nullptr;
+   mPhiOutStaticIn = (outflow) ? getPointer<float>("phiOutSIn" + s_ext, func) 
: nullptr;
+ 
+   /* Obstacles. */
+   mPhiObsIn = (obstacle) ? getPointer<float>("phiObsIn" + s_ext, func) : 
nullptr;
+   mPhiObsStaticIn = (obstacle) ? getPointer<float>("phiObsSIn" + s_ext, func) 
: nullptr;
+   mObVelocityX = (obstacle) ? getPointer<float>("x_obvel" + s_ext, func) : 
nullptr;
+   mObVelocityY = (obstacle) ? getPointer<float>("y_obvel" + s_ext, func) : 
nullptr;
+   mObVelocityZ = (obstacle) ? getPointer<float>("z_obvel" + s_ext, func) : 
nullptr;
+   mNumObstacle = (obstacle) ? getPointer<float>("numObs" + s_ext, func) : 
nullptr;
+ 
+   /* Guiding. */
+   mPhiGuideIn = (guiding) ? getPointer<float>("phiGuideIn" + s_ext, func) : 
nullptr;
+   mGuideVelocityX = (guiding) ? getPointer<float>("x_guidevel" + s_ext, func) 
: nullptr;
+   mGuideVelocityY = (guiding) ? getPointer<float>("y_guidevel" + s_ext, func) 
: nullptr;
+   mGuideVelocityZ = (guiding) ? getPointer<float>("z_guidevel" + s_ext, func) 
: nullptr;
+   mNumGuide = (guiding) ? getPointer<float>("numGuides" + s_ext, func) : 
nullptr;
+ 
+   /* Initial velocities. */
+   mInVelocity

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to