diff --git a/src/testing.jl b/src/testing.jl index 3a4925a0..aa53b820 100644 --- a/src/testing.jl +++ b/src/testing.jl @@ -433,21 +433,29 @@ end # Create a set of random particles with an atomic density simiilar to that # of water at room temperature and pressure. -function xatomic(n=100_000;cutoff=12.,lcell=1) +function xatomic(n=100_000;cutoff=12.,lcell=1,type=:vec) atomic_density_of_water = 0.1 # atoms/ Angstrom^3 vol = n/atomic_density_of_water l = vol^(1/3) - x = l*rand(3,n) + if type == :mat + x = l*rand(3,n) + elseif type == :vec + x = [ l*rand(SVector{3,Float64}) for _ in 1:n ] + end box = Box([l,l,l],cutoff,lcell=lcell) return x, box end # Create a set of random particles with the typical density of galaxies -function xgalactic(n=8_000_000;cutoff=5.,lcell=1) +function xgalactic(n=8_000_000;cutoff=5.,lcell=1,type=:vec) galactic_density = 12 # galaxyes per cubic mega-parsecs (https://doi.org/10.1093/mnras/106.2.121) vol = n/galactic_density l = vol^(1/3) # mega-parsecs - x = l*rand(3,n) + if type == :mat + x = l*rand(3,n) + elseif type == :vec + x = [ l*rand(SVector{3,Float64}) for _ in 1:n ] + end box = Box([l,l,l],cutoff,lcell=lcell) return x, box end