[Bf-blender-cvs] [6af37db] fluid-mantaflow: script changes

Sebastián Barschkis noreply at git.blender.org
Thu Jan 28 12:36:55 CET 2016


Commit: 6af37db96f61b6497a1fe1e1fbb3164c501674be
Author: Sebastián Barschkis
Date:   Tue Oct 6 00:53:27 2015 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB6af37db96f61b6497a1fe1e1fbb3164c501674be

script changes

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

M	intern/smoke/intern/MANTA.cpp
M	intern/smoke/intern/scenarios/smoke.h

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

diff --git a/intern/smoke/intern/MANTA.cpp b/intern/smoke/intern/MANTA.cpp
index 572d58d..c4b3742 100644
--- a/intern/smoke/intern/MANTA.cpp
+++ b/intern/smoke/intern/MANTA.cpp
@@ -396,7 +396,7 @@ void Manta_API::run_manta_sim_highRes(WTURBULENCE *wt)
 	updateHighResPointers(wt/*,false*/);
 }
 
-std::string get_manta_smoke_script(bool highRes, SmokeModifierData *smd)
+std::string Manta_API::get_manta_smoke_script(bool highRes, SmokeModifierData *smd)
 {
 	std::string smoke_script = "";
 	if (highRes) {
@@ -444,15 +444,12 @@ std::string Manta_API::getRealValue( const std::string& varName, SmokeModifierDa
 		ss <<  smd->domain->maxres;
 	else if (varName == "RESX")
 		ss <<  smd->domain->fluid->_xRes;
-	
 	else if (varName == "RESY")
 		if (is2D) {	ss <<  smd->domain->fluid->_zRes;}
-		else{ 		ss <<  smd->domain->fluid->_yRes;}
-	
+		else { 		ss <<  smd->domain->fluid->_yRes;}
 	else if (varName == "RESZ")
 		if (is2D){	ss << 1;}
 		else { 		ss << smd->domain->fluid->_zRes;}
-	
 	else if (varName == "SOLVER_DIM")
 		ss <<  smd->domain->manta_solver_res;
 	else if (varName == "NOISE_CN")
@@ -468,17 +465,17 @@ std::string Manta_API::getRealValue( const std::string& varName, SmokeModifierDa
 	else if (varName == "HRESX")
 		ss << smd->domain->wt->getResBig()[0];
 	else if (varName == "HRESY")
-		if (is2D){	ss << smd->domain->wt->getResBig()[2];}
+		if (is2D) {	ss << smd->domain->wt->getResBig()[2];}
 		else{ 		ss << smd->domain->wt->getResBig()[1];}
 	else if (varName == "HRESZ")
-		if (is2D){	ss << 1;}
+		if (is2D) {	ss << 1;}
 		else { 		ss << smd->domain->wt->getResBig()[2];}
 	else if (varName == "TIMESTEP")
 		ss << smd->domain->time_scale * 0.1f;
 	else if (varName == "XL_TIMESTEP")
 		ss << smd->domain->time_scale * 0.1f;
 	else if (varName == "USE_WAVELETS")
-		ss << (smd->domain->flags & MOD_SMOKE_HIGHRES) ? "True" : "False";
+		ss << ((smd->domain->flags & MOD_SMOKE_HIGHRES) ? "True" : "False");
 	else if (varName == "BUYO_X")
 		ss << 0.;
 	else if (varName == "BUYO_Y")
@@ -511,7 +508,7 @@ std::string Manta_API::getRealValue( const std::string& varName, SmokeModifierDa
 	else if (varName == "GRAVITY")
 		ss << "vec3(0,0,-0.981)";
 	else if (varName == "ABS_FLOW")
-		ss << (smd->flow->flags & MOD_SMOKE_FLOW_ABSOLUTE)?"True":"False";
+		ss << ((smd->flow->flags & MOD_SMOKE_FLOW_ABSOLUTE)? "True" : "False");
 	else if (varName == "DENSITY_MEM")
 		ss << smd->domain->fluid->_density;
 	else if (varName == "DENSITY_SIZE")
diff --git a/intern/smoke/intern/scenarios/smoke.h b/intern/smoke/intern/scenarios/smoke.h
index 20d434a..86962f3 100644
--- a/intern/smoke/intern/scenarios/smoke.h
+++ b/intern/smoke/intern/scenarios/smoke.h
@@ -3,7 +3,6 @@ using namespace std;
 const string smoke_clean = "";
 
 const string smoke_setup_low ="from manta import *\n\
-print ('SMOKE SETUP LOW')\n\
 import os, shutil, math, sys\n\
 \n\
 def transform_back(obj, gs):\n\
@@ -55,7 +54,7 @@ dict_loaded = dict()\n\
 manta_using_colors = False\n\
 manta_using_heat = False\n\
 manta_using_fire = False\n\
-low_flags_updated = False\n\
+low_flags_updated = False\n\r\
 ";
 
 const string smoke_setup_high = "xl_gs = vec3($HRESX$, $HRESY$, $HRESZ$) \n\
@@ -190,7 +189,7 @@ if (GUI):\n\
   gui.pause()\n\
 \n\
 for step in range(100):\n\
-  sim_step_low(step, True)\n\
+  sim_step_low(step, True)\n\r\
 ";
 
 const string smoke_step_low = "def sim_step_low(t, standalone = False):\n\
@@ -199,6 +198,13 @@ const string smoke_step_low = "def sim_step_low(t, standalone = False):\n\
     density.load('$MANTA_EXPORT_PATH$density.uni')\n\
     flags.load('$MANTA_EXPORT_PATH$flags.uni')\n\
     forces.load('$MANTA_EXPORT_PATH$forces.uni')\n\
+    heat_low.load('$MANTA_EXPORT_PATH$heat.uni')\n\
+    color_r_low.load('$MANTA_EXPORT_PATH$color_r.uni')\n\
+    color_g_low.load('$MANTA_EXPORT_PATH$color_g.uni')\n\
+    color_b_low.load('$MANTA_EXPORT_PATH$color_b.uni')\n\
+    flame_low.load('$MANTA_EXPORT_PATH$flame.uni')\n\
+    fuel_low.load('$MANTA_EXPORT_PATH$fuel.uni')\n\
+    react_low.load('$MANTA_EXPORT_PATH$react.uni')\n\
   if standalone:\n\
     inflow_grid.load('$MANTA_EXPORT_PATH$inflow.uni')\n\
     inflow_grid.multConst(0.1)\n\
@@ -239,12 +245,11 @@ const string smoke_step_low = "def sim_step_low(t, standalone = False):\n\
   forces.clear()\n\
   \n\
   print ('Pressure')\n\
-  # TODO: where to put openBound? solvePressure(flags=flags, vel=vel, pressure=pressure, openBound=boundConditions)\n\
   solvePressure(flags=flags, vel=vel, pressure=pressure)\n\
   print ('Walls')\n\
   setWallBcs(flags=flags, vel=vel)\n\
   \n\
-  s.step()\n\
+  s.step()\n\r\
 ";
 
 const string liquid_step_low = "def sim_step_low(t):\n\
@@ -274,7 +279,7 @@ const string liquid_step_low = "def sim_step_low(t):\n\
   solvePressure(flags=flags, vel=vel, pressure=pressure, cgMaxIterFac=0.5, useResNorm=True) \n\
   setWallBcs(flags=flags, vel=vel)\n\
   s.step()\n\
-  density.multConst(-1.)\n\
+  density.multConst(-1.)\n\r\
 ";
 
 const string smoke_step_high = "def sim_step_high(t):\n\
@@ -296,7 +301,7 @@ const string smoke_step_high = "def sim_step_high(t):\n\
     if manta_using_fire: \n\
       advectSemiLagrange(flags=xl_flags, vel=xl_vel, grid=fuel_high, order=$ADVECT_ORDER$)\n\
       advectSemiLagrange(flags=xl_flags, vel=xl_vel, grid=react_high, order=$ADVECT_ORDER$)\n\
-  xl.step()\n\
+  xl.step()\n\r\
 ";
 
 const string full_smoke_setup = "from manta import * \n\




More information about the Bf-blender-cvs mailing list