Samuel Andermatt wrote:The error is in the line (in ParticleSystem.java)
this.P[ i * Ny * Nz + j * Nz + k ] = new Particle( pos , v , R.getRN() );
Right. Well, first, do you understand Java operator precedence? The above line is the equivalent of:
this.P[ (i * Ny * Nz) + (j * Nz) + k ] = new Particle( pos , v , R.getRN() );
Is that what you want?
Other than that, I can't see any other cause off the top of my head; and if it
is the problem, I'm surprised it didn't throw ArrayIndexOutOfBoundsException.
Second: Your RNG class is redundant. Java has a class called java.util.Random, and it
is a good RNG - and seedable.
Winston
[Edit] Doh-h! The others have seen what I stupidly missed. However, I still reckon that
you should read my post, because the other things may be relevant.