[Bf-blender-cvs] [30b17e30f8f] master: Fluid: Cleanup for APIC debug build setup

Sebastián Barschkis noreply at git.blender.org
Fri Oct 30 11:15:31 CET 2020


Commit: 30b17e30f8f27c709efc0cefe99e0fcb9166d5dc
Author: Sebastián Barschkis
Date:   Fri Oct 30 11:14:11 2020 +0100
Branches: master
https://developer.blender.org/rB30b17e30f8f27c709efc0cefe99e0fcb9166d5dc

Fluid: Cleanup for APIC debug build setup

Fixes build issue

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

M	extern/mantaflow/preprocessed/plugin/apic.cpp

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

diff --git a/extern/mantaflow/preprocessed/plugin/apic.cpp b/extern/mantaflow/preprocessed/plugin/apic.cpp
index 100b26a4091..460c6459916 100644
--- a/extern/mantaflow/preprocessed/plugin/apic.cpp
+++ b/extern/mantaflow/preprocessed/plugin/apic.cpp
@@ -30,9 +30,7 @@ static inline IndexInt indexUFace(const Vec3 &pos, const MACGrid &ref)
 {
   const Vec3i f = toVec3i(pos), c = toVec3i(pos - 0.5);
   const IndexInt index = f.x * ref.getStrideX() + c.y * ref.getStrideY() + c.z * ref.getStrideZ();
-  assertDeb(ref.isInBounds(index),
-            "Grid index out of bounds for particle position [" << pos.x << ", " << pos.y << ", "
-                                                               << pos.z << "]");
+  assertDeb(ref.isInBounds(index), "Grid index out of bounds");
   return (ref.isInBounds(index)) ? index : -1;
 }
 
@@ -40,9 +38,7 @@ static inline IndexInt indexVFace(const Vec3 &pos, const MACGrid &ref)
 {
   const Vec3i f = toVec3i(pos), c = toVec3i(pos - 0.5);
   const IndexInt index = c.x * ref.getStrideX() + f.y * ref.getStrideY() + c.z * ref.getStrideZ();
-  assertDeb(ref.isInBounds(index),
-            "Grid index out of bounds for particle position [" << pos.x << ", " << pos.y << ", "
-                                                               << pos.z << "]");
+  assertDeb(ref.isInBounds(index), "Grid index out of bounds");
   return (ref.isInBounds(index)) ? index : -1;
 }
 
@@ -50,9 +46,7 @@ static inline IndexInt indexWFace(const Vec3 &pos, const MACGrid &ref)
 {
   const Vec3i f = toVec3i(pos), c = toVec3i(pos - 0.5);
   const IndexInt index = c.x * ref.getStrideX() + c.y * ref.getStrideY() + f.z * ref.getStrideZ();
-  assertDeb(ref.isInBounds(index),
-            "Grid index out of bounds for particle position [" << pos.x << ", " << pos.y << ", "
-                                                               << pos.z << "]");
+  assertDeb(ref.isInBounds(index), "Grid index out of bounds");
   return (ref.isInBounds(index)) ? index : -1;
 }
 
@@ -63,9 +57,7 @@ static inline IndexInt indexOffset(
   const IndexInt dY[2] = {0, ref.getStrideY()};
   const IndexInt dZ[2] = {0, ref.getStrideZ()};
   const IndexInt index = gidx + dX[i] + dY[j] + dZ[k];
-  assertDeb(ref.isInBounds(index),
-            "Grid index out of bounds for particle position [" << pos.x << ", " << pos.y << ", "
-                                                               << pos.z << "]");
+  assertDeb(ref.isInBounds(index), "Grid index out of bounds");
   return (ref.isInBounds(index)) ? index : -1;
 }
 
@@ -125,7 +117,7 @@ struct knApicMapLinearVec3ToMACGrid : public KernelBase {
     {  // u-face
       const IndexInt gidx = indexUFace(pos, vg);
       if (gidx < 0)
-        return;  // debug will fail
+        return;  // debug will fail before
 
       const Vec3 gpos(f.x, c.y + 0.5, c.z + 0.5);
       const Real wi[2] = {Real(1) - wf.x, wf.x};
@@ -137,7 +129,7 @@ struct knApicMapLinearVec3ToMACGrid : public KernelBase {
         const Real w = wi[i] * wj[j] * wk[k];
         const IndexInt vidx = indexOffset(gidx, i, j, k, vg);
         if (vidx < 0)
-          continue;  // debug will fail
+          continue;  // debug will fail before
 
         mg[vidx].x += w;
         vg[vidx].x += w * vel.x;
@@ -395,7 +387,7 @@ struct knApicMapLinearMACGridToVec3 : public KernelBase {
     {  // u-face
       const IndexInt gidx = indexUFace(pos, vg);
       if (gidx < 0)
-        return;  // debug will fail
+        return;  // debug will fail before
 
       const Real wx[2] = {Real(1) - wf.x, wf.x};
       const Real wy[2] = {Real(1) - wc.y, wc.y};
@@ -405,7 +397,7 @@ struct knApicMapLinearMACGridToVec3 : public KernelBase {
       {
         const IndexInt vidx = indexOffset(gidx, i, j, k, vg);
         if (vidx < 0)
-          continue;  // debug will fail
+          continue;  // debug will fail before
 
         const Real vgx = vg[vidx].x;
         vp[idx].x += wx[i] * wy[j] * wz[k] * vgx;



More information about the Bf-blender-cvs mailing list