Hi
I have a small program that calculates x,y,z for a number og particles (point) by using a Random function.
When I stepping through the code, the correct values of x,y,z is printed out. If I run the program without stepping through the code – the same values of x,y and z is printed out
Why are x,y and z not update in normal run ?
private static void MakeParticles(StreamWriter srfile, Hashtable hashtable)
{
double []x;
double []y;
double []z;
double r,theta;
double dz;
int particle = 0;
int i = 0;
int j=0;
int k = 0;
x = new double[40];
y = new double[40];
z = new double[40];
double kurt;
foreach (WellData well in hashtable.Values)
{
k = k + 1;
LogFile.Write("For well: {0}",well.WellID);
dz = (well.Top_filter - well.Bottom_filter) / 10d;
for (j = 0; j < 10; j++)
{
srfile.Flush();
for (i = 0; i < 40; i++)
{
r = 25d * RandomNumber();
theta = 2d * Math.PI * RandomNumber();
x[i] = well.X + r * Math.Cos(theta);
y[i] = well.Y + r * Math.Sin(theta);
z[i] = well.Bottom_filter + dz * RandomNumber();
kurt = (x[i] + y[i] + z[i]);
Console.WriteLine("kurt is {0}",kurt.ToString("F3"));
}
for (i = 0; i < 40; i++)
{
srfile.WriteLine("0 0 0 {0} {1} {2} 0 0 0 0", x[i].ToString("F2"), y[i].ToString("F2"), z[i].ToString("F2"));
srfile.Flush();
}
}
LogFile.WriteLine("\thave released particle:\t {0} to {1}", (particle+1).ToString(), (particle + (i * j)).ToString());
particle = (i*j)*k;
LogFile.Flush();
srfile.WriteLine("::::::::::::::::::::::::::::::::::::::::::::");
srfile.Flush();
}
}
}