[Bf-blender-cvs] [3ee4f50995e] fluid-mantaflow: update for smoke domain boundaries

Sebastián Barschkis noreply at git.blender.org
Tue Jul 11 19:15:38 CEST 2017


Commit: 3ee4f50995e0750ce1305c8038229983c68b168b
Author: Sebastián Barschkis
Date:   Tue Jul 11 19:09:34 2017 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB3ee4f50995e0750ce1305c8038229983c68b168b

update for smoke domain boundaries

using phiout levelset for smoke outflow

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

M	intern/mantaflow/intern/FLUID.cpp
M	intern/mantaflow/intern/strings/smoke_script.h
M	source/blender/blenkernel/intern/smoke.c

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

diff --git a/intern/mantaflow/intern/FLUID.cpp b/intern/mantaflow/intern/FLUID.cpp
index 9ec24c42de8..86cac7b52d3 100644
--- a/intern/mantaflow/intern/FLUID.cpp
+++ b/intern/mantaflow/intern/FLUID.cpp
@@ -1086,11 +1086,11 @@ void FLUID::updatePointers()
 	mForceZ    = (float*) getDataPointer("z_force" + solver_ext, solver);
 	
 	mPhiObs = (float*) getDataPointer("phiObsIn" + solver_ext, solver);
-	
+	mPhiOut = (float*) getDataPointer("phiOutIn" + solver_ext, solver);
+
 	// Liquid
 	if (mUsingLiquid) {
 		mPhiIn  = (float*) getDataPointer("phiIn" + solver_ext,  solver);
-		mPhiOut = (float*) getDataPointer("phiOut" + solver_ext, solver);
 		mPhi    = (float*) getDataPointer("phi" + solver_ext, solver);
 
 		mFlipParticleData     = (std::vector<pData>*) getDataPointer("pp" + solver_ext, solver);
diff --git a/intern/mantaflow/intern/strings/smoke_script.h b/intern/mantaflow/intern/strings/smoke_script.h
index 3f8f52f63b5..906895746c0 100644
--- a/intern/mantaflow/intern/strings/smoke_script.h
+++ b/intern/mantaflow/intern/strings/smoke_script.h
@@ -105,7 +105,7 @@ z_invel_s$ID$     = s$ID$.create(RealGrid)\n\
 density_s$ID$     = s$ID$.create(RealGrid)\n\
 pressure_s$ID$    = s$ID$.create(RealGrid)\n\
 phiObsIn_s$ID$    = s$ID$.create(LevelsetGrid)\n\
-phiOut_s$ID$      = s$ID$.create(LevelsetGrid)\n\
+phiOutIn_s$ID$    = s$ID$.create(LevelsetGrid)\n\
 forces_s$ID$      = s$ID$.create(Vec3Grid)\n\
 x_force_s$ID$     = s$ID$.create(RealGrid)\n\
 y_force_s$ID$     = s$ID$.create(RealGrid)\n\
@@ -232,6 +232,10 @@ def manta_step_$ID$(framenr):\n\
         smoke_pre_step_high_$ID$()\n\
     \n\
     while s$ID$.frame == last_frame_s$ID$:\n\
+        \n\
+        setObstacleFlags(flags=flags_s$ID$, phiObs=phiObsIn_s$ID$, phiOut=phiOutIn_s$ID$)\n\
+        flags_s$ID$.fillGrid()\n\
+        \n\
         if using_adaptTime_s$ID$:\n\
             mantaMsg('Adapt timestep')\n\
             maxvel_s$ID$ = vel_s$ID$.getMaxValue()\n\
@@ -262,10 +266,6 @@ const std::string smoke_step_low = "\n\
 def step_low_$ID$():\n\
     mantaMsg('Smoke step low')\n\
     \n\
-    mantaMsg('Setting flags')\n\
-    setObstacleFlags(flags=flags_s$ID$, phiObs=phiObsIn_s$ID$, phiOut=phiOut_s$ID$)\n\
-    flags_s$ID$.fillGrid()\n\
-    \n\
     mantaMsg('Advecting density')\n\
     advectSemiLagrange(flags=flags_s$ID$, vel=vel_s$ID$, grid=density_s$ID$, order=$ADVECT_ORDER$)\n\
     \n\
@@ -418,7 +418,7 @@ def load_smoke_data_low_$ID$(path):\n\
     y_invel_s$ID$.load(path + '_y_invel.uni')\n\
     z_invel_s$ID$.load(path + '_z_invel.uni')\n\
     phiObsIn_s$ID$.load(path + '_phiObsIn.uni')\n\
-    phiOut_s$ID$.load(path + '_phiOut.uni')\n\
+    phiOutIn_s$ID$.load(path + '_phiOutIn.uni')\n\
     numObs_s$ID$.load(path + '_numObs.uni')\n\
     if using_colors_s$ID$:\n\
         color_r_s$ID$.load(path + '_color_r.uni')\n\
@@ -475,7 +475,7 @@ def save_smoke_data_low_$ID$(path):\n\
     y_invel_s$ID$.save(path + '_y_invel.uni')\n\
     z_invel_s$ID$.save(path + '_z_invel.uni')\n\
     phiObsIn_s$ID$.save(path + '_phiObsIn.uni')\n\
-    phiOut_s$ID$.save(path + '_phiOut.uni')\n\
+    phiOutIn_s$ID$.save(path + '_phiOutIn.uni')\n\
     numObs_s$ID$.save(path + '_numObs.uni')\n\
     if using_colors_s$ID$:\n\
         color_r_s$ID$.save(path + '_color_r.uni')\n\
@@ -561,7 +561,7 @@ if 'z_invel_s$ID$'     in globals() : del z_invel_s$ID$\n\
 if 'density_s$ID$'     in globals() : del density_s$ID$\n\
 if 'pressure_s$ID$'    in globals() : del pressure_s$ID$\n\
 if 'phiObsIn_s$ID$'    in globals() : del phiObsIn_s$ID$\n\
-if 'phiOut_s$ID$'      in globals() : del phiOut_s$ID$\n\
+if 'phiOutIn_s$ID$'    in globals() : del phiOutIn_s$ID$\n\
 if 'forces_s$ID$'      in globals() : del forces_s$ID$\n\
 if 'x_force_s$ID$'     in globals() : del x_force_s$ID$\n\
 if 'y_force_s$ID$'     in globals() : del y_force_s$ID$\n\
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 7931ea42207..51a565e002f 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -1801,10 +1801,8 @@ static void emit_from_derivedmesh_task_cb(void *userdata, const int z)
 							(float)lx, (float)ly, (float)lz);
 				}
 
-				/* Emission for liquid. Result in em->distances */
-				if (data->sfs->type == MOD_SMOKE_FLOW_TYPE_LIQUID) {
-					update_mesh_distances(index, em->distances, data->tree, ray_start);
-				}
+				/* Calculate levelset from meshes. Result in em->distances */
+				update_mesh_distances(index, em->distances, data->tree, ray_start);
 			}
 
 			/* take high res samples if required */




More information about the Bf-blender-cvs mailing list