[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23186] branches/itasc: svn merge -r 23064 :23182 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Benoit Bolsee
benoit.bolsee at online.be
Sun Sep 13 18:36:02 CEST 2009
Revision: 23186
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23186
Author: ben2610
Date: 2009-09-13 18:36:02 +0200 (Sun, 13 Sep 2009)
Log Message:
-----------
svn merge -r 23064:23182 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Modified Paths:
--------------
branches/itasc/intern/audaspace/intern/AUD_C-API.cpp
branches/itasc/intern/smoke/extern/smoke_API.h
branches/itasc/intern/smoke/intern/FLUID_3D.cpp
branches/itasc/intern/smoke/intern/FLUID_3D_STATIC.cpp
branches/itasc/intern/smoke/intern/WTURBULENCE.cpp
branches/itasc/intern/smoke/intern/WTURBULENCE.h
branches/itasc/intern/smoke/intern/smoke_API.cpp
branches/itasc/projectfiles_vc9/blender/editors/ED_editors.vcproj
branches/itasc/projectfiles_vc9/blender/gpu/BL_gpu.vcproj
branches/itasc/projectfiles_vc9/blender/loader/BLO_loader.vcproj
branches/itasc/projectfiles_vc9/blender/nodes/nodes.vcproj
branches/itasc/release/io/engine_render_pov.py
branches/itasc/release/io/export_ply.py
branches/itasc/release/io/netrender/client.py
branches/itasc/release/io/netrender/master.py
branches/itasc/release/io/netrender/model.py
branches/itasc/release/io/netrender/operators.py
branches/itasc/release/io/netrender/slave.py
branches/itasc/release/io/netrender/ui.py
branches/itasc/release/io/netrender/utils.py
branches/itasc/release/ui/buttons_data_armature.py
branches/itasc/release/ui/buttons_data_bone.py
branches/itasc/release/ui/buttons_data_curve.py
branches/itasc/release/ui/buttons_data_empty.py
branches/itasc/release/ui/buttons_data_modifier.py
branches/itasc/release/ui/buttons_data_text.py
branches/itasc/release/ui/buttons_object_constraint.py
branches/itasc/release/ui/buttons_particle.py
branches/itasc/release/ui/buttons_physics_smoke.py
branches/itasc/release/ui/space_image.py
branches/itasc/release/ui/space_info.py
branches/itasc/release/ui/space_view3d.py
branches/itasc/release/ui/space_view3d_toolbar.py
branches/itasc/source/Makefile
branches/itasc/source/blender/blenkernel/BKE_anim.h
branches/itasc/source/blender/blenkernel/BKE_animsys.h
branches/itasc/source/blender/blenkernel/BKE_cloth.h
branches/itasc/source/blender/blenkernel/BKE_curve.h
branches/itasc/source/blender/blenkernel/BKE_key.h
branches/itasc/source/blender/blenkernel/BKE_library.h
branches/itasc/source/blender/blenkernel/BKE_node.h
branches/itasc/source/blender/blenkernel/BKE_particle.h
branches/itasc/source/blender/blenkernel/BKE_pointcache.h
branches/itasc/source/blender/blenkernel/BKE_smoke.h
branches/itasc/source/blender/blenkernel/BKE_utildefines.h
branches/itasc/source/blender/blenkernel/intern/anim.c
branches/itasc/source/blender/blenkernel/intern/anim_sys.c
branches/itasc/source/blender/blenkernel/intern/armature.c
branches/itasc/source/blender/blenkernel/intern/cloth.c
branches/itasc/source/blender/blenkernel/intern/colortools.c
branches/itasc/source/blender/blenkernel/intern/constraint.c
branches/itasc/source/blender/blenkernel/intern/curve.c
branches/itasc/source/blender/blenkernel/intern/displist.c
branches/itasc/source/blender/blenkernel/intern/font.c
branches/itasc/source/blender/blenkernel/intern/implicit.c
branches/itasc/source/blender/blenkernel/intern/key.c
branches/itasc/source/blender/blenkernel/intern/lattice.c
branches/itasc/source/blender/blenkernel/intern/library.c
branches/itasc/source/blender/blenkernel/intern/material.c
branches/itasc/source/blender/blenkernel/intern/node.c
branches/itasc/source/blender/blenkernel/intern/object.c
branches/itasc/source/blender/blenkernel/intern/particle.c
branches/itasc/source/blender/blenkernel/intern/particle_system.c
branches/itasc/source/blender/blenkernel/intern/pointcache.c
branches/itasc/source/blender/blenkernel/intern/smoke.c
branches/itasc/source/blender/blenkernel/intern/softbody.c
branches/itasc/source/blender/blenkernel/intern/texture.c
branches/itasc/source/blender/blenlib/BLI_arithb.h
branches/itasc/source/blender/blenlib/BLI_fileops.h
branches/itasc/source/blender/blenlib/intern/BLI_mempool.c
branches/itasc/source/blender/blenlib/intern/arithb.c
branches/itasc/source/blender/blenlib/intern/fileops.c
branches/itasc/source/blender/blenlib/intern/util.c
branches/itasc/source/blender/blenloader/BLO_readfile.h
branches/itasc/source/blender/blenloader/intern/readfile.c
branches/itasc/source/blender/blenloader/intern/writefile.c
branches/itasc/source/blender/editors/animation/keyingsets.c
branches/itasc/source/blender/editors/armature/editarmature.c
branches/itasc/source/blender/editors/armature/editarmature_retarget.c
branches/itasc/source/blender/editors/armature/meshlaplacian.c
branches/itasc/source/blender/editors/armature/poselib.c
branches/itasc/source/blender/editors/armature/poseobject.c
branches/itasc/source/blender/editors/curve/curve_ops.c
branches/itasc/source/blender/editors/curve/editcurve.c
branches/itasc/source/blender/editors/curve/editfont.c
branches/itasc/source/blender/editors/gpencil/gpencil_buttons.c
branches/itasc/source/blender/editors/include/ED_armature.h
branches/itasc/source/blender/editors/include/ED_mball.h
branches/itasc/source/blender/editors/include/ED_mesh.h
branches/itasc/source/blender/editors/include/ED_object.h
branches/itasc/source/blender/editors/include/ED_screen_types.h
branches/itasc/source/blender/editors/include/UI_interface.h
branches/itasc/source/blender/editors/interface/interface_layout.c
branches/itasc/source/blender/editors/interface/interface_utils.c
branches/itasc/source/blender/editors/interface/interface_widgets.c
branches/itasc/source/blender/editors/object/object_edit.c
branches/itasc/source/blender/editors/object/object_intern.h
branches/itasc/source/blender/editors/object/object_modifier.c
branches/itasc/source/blender/editors/object/object_ops.c
branches/itasc/source/blender/editors/object/object_vgroup.c
branches/itasc/source/blender/editors/physics/ed_fluidsim.c
branches/itasc/source/blender/editors/physics/editparticle.c
branches/itasc/source/blender/editors/screen/area.c
branches/itasc/source/blender/editors/screen/screen_context.c
branches/itasc/source/blender/editors/screen/screen_ops.c
branches/itasc/source/blender/editors/screen/screendump.c
branches/itasc/source/blender/editors/sculpt_paint/paint_ops.c
branches/itasc/source/blender/editors/sculpt_paint/paint_utils.c
branches/itasc/source/blender/editors/sculpt_paint/paint_vertex.c
branches/itasc/source/blender/editors/sound/sound_ops.c
branches/itasc/source/blender/editors/space_buttons/buttons_ops.c
branches/itasc/source/blender/editors/space_buttons/space_buttons.c
branches/itasc/source/blender/editors/space_console/console_ops.c
branches/itasc/source/blender/editors/space_console/space_console.c
branches/itasc/source/blender/editors/space_file/file_ops.c
branches/itasc/source/blender/editors/space_file/file_panels.c
branches/itasc/source/blender/editors/space_file/filelist.c
branches/itasc/source/blender/editors/space_file/filelist.h
branches/itasc/source/blender/editors/space_file/filesel.c
branches/itasc/source/blender/editors/space_file/space_file.c
branches/itasc/source/blender/editors/space_graph/graph_draw.c
branches/itasc/source/blender/editors/space_graph/graph_select.c
branches/itasc/source/blender/editors/space_image/image_ops.c
branches/itasc/source/blender/editors/space_info/info_ops.c
branches/itasc/source/blender/editors/space_node/drawnode.c
branches/itasc/source/blender/editors/space_script/script_edit.c
branches/itasc/source/blender/editors/space_script/script_ops.c
branches/itasc/source/blender/editors/space_sequencer/sequencer_add.c
branches/itasc/source/blender/editors/space_sequencer/sequencer_buttons.c
branches/itasc/source/blender/editors/space_sequencer/sequencer_edit.c
branches/itasc/source/blender/editors/space_sequencer/sequencer_select.c
branches/itasc/source/blender/editors/space_text/space_text.c
branches/itasc/source/blender/editors/space_text/text_ops.c
branches/itasc/source/blender/editors/space_time/time_ops.c
branches/itasc/source/blender/editors/space_view3d/drawobject.c
branches/itasc/source/blender/editors/space_view3d/drawvolume.c
branches/itasc/source/blender/editors/space_view3d/view3d_buttons.c
branches/itasc/source/blender/editors/space_view3d/view3d_draw.c
branches/itasc/source/blender/editors/space_view3d/view3d_intern.h
branches/itasc/source/blender/editors/space_view3d/view3d_view.c
branches/itasc/source/blender/editors/transform/transform.c
branches/itasc/source/blender/editors/transform/transform_conversions.c
branches/itasc/source/blender/editors/transform/transform_ops.c
branches/itasc/source/blender/editors/util/undo.c
branches/itasc/source/blender/editors/uvedit/uvedit_ops.c
branches/itasc/source/blender/editors/uvedit/uvedit_unwrap_ops.c
branches/itasc/source/blender/gpu/CMakeLists.txt
branches/itasc/source/blender/gpu/GPU_draw.h
branches/itasc/source/blender/gpu/SConscript
branches/itasc/source/blender/gpu/intern/Makefile
branches/itasc/source/blender/gpu/intern/gpu_draw.c
branches/itasc/source/blender/gpu/intern/gpu_extensions.c
branches/itasc/source/blender/imbuf/intern/jp2.c
branches/itasc/source/blender/makesdna/DNA_cloth_types.h
branches/itasc/source/blender/makesdna/DNA_constraint_types.h
branches/itasc/source/blender/makesdna/DNA_curve_types.h
branches/itasc/source/blender/makesdna/DNA_material_types.h
branches/itasc/source/blender/makesdna/DNA_object_force.h
branches/itasc/source/blender/makesdna/DNA_object_types.h
branches/itasc/source/blender/makesdna/DNA_particle_types.h
branches/itasc/source/blender/makesdna/DNA_smoke_types.h
branches/itasc/source/blender/makesdna/DNA_space_types.h
branches/itasc/source/blender/makesdna/DNA_texture_types.h
branches/itasc/source/blender/makesrna/RNA_access.h
branches/itasc/source/blender/makesrna/RNA_define.h
branches/itasc/source/blender/makesrna/RNA_enum_types.h
branches/itasc/source/blender/makesrna/RNA_types.h
branches/itasc/source/blender/makesrna/intern/makesrna.c
branches/itasc/source/blender/makesrna/intern/rna_access.c
branches/itasc/source/blender/makesrna/intern/rna_armature.c
branches/itasc/source/blender/makesrna/intern/rna_cloth.c
branches/itasc/source/blender/makesrna/intern/rna_constraint.c
branches/itasc/source/blender/makesrna/intern/rna_curve.c
branches/itasc/source/blender/makesrna/intern/rna_define.c
branches/itasc/source/blender/makesrna/intern/rna_gpencil.c
branches/itasc/source/blender/makesrna/intern/rna_group.c
branches/itasc/source/blender/makesrna/intern/rna_internal_types.h
branches/itasc/source/blender/makesrna/intern/rna_material.c
branches/itasc/source/blender/makesrna/intern/rna_mesh.c
branches/itasc/source/blender/makesrna/intern/rna_modifier.c
branches/itasc/source/blender/makesrna/intern/rna_nodetree.c
branches/itasc/source/blender/makesrna/intern/rna_nodetree_types.h
branches/itasc/source/blender/makesrna/intern/rna_object.c
branches/itasc/source/blender/makesrna/intern/rna_particle.c
branches/itasc/source/blender/makesrna/intern/rna_pose.c
branches/itasc/source/blender/makesrna/intern/rna_render.c
branches/itasc/source/blender/makesrna/intern/rna_rna.c
branches/itasc/source/blender/makesrna/intern/rna_scene.c
branches/itasc/source/blender/makesrna/intern/rna_smoke.c
branches/itasc/source/blender/makesrna/intern/rna_texture.c
branches/itasc/source/blender/makesrna/intern/rna_ui_api.c
branches/itasc/source/blender/makesrna/intern/rna_wm.c
branches/itasc/source/blender/nodes/CMP_node.h
branches/itasc/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c
branches/itasc/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c
branches/itasc/source/blender/nodes/intern/CMP_nodes/CMP_diffMatte.c
branches/itasc/source/blender/nodes/intern/CMP_nodes/CMP_lummaMatte.c
branches/itasc/source/blender/nodes/intern/CMP_util.c
branches/itasc/source/blender/nodes/intern/CMP_util.h
branches/itasc/source/blender/python/generic/Geometry.c
branches/itasc/source/blender/python/generic/Mathutils.c
branches/itasc/source/blender/python/intern/bpy_array.c
branches/itasc/source/blender/python/intern/bpy_rna.c
branches/itasc/source/blender/render/intern/source/strand.c
branches/itasc/source/blender/render/intern/source/texture.c
branches/itasc/source/blender/windowmanager/WM_api.h
branches/itasc/source/blender/windowmanager/intern/wm_event_system.c
branches/itasc/source/blender/windowmanager/intern/wm_files.c
branches/itasc/source/blender/windowmanager/intern/wm_jobs.c
branches/itasc/source/blender/windowmanager/intern/wm_keymap.c
branches/itasc/source/blender/windowmanager/intern/wm_operators.c
branches/itasc/source/gameengine/Ketsji/KX_NearSensor.cpp
branches/itasc/source/gameengine/Ketsji/KX_NearSensor.h
branches/itasc/source/nan_link.mk
Added Paths:
-----------
branches/itasc/release/windows/inno/
branches/itasc/release/windows/inno/blender.iss
branches/itasc/release/windows/inno/copyright.txt
branches/itasc/release/windows/inno/header.bmp
branches/itasc/release/windows/inno/installer.bmp
branches/itasc/release/windows/inno/installer.ico
branches/itasc/source/blender/editors/metaball/mball_edit.c
branches/itasc/source/blender/editors/object/object_add.c
branches/itasc/source/blender/editors/object/object_constraint.c
branches/itasc/source/blender/editors/object/object_group.c
branches/itasc/source/blender/editors/object/object_hook.c
branches/itasc/source/blender/editors/object/object_lattice.c
branches/itasc/source/blender/editors/object/object_relations.c
branches/itasc/source/blender/editors/object/object_select.c
branches/itasc/source/blender/editors/object/object_shapekey.c
branches/itasc/source/blender/editors/object/object_transform.c
branches/itasc/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c
branches/itasc/source/blender/nodes/intern/CMP_nodes/CMP_distanceMatte.c
branches/itasc/source/blender/nodes/intern/CMP_nodes/CMP_levels.c
Removed Paths:
-------------
branches/itasc/release/windows/inno/blender.iss
branches/itasc/release/windows/inno/copyright.txt
branches/itasc/release/windows/inno/header.bmp
branches/itasc/release/windows/inno/installer.bmp
branches/itasc/release/windows/inno/installer.ico
branches/itasc/source/blender/editors/metaball/editmball.c
branches/itasc/source/blender/editors/object/editconstraint.c
branches/itasc/source/blender/editors/object/editgroup.c
branches/itasc/source/blender/editors/object/editkey.c
branches/itasc/source/blender/editors/object/editlattice.c
Modified: branches/itasc/intern/audaspace/intern/AUD_C-API.cpp
===================================================================
--- branches/itasc/intern/audaspace/intern/AUD_C-API.cpp 2009-09-13 16:24:06 UTC (rev 23185)
+++ branches/itasc/intern/audaspace/intern/AUD_C-API.cpp 2009-09-13 16:36:02 UTC (rev 23186)
@@ -67,7 +67,7 @@
#endif
static AUD_IDevice* AUD_device = NULL;
-static int AUD_available_devices[3];
+static int AUD_available_devices[4];
static AUD_I3DDevice* AUD_3ddevice = NULL;
int AUD_init(AUD_DeviceType device, AUD_Specs specs, int buffersize)
Modified: branches/itasc/intern/smoke/extern/smoke_API.h
===================================================================
--- branches/itasc/intern/smoke/extern/smoke_API.h 2009-09-13 16:24:06 UTC (rev 23185)
+++ branches/itasc/intern/smoke/extern/smoke_API.h 2009-09-13 16:36:02 UTC (rev 23186)
@@ -63,11 +63,11 @@
void smoke_turbulence_step(struct WTURBULENCE *wt, struct FLUID_3D *fluid);
float *smoke_turbulence_get_density(struct WTURBULENCE *wt);
-void smoke_turbulence_get_res(struct WTURBULENCE *wt, unsigned int *res);
+void smoke_turbulence_get_res(struct WTURBULENCE *wt, int *res);
void smoke_turbulence_set_noise(struct WTURBULENCE *wt, int type);
-void smoke_turbulence_initBlenderRNA(struct WTURBULENCE *wt, float *strength);
+void smoke_initWaveletBlenderRNA(struct WTURBULENCE *wt, float *strength);
-void smoke_turbulence_dissolve(struct WTURBULENCE *wt, int speed, int log);
+void smoke_dissolve_wavelet(struct WTURBULENCE *wt, int speed, int log);
// export
void smoke_turbulence_export(struct WTURBULENCE *wt, float **dens, float **densold, float **tcu, float **tcv, float **tcw);
Modified: branches/itasc/intern/smoke/intern/FLUID_3D.cpp
===================================================================
--- branches/itasc/intern/smoke/intern/FLUID_3D.cpp 2009-09-13 16:24:06 UTC (rev 23185)
+++ branches/itasc/intern/smoke/intern/FLUID_3D.cpp 2009-09-13 16:36:02 UTC (rev 23186)
@@ -27,9 +27,9 @@
#include <zlib.h>
// boundary conditions of the fluid domain
-#define DOMAIN_BC_FRONT 1
-#define DOMAIN_BC_TOP 0
-#define DOMAIN_BC_LEFT 1
+#define DOMAIN_BC_FRONT 0 // z
+#define DOMAIN_BC_TOP 1 // y
+#define DOMAIN_BC_LEFT 1 // x
#define DOMAIN_BC_BACK DOMAIN_BC_FRONT
#define DOMAIN_BC_BOTTOM DOMAIN_BC_TOP
#define DOMAIN_BC_RIGHT DOMAIN_BC_LEFT
@@ -111,47 +111,42 @@
}
// set side obstacles
- size_t index;
- for (int y = 0; y < _yRes; y++) // z
- for (int x = 0; x < _xRes; x++)
- {
- // front slab
- index = x + y * _xRes;
- if(DOMAIN_BC_BOTTOM==1) _obstacles[index] = 1;
+ int index;
+ for (int y = 0; y < _yRes; y++)
+ for (int x = 0; x < _xRes; x++)
+ {
+ // front slab
+ index = x + y * _xRes;
+ if(DOMAIN_BC_FRONT==1) _obstacles[index] = 1;
- // back slab
- index += _totalCells - _slabSize;
- if(DOMAIN_BC_TOP==1) _obstacles[index] = 1;
- }
- for (int z = 0; z < _zRes; z++) // y
- for (int x = 0; x < _xRes; x++)
- {
- // bottom slab
- index = x + z * _slabSize;
- if(DOMAIN_BC_FRONT==1) _obstacles[index] = 1;
+ // back slab
+ index += _totalCells - _slabSize;
+ if(DOMAIN_BC_BACK==1) _obstacles[index] = 1;
+ }
- // top slab
- index += _slabSize - _xRes;
- if(DOMAIN_BC_BACK==1) _obstacles[index] = 1;
- }
- for (int z = 0; z < _zRes; z++) // x
- for (int y = 0; y < _yRes; y++)
- {
- // left slab
- index = y * _xRes + z * _slabSize;
- if(DOMAIN_BC_LEFT==1) _obstacles[index] = 1;
+ for (int z = 0; z < _zRes; z++)
+ for (int x = 0; x < _xRes; x++)
+ {
+ // bottom slab
+ index = x + z * _slabSize;
+ if(DOMAIN_BC_BOTTOM==1) _obstacles[index] = 1;
- // right slab
- index += _xRes - 1;
- if(DOMAIN_BC_RIGHT==1) _obstacles[index] = 1;
- }
+ // top slab
+ index += _slabSize - _xRes;
+ if(DOMAIN_BC_TOP==1) _obstacles[index] = 1;
+ }
- /*
- SPHERE *obsSphere = NULL;
- obsSphere = new SPHERE(0.375,0.5,0.375, 0.1); // for 4 to 3 domain
- addObstacle(obsSphere);
- delete obsSphere;
- */
+ for (int z = 0; z < _zRes; z++)
+ for (int y = 0; y < _yRes; y++)
+ {
+ // left slab
+ index = y * _xRes + z * _slabSize;
+ if(DOMAIN_BC_LEFT==1) _obstacles[index] = 1;
+
+ // right slab
+ index += _xRes - 1;
+ if(DOMAIN_BC_RIGHT==1) _obstacles[index] = 1;
+ }
}
FLUID_3D::~FLUID_3D()
@@ -191,7 +186,7 @@
for (int i = 0; i < _totalCells; i++)
{
_xForce[i] = _yForce[i] = _zForce[i] = 0.0f;
- _obstacles[i] &= ~2;
+ // _obstacles[i] &= ~2;
}
wipeBoundaries();
@@ -232,7 +227,8 @@
_totalTime += _dt;
_totalSteps++;
- memset(_obstacles, 0, sizeof(unsigned char)*_xRes*_yRes*_zRes);
+ // todo xxx dg: only clear obstacles, not boundaries
+ // memset(_obstacles, 0, sizeof(unsigned char)*_xRes*_yRes*_zRes);
}
//////////////////////////////////////////////////////////////////////
@@ -270,7 +266,7 @@
//////////////////////////////////////////////////////////////////////
void FLUID_3D::copyBorderAll(float* field)
{
- size_t index;
+ int index;
for (int y = 0; y < _yRes; y++)
for (int x = 0; x < _xRes; x++)
{
@@ -350,14 +346,14 @@
// copy out the boundaries
if(DOMAIN_BC_LEFT == 0) setNeumannX(_xVelocity, _res);
- else setZeroX(_xVelocity, _res);
+ else setZeroX(_xVelocity, _res);
- if(DOMAIN_BC_TOP == 0) setNeumannZ(_zVelocity, _res);
+ if(DOMAIN_BC_TOP == 0) setNeumannY(_yVelocity, _res);
+ else setZeroY(_yVelocity, _res);
+
+ if(DOMAIN_BC_FRONT == 0) setNeumannZ(_zVelocity, _res);
else setZeroZ(_zVelocity, _res);
- if(DOMAIN_BC_FRONT == 0) setNeumannY(_yVelocity, _res);
- else setZeroY(_yVelocity, _res);
-
// calculate divergence
index = _slabSize + _xRes + 1;
for (z = 1; z < _zRes - 1; z++, index += 2 * _xRes)
@@ -400,12 +396,16 @@
for (y = 1; y < _yRes - 1; y++, index += 2)
for (x = 1; x < _xRes - 1; x++, index++)
{
- if(!_obstacles[index])
+ // if(!_obstacles[index])
{
_xVelocity[index] -= 0.5f * (_pressure[index + 1] - _pressure[index - 1]) * invDx;
_yVelocity[index] -= 0.5f * (_pressure[index + _xRes] - _pressure[index - _xRes]) * invDx;
_zVelocity[index] -= 0.5f * (_pressure[index + _slabSize] - _pressure[index - _slabSize]) * invDx;
- }
+ }/*
+ else
+ {
+ _xVelocity[index] = _yVelocity[index] = _zVelocity[index] = 0.0f;
+ }*/
}
if (_pressure) delete[] _pressure;
@@ -669,14 +669,14 @@
Vec3Int res = Vec3Int(_xRes,_yRes,_zRes);
if(DOMAIN_BC_LEFT == 0) copyBorderX(_xVelocity, res);
- else setZeroX(_xVelocity, res);
+ else setZeroX(_xVelocity, res);
- if(DOMAIN_BC_TOP == 0) copyBorderZ(_zVelocity, res);
+ if(DOMAIN_BC_TOP == 0) copyBorderY(_yVelocity, res);
+ else setZeroY(_yVelocity, res);
+
+ if(DOMAIN_BC_FRONT == 0) copyBorderZ(_zVelocity, res);
else setZeroZ(_zVelocity, res);
- if(DOMAIN_BC_FRONT == 0) copyBorderY(_yVelocity, res);
- else setZeroY(_yVelocity, res);
-
SWAP_POINTERS(_xVelocity, _xVelocityOld);
SWAP_POINTERS(_yVelocity, _yVelocityOld);
SWAP_POINTERS(_zVelocity, _zVelocityOld);
@@ -698,14 +698,14 @@
advectFieldMacCormack(dt0, _xVelocityOld, _yVelocityOld, _zVelocityOld, _zVelocityOld, _zVelocity, t1,t2, res, _obstacles);
if(DOMAIN_BC_LEFT == 0) copyBorderX(_xVelocity, res);
- else setZeroX(_xVelocity, res);
+ else setZeroX(_xVelocity, res);
- if(DOMAIN_BC_TOP == 0) copyBorderZ(_zVelocity, res);
+ if(DOMAIN_BC_TOP == 0) copyBorderY(_yVelocity, res);
+ else setZeroY(_yVelocity, res);
+
+ if(DOMAIN_BC_FRONT == 0) copyBorderZ(_zVelocity, res);
else setZeroZ(_zVelocity, res);
- if(DOMAIN_BC_FRONT == 0) copyBorderY(_yVelocity, res);
- else setZeroY(_yVelocity, res);
-
setZeroBorder(_density, res);
setZeroBorder(_heat, res);
Modified: branches/itasc/intern/smoke/intern/FLUID_3D_STATIC.cpp
===================================================================
--- branches/itasc/intern/smoke/intern/FLUID_3D_STATIC.cpp 2009-09-13 16:24:06 UTC (rev 23185)
+++ branches/itasc/intern/smoke/intern/FLUID_3D_STATIC.cpp 2009-09-13 16:36:02 UTC (rev 23186)
@@ -80,7 +80,7 @@
void FLUID_3D::setNeumannX(float* field, Vec3Int res)
{
const int slabSize = res[0] * res[1];
- size_t index;
+ int index;
for (int z = 0; z < res[2]; z++)
for (int y = 0; y < res[1]; y++)
{
@@ -92,6 +92,18 @@
index += res[0] - 1;
field[index] = field[index - 2];
}
+
+ // fix, force top slab to only allow outwards flux
+ for (int y = 0; y < res[1]; y++)
+ for (int z = 0; z < res[2]; z++)
+ {
+ // top slab
+ int index = y * res[0] + z * slabSize;
+ index += res[0] - 1;
+ if(field[index]<0.) field[index] = 0.;
+ index -= 1;
+ if(field[index]<0.) field[index] = 0.;
+ }
}
//////////////////////////////////////////////////////////////////////
@@ -100,18 +112,31 @@
void FLUID_3D::setNeumannY(float* field, Vec3Int res)
{
const int slabSize = res[0] * res[1];
- size_t index;
+ int index;
for (int z = 0; z < res[2]; z++)
for (int x = 0; x < res[0]; x++)
{
- // front slab
+ // bottom slab
index = x + z * slabSize;
field[index] = field[index + 2 * res[0]];
- // back slab
+ // top slab
index += slabSize - res[0];
field[index] = field[index - 2 * res[0]];
}
+
+ // fix, force top slab to only allow outwards flux
+ for (int z = 0; z < res[2]; z++)
+ for (int x = 0; x < res[0]; x++)
+ {
+ // top slab
+ int index = x + z * slabSize;
+ index += slabSize - res[0];
+ if(field[index]<0.) field[index] = 0.;
+ index -= res[0];
+ if(field[index]<0.) field[index] = 0.;
+ }
+
}
//////////////////////////////////////////////////////////////////////
@@ -121,15 +146,15 @@
{
const int slabSize = res[0] * res[1];
const int totalCells = res[0] * res[1] * res[2];
- size_t index;
+ int index;
for (int y = 0; y < res[1]; y++)
for (int x = 0; x < res[0]; x++)
{
- // bottom slab
+ // front slab
index = x + y * res[0];
field[index] = field[index + 2 * slabSize];
- // top slab
+ // back slab
index += totalCells - slabSize;
field[index] = field[index - 2 * slabSize];
}
@@ -139,11 +164,11 @@
for (int x = 0; x < res[0]; x++)
{
// top slab
- index = x + y * res[0];
+ int index = x + y * res[0];
index += totalCells - slabSize;
- if(field[index]<0.) field[index] = 0.0f;
+ if(field[index]<0.) field[index] = 0.;
index -= slabSize;
- if(field[index]<0.) field[index] = 0.0f;
+ if(field[index]<0.) field[index] = 0.;
}
}
@@ -231,13 +256,14 @@
void FLUID_3D::copyBorderY(float* field, Vec3Int res)
{
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list