[Bf-blender-cvs] [cd712d5] fluid-mantaflow: just removed some typos

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


Commit: cd712d50b7887edc7e814008ececccf4ca60d0ae
Author: Sebastián Barschkis
Date:   Thu Sep 3 23:21:42 2015 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rBcd712d50b7887edc7e814008ececccf4ca60d0ae

just removed some typos

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

M	.gitignore
M	intern/smoke/intern/FLUID_3D.cpp
M	intern/smoke/intern/MANTA.cpp
M	intern/smoke/intern/scenarios/smoke.h
M	intern/smoke/intern/smoke_API.cpp
A	source/blender/python/manta_full/resources/help.png
A	source/blender/python/manta_full/resources/keyboard.png
A	source/blender/python/manta_full/scenes/filaments.py
A	source/blender/python/manta_full/scenes/flip01_simple.py
A	source/blender/python/manta_full/scenes/flip02_surface.py
A	source/blender/python/manta_full/scenes/flip03_gen.py
A	source/blender/python/manta_full/scenes/flip04_adaptDt.py
A	source/blender/python/manta_full/scenes/flip05_narrow.py
A	source/blender/python/manta_full/scenes/flip06_secOrderBnd.py
A	source/blender/python/manta_full/scenes/freesurface.py
A	source/blender/python/manta_full/scenes/karman.py
A	source/blender/python/manta_full/scenes/plume_2d.py
A	source/blender/python/manta_full/scenes/plume_adaptDt.py
A	source/blender/python/manta_full/scenes/turbulence.py
A	source/blender/python/manta_full/scenes/vortexsheets.py
A	source/blender/python/manta_full/scenes/waveEquation.py
A	source/blender/python/manta_full/scenes/waveletTurbulence.py
A	source/blender/python/manta_full/scenes/waveletTurbulenceObs.py
A	source/blender/python/manta_full/source/plugin/flip.cpp
A	source/blender/python/manta_full/source/plugin/waves.cpp
A	source/blender/python/manta_full/source/timing.cpp
A	source/blender/python/manta_full/source/timing.h
A	source/blender/python/manta_full/source/util/simpleimage.cpp
A	source/blender/python/manta_full/source/util/simpleimage.h
A	source/blender/python/manta_full/tools/makeHgVersion.py
A	source/blender/python/manta_full/tools/maya/AEbobjFluidObjectTemplate.mel
A	source/blender/python/manta_full/tools/maya/AEfluidGridObjectTemplate.mel
A	source/blender/python/manta_full/tools/maya/Makefile
A	source/blender/python/manta_full/tools/maya/README.txt
A	source/blender/python/manta_full/tools/maya/bobjFluidObject.cpp
A	source/blender/python/manta_full/tools/maya/bobjloader.mll
A	source/blender/python/manta_full/tools/maya/bobjloader.vcxproj
A	source/blender/python/manta_full/tools/maya/buildconfig.linux
A	source/blender/python/manta_full/tools/maya/buildconfig.osx
A	source/blender/python/manta_full/tools/maya/createBobjLoader.mel
A	source/blender/python/manta_full/tools/maya/createDensityLoader.mel
A	source/blender/python/manta_full/tools/maya/densityloader.cpp
A	source/blender/python/manta_full/tools/maya/densityloader.mll
A	source/blender/python/manta_full/tools/maya/densityloader.vcxproj
A	source/blender/python/manta_full/tools/maya/mayaplugins.sln
A	source/blender/python/manta_full/tools/testdata/readme.txt
A	source/blender/python/manta_full/tools/tests/helperGeneric.py
A	source/blender/python/manta_full/tools/tests/helperInclude.py
A	source/blender/python/manta_full/tools/tests/reader.py
A	source/blender/python/manta_full/tools/tests/runTests.py
A	source/blender/python/manta_full/tools/tests/test_0010_io.py
A	source/blender/python/manta_full/tools/tests/test_0011_inverted.py
A	source/blender/python/manta_full/tools/tests/test_0020_shapes.py
A	source/blender/python/manta_full/tools/tests/test_0030_gridop.py
A	source/blender/python/manta_full/tools/tests/test_0031_pdataop.py
A	source/blender/python/manta_full/tools/tests/test_0040_interpol2d.py
A	source/blender/python/manta_full/tools/tests/test_0041_interpol3d.py
A	source/blender/python/manta_full/tools/tests/test_0050_meshload.obj
A	source/blender/python/manta_full/tools/tests/test_0050_meshload.py
A	source/blender/python/manta_full/tools/tests/test_0100_psolve.py
A	source/blender/python/manta_full/tools/tests/test_1010_plume2d.py
A	source/blender/python/manta_full/tools/tests/test_1020_uvs.py
A	source/blender/python/manta_full/tools/tests/test_1030_waveeq.py
A	source/blender/python/manta_full/tools/tests/test_1070_flip2d.py
A	source/blender/python/manta_full/tools/tests/test_1075_secorderBndFlip.py
A	source/blender/python/manta_full/tools/tests/test_2005_symmAdv.py
A	source/blender/python/manta_full/tools/tests/test_2010_plume3d.py
A	source/blender/python/manta_full/tools/tests/test_2011_plume3d_open.py
A	source/blender/python/manta_full/tools/tests/test_2020_obstacle.py
A	source/blender/python/manta_full/tools/tests/test_2025_turb.py
A	source/blender/python/manta_full/tools/tests/test_2045_fallingDrop.py
A	source/blender/python/manta_full/tools/tests/test_2050_freesurface.py
A	source/blender/python/manta_full/tools/tests/test_2065_partIo.py
A	source/blender/python/manta_full/tools/tests/test_2070_falldropFlip.py
A	source/blender/python/manta_full/tools/tests/test_2075_flipBrdam.py

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

