aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel
diff options
context:
space:
mode:
authorAdam Frisby2007-07-23 16:16:09 +0000
committerAdam Frisby2007-07-23 16:16:09 +0000
commit3abdec8d1748e14894837290c2a5707673389182 (patch)
tree5c08e5819d6a75f63edeaa53cb02f3669c2c3dcd /OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel
parent* 1 line commit: Erosion functions should taint the terrain. (diff)
downloadopensim-SC_OLD-3abdec8d1748e14894837290c2a5707673389182.zip
opensim-SC_OLD-3abdec8d1748e14894837290c2a5707673389182.tar.gz
opensim-SC_OLD-3abdec8d1748e14894837290c2a5707673389182.tar.bz2
opensim-SC_OLD-3abdec8d1748e14894837290c2a5707673389182.tar.xz
* Fixed a typecasting issue with Navier-Stokes algorithms in libTerrain.
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel')
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs21
1 files changed, 19 insertions, 2 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs
index 43987d4..24ff37c 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs
@@ -220,6 +220,20 @@ namespace libTerrain
220 } 220 }
221 } 221 }
222 222
223 private void nsDoublesToBuffer(double[,] doubles, int N, ref double[] dens)
224 {
225 int i;
226 int j;
227
228 for (i = 0; i <= N; i++)
229 {
230 for (j = 0; j <= N; j++)
231 {
232 dens[nsIX(i, j, N)] = doubles[i, j];
233 }
234 }
235 }
236
223 private void nsSimulate(int N, int rounds, double dt, double diff, double visc) 237 private void nsSimulate(int N, int rounds, double dt, double diff, double visc)
224 { 238 {
225 int size = (N * 2) * (N * 2); 239 int size = (N * 2) * (N * 2);
@@ -228,8 +242,11 @@ namespace libTerrain
228 double[] v = new double[size]; // Force, Y axis 242 double[] v = new double[size]; // Force, Y axis
229 double[] u_prev = new double[size]; 243 double[] u_prev = new double[size];
230 double[] v_prev = new double[size]; 244 double[] v_prev = new double[size];
231 double[] dens = (double[])map.Clone(); 245 double[] dens = new double[size];
232 double[] dens_prev = (double[])map.Clone(); 246 double[] dens_prev = new double[size];
247
248 nsDoublesToBuffer(this.map, N, ref dens);
249 nsDoublesToBuffer(this.map, N, ref dens_prev);
233 250
234 for (int i = 0; i < rounds; i++) 251 for (int i = 0; i < rounds; i++)
235 { 252 {