public BoltzmannDistribution(ParticleContainer cont, double min, double max, double temperature) : base(cont) { this.min = min; this.max = max; this.temperature = temperature; }
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(); }
/// <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)); }
/// <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)); }
/// <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; }
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; }