Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/smoke')
-rw-r--r--intern/smoke/intern/FLUID_3D.cpp3
-rw-r--r--intern/smoke/intern/FLUID_3D.h2
-rw-r--r--intern/smoke/intern/FLUID_3D_STATIC.cpp48
-rw-r--r--intern/smoke/intern/WTURBULENCE.cpp1
-rw-r--r--intern/smoke/intern/smoke_API.cpp3
-rw-r--r--intern/smoke/make/msvc_9_0/smoke.vcproj1
6 files changed, 28 insertions, 30 deletions
diff --git a/intern/smoke/intern/FLUID_3D.cpp b/intern/smoke/intern/FLUID_3D.cpp
index 7574a0ec16e..8a32eaa2e68 100644
--- a/intern/smoke/intern/FLUID_3D.cpp
+++ b/intern/smoke/intern/FLUID_3D.cpp
@@ -182,6 +182,9 @@ void FLUID_3D::initBlenderRNA(float *alpha, float *beta)
//////////////////////////////////////////////////////////////////////
void FLUID_3D::step()
{
+ // addSmokeTestCase(_density, _res);
+ // addSmokeTestCase(_heat, _res);
+
// wipe forces
for (int i = 0; i < _totalCells; i++)
{
diff --git a/intern/smoke/intern/FLUID_3D.h b/intern/smoke/intern/FLUID_3D.h
index 9d9e7318204..a7be7f58335 100644
--- a/intern/smoke/intern/FLUID_3D.h
+++ b/intern/smoke/intern/FLUID_3D.h
@@ -47,7 +47,7 @@ class FLUID_3D
void initVectorNoise(int amplify);
void addSmokeColumn();
- static void addSmokeTestCase(float* field, Vec3Int res, float value);
+ static void addSmokeTestCase(float* field, Vec3Int res);
void step();
void addObstacle(OBSTACLE* obstacle);
diff --git a/intern/smoke/intern/FLUID_3D_STATIC.cpp b/intern/smoke/intern/FLUID_3D_STATIC.cpp
index 4909c071c3d..0215dfc417f 100644
--- a/intern/smoke/intern/FLUID_3D_STATIC.cpp
+++ b/intern/smoke/intern/FLUID_3D_STATIC.cpp
@@ -44,8 +44,8 @@ void FLUID_3D::addSmokeColumn() {
// generic static version, so that it can be applied to the
// WTURBULENCE grid as well
//////////////////////////////////////////////////////////////////////
-/*
-void FLUID_3D::addSmokeTestCase(float* field, Vec3Int res, float value)
+
+void FLUID_3D::addSmokeTestCase(float* field, Vec3Int res)
{
const int slabSize = res[0]*res[1]; int maxRes = (int)MAX3V(res);
float dx = 1.0f / (float)maxRes;
@@ -54,25 +54,23 @@ void FLUID_3D::addSmokeTestCase(float* field, Vec3Int res, float value)
float yTotal = dx * res[1];
float zTotal = dx * res[2];
- float heighMin = 0.05;
- float heighMax = 0.10;
-
- for (int y = 0; y < res[1]; y++)
- for (int z = (int)(heighMin*res[2]); z <= (int)(heighMax * res[1]); z++)
- for (int x = 0; x < res[0]; x++)
- {
- float xLength = x * dx - xTotal * 0.4f;
- float yLength = y * dx - zTotal * 0.5f;
- float radius = sqrtf(xLength * xLength + yLength * yLength);
-
- if (radius < 0.075f * xTotal)
- {
- int index = x + y * res[0] + z * slabSize;
- field[index] = value;
- }
- }
+ float heighMin = 0.05;
+ float heighMax = 0.10;
+
+ for (int y = 0; y < res[2]; y++)
+ for (int z = (int)(heighMin*res[2]); z <= (int)(heighMax * res[2]); z++)
+ for (int x = 0; x < res[0]; x++) {
+ float xLength = x * dx - xTotal * 0.4f;
+ float yLength = y * dx - yTotal * 0.5f;
+ float radius = sqrtf(xLength * xLength + yLength * yLength);
+
+ if (radius < 0.075f * xTotal) {
+ int index = x + y * res[0] + z * slabSize;
+ field[index] = 1.0f;
+ }
+ }
}
-*/
+
//////////////////////////////////////////////////////////////////////
// set x direction to Neumann boundary conditions
@@ -98,7 +96,7 @@ void FLUID_3D::setNeumannX(float* field, Vec3Int res)
for (int z = 0; z < res[2]; z++)
{
// top slab
- int index = y * res[0] + z * slabSize;
+ index = y * res[0] + z * slabSize;
index += res[0] - 1;
if(field[index]<0.) field[index] = 0.;
index -= 1;
@@ -130,7 +128,7 @@ void FLUID_3D::setNeumannY(float* field, Vec3Int res)
for (int x = 0; x < res[0]; x++)
{
// top slab
- int index = x + z * slabSize;
+ index = x + z * slabSize;
index += slabSize - res[0];
if(field[index]<0.) field[index] = 0.;
index -= res[0];
@@ -164,7 +162,7 @@ void FLUID_3D::setNeumannZ(float* field, Vec3Int res)
for (int x = 0; x < res[0]; x++)
{
// top slab
- int index = x + y * res[0];
+ index = x + y * res[0];
index += totalCells - slabSize;
if(field[index]<0.) field[index] = 0.;
index -= slabSize;
@@ -295,12 +293,10 @@ void FLUID_3D::advectFieldSemiLagrange(const float dt, const float* velx, const
const int xres = res[0];
const int yres = res[1];
const int zres = res[2];
- static int hits = 0;
- static int total = 0;
const int slabSize = res[0] * res[1];
// scale dt up to grid resolution
-#if PARALLEL==1 && !_WIN32
+#if PARALLEL==1
#pragma omp parallel
#pragma omp for schedule(static)
#endif
diff --git a/intern/smoke/intern/WTURBULENCE.cpp b/intern/smoke/intern/WTURBULENCE.cpp
index a1b2aaf30f2..bcfc61856af 100644
--- a/intern/smoke/intern/WTURBULENCE.cpp
+++ b/intern/smoke/intern/WTURBULENCE.cpp
@@ -986,4 +986,3 @@ void WTURBULENCE::stepTurbulenceFull(float dtOrg, float* xvel, float* yvel, floa
_totalStepsBig++;
}
-
diff --git a/intern/smoke/intern/smoke_API.cpp b/intern/smoke/intern/smoke_API.cpp
index 058831dddbb..67df6e805d8 100644
--- a/intern/smoke/intern/smoke_API.cpp
+++ b/intern/smoke/intern/smoke_API.cpp
@@ -81,8 +81,7 @@ extern "C" void smoke_step(FLUID_3D *fluid, size_t framenr)
extern "C" void smoke_turbulence_step(WTURBULENCE *wt, FLUID_3D *fluid)
{
- if(wt)
- wt->stepTurbulenceFull(fluid->_dt/fluid->_dx, fluid->_xVelocity, fluid->_yVelocity, fluid->_zVelocity, fluid->_obstacles);
+ wt->stepTurbulenceFull(fluid->_dt/fluid->_dx, fluid->_xVelocity, fluid->_yVelocity, fluid->_zVelocity, fluid->_obstacles);
}
extern "C" void smoke_initBlenderRNA(FLUID_3D *fluid, float *alpha, float *beta)
diff --git a/intern/smoke/make/msvc_9_0/smoke.vcproj b/intern/smoke/make/msvc_9_0/smoke.vcproj
index aa3779031f0..38a761d5d82 100644
--- a/intern/smoke/make/msvc_9_0/smoke.vcproj
+++ b/intern/smoke/make/msvc_9_0/smoke.vcproj
@@ -42,6 +42,7 @@
/>
<Tool
Name="VCCLCompilerTool"
+ Optimization="2"
InlineFunctionExpansion="2"
AdditionalIncludeDirectories="..\..\intern;..\..\..\..\..\lib\windows\zlib\include;..\..\..\..\..\lib\windows\png\include;..\..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\..\build\msvc_9\intern\guardedalloc\include"
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"