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:
authorMiika Hamalainen <blender@miikah.org>2013-05-21 22:57:19 +0400
committerMiika Hamalainen <blender@miikah.org>2013-05-21 22:57:19 +0400
commitf276f7f2ef7202582d48851bd66846b6e6777e5b (patch)
tree21be5c4bc19cd0bbb8bf61e740d268aa9063092a /intern/smoke
parent07c31b8a86cfbf81e7f838c17d55c4b4d7e328a0 (diff)
Fix: Smoke simulator produced slightly different results on every run if openmp was enabled.
This was a typical threading issue. Move that particular function out of the parallel block.
Diffstat (limited to 'intern/smoke')
-rw-r--r--intern/smoke/intern/FLUID_3D.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/intern/smoke/intern/FLUID_3D.cpp b/intern/smoke/intern/FLUID_3D.cpp
index fb467f54ab0..85d6a7a16b5 100644
--- a/intern/smoke/intern/FLUID_3D.cpp
+++ b/intern/smoke/intern/FLUID_3D.cpp
@@ -365,6 +365,7 @@ void FLUID_3D::step(float dt, float gravity[3])
int zEnd=_zRes;
#endif
+ wipeBoundariesSL(0, _zRes);
#if PARALLEL==1
#pragma omp parallel
@@ -376,7 +377,6 @@ void FLUID_3D::step(float dt, float gravity[3])
int zEnd = (int)((float)(i+1)*partSize + 0.5f);
#endif
- wipeBoundariesSL(zBegin, zEnd);
addVorticity(zBegin, zEnd);
addBuoyancy(_heat, _density, gravity, zBegin, zEnd);
addForce(zBegin, zEnd);
@@ -879,7 +879,7 @@ void FLUID_3D::wipeBoundariesSL(int zBegin, int zEnd)
if (zEnd == _zRes)
{
index=0;
- int indexx=0;
+ int index_top=0;
const int cellsslab = totalCells - slabSize;
for (y = 0; y < _yRes; y++)
@@ -887,19 +887,19 @@ void FLUID_3D::wipeBoundariesSL(int zBegin, int zEnd)
{
// back slab
- indexx = index + cellsslab;
- _xVelocity[indexx] = 0.0f;
- _yVelocity[indexx] = 0.0f;
- _zVelocity[indexx] = 0.0f;
- _density[indexx] = 0.0f;
+ index_top = index + cellsslab;
+ _xVelocity[index_top] = 0.0f;
+ _yVelocity[index_top] = 0.0f;
+ _zVelocity[index_top] = 0.0f;
+ _density[index_top] = 0.0f;
if (_fuel) {
- _fuel[index] = 0.0f;
- _react[index] = 0.0f;
+ _fuel[index_top] = 0.0f;
+ _react[index_top] = 0.0f;
}
if (_color_r) {
- _color_r[index] = 0.0f;
- _color_g[index] = 0.0f;
- _color_b[index] = 0.0f;
+ _color_r[index_top] = 0.0f;
+ _color_g[index_top] = 0.0f;
+ _color_b[index_top] = 0.0f;
}
}
}