public void AddVirtualParticlePeriodicBoundaries(Aggregate aggregate, double maxRadius, BoxDimension xDim, BoxDimension yDim) { foreach (var primaryParticle in aggregate.GetPrimaryParticles()) { var virtualParticle = GetVirtualParticle(primaryParticle); CheckPeriodicBoundary(virtualParticle, primaryParticle.Position.X, maxRadius, xDim); CheckPeriodicBoundary(virtualParticle, primaryParticle.Position.Y, maxRadius, yDim); } }
private void CheckPeriodicBoundary(PrimaryParticle virtualParticle, double oneDPosition, double maxRadius, BoxDimension dim) { if (oneDPosition + virtualParticle.Radius >= dim.Upper - maxRadius) { virtualParticle.Position.X -= dim.Width; AddParticlesToNeighborsList(virtualParticle); } else if (oneDPosition - virtualParticle.Radius <= dim.Lower + maxRadius) { virtualParticle.Position.X += dim.Width; AddParticlesToNeighborsList(virtualParticle); } }
public AbsoluteTetragonalSimulationBox(double width) { XDim = new BoxDimension(-0.5 * width, 0.5 * width); YDim = new BoxDimension(-0.5 * width, 0.5 * width); ZDim = new BoxDimension(0, 0); }