aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs')
-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 {