예제 #1
0
 public BoltzmannDistribution(ParticleContainer cont, double min, double max, double temperature) :
     base(cont)
 {
     this.min         = min;
     this.max         = max;
     this.temperature = temperature;
 }
예제 #2
0
 public BoltzmannGenerator(ParticleContainer cont, double temperature, ParticleInfo info,
                           int projectedCalls = 10000, int nDivisions = 10000) :
     base(cont, projectedCalls, nDivisions)
 {
     this.temperature = temperature;
     mass             = info.Mass;
     Setup();
 }
예제 #3
0
        /// <summary>
        /// Choose a random position inside the container
        /// </summary>
        static protected Vector RandomPosition(ParticleContainer grid)
        {
            double x = RandomGen.NextDouble() * grid.Size.X;
            double y = RandomGen.NextDouble() * grid.Size.Y;
            double z = RandomGen.NextDouble() * grid.Size.Z;

            return(new Vector(x, y, z));
        }
        /**
         * @param grid The container of Particles
         * @return A randomly generated position vector within a ParticleContainer
         */
        protected Vector randomPosition(ParticleContainer grid)
        {
            double x = random.NextDouble() * (xEnd - xStart) + xStart;
            double y = random.NextDouble() * grid.Size.Y;
            double z = random.NextDouble() * grid.Size.Z;

            return(new Vector(x, y, z));
        }
예제 #5
0
 /// <param name="cont">The particle container that will hold the generated particles</param>
 public RandomGenerator(ParticleContainer cont)
 {
     this.cont = cont;
 }
        public Particle GetRandomParticle(ParticleContainer container)
        {
            Vector velocity = Vector.RandomDirection(getSpeed(), random);

            return(new RandomWalkParticle(randomPosition(container), velocity, mass, color, meanFreeTime));
        }
예제 #7
0
 /// <param name="min">The minimum possible speed</param>
 /// <param name="max">The maximum possible speed</param>
 public FlatGenerator(ParticleContainer cont, double min, double max) :
     base(cont)
 {
     this.min = min;
     this.max = max;
 }
 public BoltzmannGenerator(ParticleContainer cont, double minSpeed, double maxSpeed) :
     base(cont)
 {
     this.minSpeed = minSpeed;
     this.maxSpeed = maxSpeed;
 }
예제 #9
0
 public FunctionGenerator(ParticleContainer cont, int nDivisions = 10000, int projectedCalls = 10000) :
     base(cont)
 {
     threshold       = 1.0 / projectedCalls / 10; // One tenth of the reciprocal of the number of calls
     this.nDivisions = nDivisions;
 }