diff --git a/.gitignore b/.gitignore
index 78ac65a..6973b0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,9 @@ Thumbs.db
 ehthumbs.db
 Desktop.ini
 
+# mac-osx
+.DS_Store
+
 # commonly used paths in blender
 /blender.bin
 /user-config.py
@@ -31,9 +34,3 @@ Desktop.ini
 /doc/python_api/sphinx-in-tmp/
 /doc/python_api/sphinx-in/
 /doc/python_api/sphinx-out/.gitignore
-Roman_Pogribnyi/
-Roman_Pogribnyi.tar.gz
-Archive.zip
-Roman_Pogribnyi 2/
-make_diffs.txt
-series
\ No newline at end of file
diff --git a/intern/smoke/intern/FLUID_3D.cpp b/intern/smoke/intern/FLUID_3D.cpp
index a55ab87..871efea 100644
--- a/intern/smoke/intern/FLUID_3D.cpp
+++ b/intern/smoke/intern/FLUID_3D.cpp
@@ -505,7 +505,7 @@ _xRes(res[0]), _yRes(res[1]), _zRes(res[2]), _res(0.0f)
 	_xForce       = new float[_totalCells];
 	_yForce       = new float[_totalCells];
 	_zForce       = new float[_totalCells];
-	/*if two-dimentional, insert manta sim into blender _density field */
+	/*if two-dimensional, insert manta sim into blender _density field */
 	if (smd->domain->manta_solver_res == 2){
 		_density  = new float[_totalCells];
 		_manta_flags = new int[_totalCells];
diff --git a/intern/smoke/intern/MANTA.cpp b/intern/smoke/intern/MANTA.cpp
index 20464d4..0f0f4c5 100644
--- a/intern/smoke/intern/MANTA.cpp
+++ b/intern/smoke/intern/MANTA.cpp
@@ -282,23 +282,35 @@ string Manta_API::gridNameFromType(const string &type)
 void Manta_API::addGrid(void * data, string name, string type, int x, int y, int z, bool is2D = false)
 {
 	if (data == NULL || name == "" || gridNameFromType(type) == "") return;
-	cout << "Adding Grid:" << name<<endl; 
+	cout << "Adding Grid:" << name << endl;
 	std::ostringstream stringStream;
+	
+	/* Temporary gridname */
 	stringStream << "temp_" << name;
 	std::string grid_name = stringStream.str();
+	
+	/* Generate command that sets up grid variable */
 	stringStream.str("");
 	stringStream << grid_name << " = s.create(" << gridNameFromType(type) << ")";
 	const std::string command_1 = stringStream.str();
+
+	/* Generate command that makes the grid read in the data */
 	stringStream.str("");
-	if (is2D){
-		/*for 2D case, Y and Z axes are switched, Y axis is '1' for Mantaflow*/
+	if (is2D)
+	{
+		/* For 2D case, Y and Z axes are switched, Y axis is '1' for Mantaflow */
 		stringStream << grid_name << ".readGridFromMemory(\'"<< data << "\', " << x << "," << z << "," << 1 << ")";
 	}
-	else{
+	else
+	{
 		stringStream << grid_name << ".readGridFromMemory(\'"<< data << "\', " << x << "," << y << "," << z << ")";
 	}
 	const std::string command_2 = stringStream.str();
+	
+	/* Generate command that temp grid to our 'real' grid */
 	const std::string command_3 = name + ".add(" + grid_name + ")";
+	
+	/* Execute all commands */
 	PyGILState_STATE gilstate = PyGILState_Ensure();
 	PyRun_SimpleString(command_1.c_str());
 	PyRun_SimpleString(command_2.c_str());
@@ -619,13 +631,13 @@ void Manta_API::updatePointers(FLUID_3D *fluid, bool updateColor)
 			{
 				step = fluid->xRes() + cnty * fluid->xRes() + cntz * fluid->xRes()*fluid->yRes(); 
 				if ((step < 0) || (step > fluid->_totalCells)){
-					cout << "UpdatePointers: step is larger tahn cell dim" << step << endl;
+					cout << "UpdatePointers: step is larger than cell dim" << step << endl;
 				}
 				fluid->_density[step] = manta_fluid_density[cnty + cntz*fluid->xRes()];
 				fluid->_manta_flags[step] = manta_fluid_flags[cnty + cntz*fluid->xRes()];
 			}		
 	}
-	else{
+	else {
 		cout << '3D'<<endl;
 		fluid->_density = (float* )pointerFromString(getGridPointer("density", "s"));	
 		fluid->_manta_flags = (int* )pointerFromString(getGridPointer("flags", "s"));
diff --git a/intern/smoke/intern/scenarios/smoke.h b/intern/smoke/intern/scenarios/smoke.h
index 7678c7e..9b15b17 100644
--- a/intern/smoke/intern/scenarios/smoke.h
+++ b/intern/smoke/intern/scenarios/smoke.h
@@ -4,6 +4,7 @@ const string smoke_clean = "";
 
 const string smoke_setup_low ="from manta import *\n\
 import os, shutil, math, sys\n\
+\n\
 def transform_back(obj, gs):\n\
   obj.scale(gs/2)\n\
   obj.offset(gs/2)\n\
@@ -13,6 +14,7 @@ def load_once(grid, file, dict):\n\
     print('Loading file' + file + 'in grid')\n\
     grid.load(file)\n\
     dict[grid] = 1\n\
+\n\
 # solver params\n\
 res = $RES$\n\
 solver_dim = $SOLVER_DIM$\n\
@@ -83,7 +85,7 @@ if $USE_WAVELETS$ and $UPRES$ > 0:\n\
   xl_wltnoise.timeAnim = 0.1 \n\
 ";
 
-const string smoke_init_colors_low = "print(\"INitializing Colors\")\n\
+const string smoke_init_colors_low = "print(\"Initializing Colors\")\n\
 color_r_low = s.create(RealGrid)\n\
 color_g_low = s.create(RealGrid)\n\
 color_b_low = s.create(RealGrid)\n\
@@ -103,7 +105,7 @@ del color_g_low \n\
 del color_b_low \n\
 manta_using_colors = False";
 
-const string smoke_init_colors_high = "print(\"INitializing Colors highres\")\n\
+const string smoke_init_colors_high = "print(\"Initializing Colors highres\")\n\
 color_r_high = xl.create(RealGrid)\n\
 color_g_high = xl.create(RealGrid)\n\
 color_b_high = xl.create(RealGrid)\n\
@@ -117,7 +119,7 @@ color_b_high.add(xl_density) \n\
 color_b_high.multConst(manta_color_b) \n\
 manta_using_colors = True\n";
 
-const string smoke_init_heat_low = "print(\"INitializing heat lowres\")\n\
+const string smoke_init_heat_low = "print(\"Initializing heat lowres\")\n\
 heat_low = s.create(RealGrid)\n\
 manta_using_heat = True\n";
 
@@ -190,7 +192,7 @@ const string smoke_step_low = "def sim_step_low(t, standalone = False):\n\
   s.step()\n";
 
 const string liquid_step_low = "def sim_step_low(t):\n\
-#update flags form density on first step\n\
+#update flags from density on first step\n\
   setWallBcs(flags=flags, vel=vel)\n\
   density.multConst(-1.)\n\
   print (manta_using_colors)\n\
diff --git a/intern/smoke/intern/smoke_API.cpp b/intern/smoke/intern/smoke_API.cpp
index 462af5b..f4da1cd 100644
--- a/intern/smoke/intern/smoke_API.cpp
+++ b/intern/smoke/intern/smoke_API.cpp
@@ -45,14 +45,14 @@ extern "C" int *smoke_get_manta_flags(struct FLUID_3D *fluid){
 
 extern "C" FLUID_3D *smoke_init(int *res, float dx, float dtdef, int use_heat, int use_fire, int use_colors, struct SmokeModifierData *smd )
 {
-	FLUID_3D *fluid = new FLUID_3D(res, dx, dtdef, use_heat, use_fire, use_colors,smd);
+	FLUID_3D *fluid = new FLUID_3D(res, dx, dtdef, use_heat, use_fire, use_colors, smd);
 	return fluid;
 }
 
 extern "C" WTURBULENCE *smoke_turbulence_init(int *res, int amplify, int noisetype, const char *noisefile_path, int use_fire, int use_colors,struct SmokeDomainSettings *sds)
 {
 	if (amplify)
-		return new WTURBULENCE(res[0],res[1],res[2], amplify, noisetype, noisefile_path, use_fire, use_colors,sds);
+		return new WTURBULENCE(res[0],res[1],res[2], amplify, noisetype, noisefile_path, use_fire, use_colors, sds);
 	else 
 		return NULL;
 }
diff --git a/source/blender/python/manta_full/resources/help.png b/source/blender/python/manta_full/resources/help.png
new file mode 100644
index 0000000..bb9f060
Binary files /dev/null and b/source/blender/python/manta_full/resources/help.png differ
diff --git a/source/blender/python/manta_full/resources/keyboard.png b/source/blender/python/manta_full/resources/keyboard.png
new file mode 100644
index 0000000..58eef9a
Binary files /dev/null and b/source/blender/python/manta_full/resources/keyboard.png differ
diff --git a/source/blender/python/manta_full/scenes/filaments.py b/source/blender/python/manta_full/scenes/filaments.py
new file mode 100644
index 0000000..32253f4
--- /dev/null
+++ b/source/blender/python/manta_full/scenes/filaments.py
@@ -0,0 +1,81 @@
+#
+# Filament test
+# don't use yet --- work in progress
+
+assert(FILAMENT_SUPPORT)
+
+from manta import *
+from math import *
+import random
+
+# solver params
+res = 64
+gs = vec3(res,res,res)
+s = Solver(name='main', gridSize = gs)
+s.timestep = 0.1
+
+# prepare grids and particles
+flags = s.create(FlagGrid)
+vel = s.create(MACGrid)
+pressure = s.create(RealGrid)
+mesh = s.create(Mesh)
+filaments = s.create(VortexFilamentSystem)
+tracer = s.create(TracerParticleSystem)
+
+# scene setup
+flags.initDomain(boundaryWidth=1)
+flags.fillGrid()
+
+#filaments.addRing(position=gs*vec3(0.5,0.1,0.5), circulation=10, radius=0.2*res, normal=(0,1,0), number=40)
+#filaments.addRing(position=gs*vec3(0.5,0.14,0.5), circulation=10, radius=0.2*res, normal=(0,1,0), number=1000)
+#filaments.remesh(maxLen=3, minLen=1)
+	
+#filaments.setPos(10,filaments.getPos(10)+vec3(0,1.5,0))
+source = s.create(Cylinder, center=gs*vec3(0.5,0.09,0.5), radius=res*0.17, z=gs*vec3(0, 0.03, 0))
+fixedRegion = s.create(Box, center=gs*vec3(0.5,0.07,0.5), size=gs*vec3(0.4,0.03,0.4))
+mesh.fromShape(source)
+
+if (GUI):
+	gui = Gui()
+	gui.show()
+	gui.pause()
+
+r = 0.2
+scale = 1
+	
+#main loop
+for t in range(1000):
+	markAsFixed(mesh=mesh, shape=fixedRegion)
+
+	# seed rings
+	if random.random()<0.05:
+		theta = random.gauss(0,0.01*pi)
+		phi = random.gauss(0,0.01*pi)
+		n = vec3(sin(theta)*cos(phi), cos(theta), sin(theta)*sin(phi))
+		filaments.addRing(position=gs*vec3(0.5,0.14,0.5), circulation=random.uniform(10,20), radius=res*random.gauss(r,0.01), normal=n, number=20)
+	
+	# seed tracer particles
+	#for i in range(10):
+	#    x=100
+	#    z=100
+	#    while x*x+z*z > r*r :
+	#        x=random.uniform(-r,r)
+	#        y=random.uniform(0,0.1)
+	#        z=random.uniform(-r,r)
+	#    tracer.addParticle(vec3(x+0.5,y+0.1,z+0.5)*gs)
+	
+	# mesh cosmetics
+	smoothMesh(mesh=mesh, strength=1e-4, steps=1)
+	subdivideMesh(mesh=mesh, minAngle=0.01, minLength=scale, maxLength=2*scale, cutTubes=True)
+	killSmallComponents(mesh=mesh, elements=20)
+		
+	filaments.remesh(maxLen=4, minLen=3)
+	#gui.pause()
+	#filaments.ddTest(d=0.25,phi=0.1)
+	#filaments.doublyDiscreteUpdate(regularization=2)
+	filaments.advectSelf(scale=1, regularization=1, integrationMode=IntRK4)
+	#filaments.advectParticles(sys=tracer, scale=1, regularization=1, integrationMode=IntRK2)
+	filaments.advectMesh(mesh=mesh, scale=1, regularization=6, integrationMode=IntRK2)
+	
+	s.step()
+	
diff --git a/source/blender/python/manta_full/scenes/flip01_simple.py b/source/blender/python/manta_full/scenes/flip01_simple.py
new file mode 100644
index 0000000..8224e8b
--- /dev/null
+++ b/source/blender/pyt

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list