Granular.jl

Julia package for granular dynamics simulation
git clone git://src.adamsgaard.dk/Granular.jl
Log | Files | Refs | README | LICENSE

commit 9ae0f82c3377f54903a1df0758fbd4f4f5884654
parent 5abf1529e8f726546dfdf049211b438e3071f3d9
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Wed, 12 Dec 2018 17:03:55 -0500

Use `Random.seed!` instead of `srand`

Diffstat:
Mexamples/double_gyre.jl | 2+-
Mexamples/image.jl | 4++--
Mexamples/logo.jl | 4++--
Mexamples/strait.jl | 2+-
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/examples/double_gyre.jl b/examples/double_gyre.jl @@ -59,7 +59,7 @@ n_walls = length(sim.grains) # Initialize ice floes everywhere floe_padding = .5*r noise_amplitude = .8*floe_padding -srand(1) +Random.seed!(1) for y in (4.*r + noise_amplitude):(2.*r + floe_padding):(L[2] - 4.*r - noise_amplitude) diff --git a/examples/image.jl b/examples/image.jl @@ -89,12 +89,12 @@ if forcing == "gyres" end elseif forcing == "down" || forcing == "sandpile" - srand(1) + Random.seed!(1) sim.ocean.u[:, :, 1, 1] = (rand(nx+1, ny+1) - 0.5)*0.1 sim.ocean.v[:, :, 1, 1] = -Ly/5.0 elseif forcing == "convergent" - srand(1) + Random.seed!(1) sim.ocean.u[:, :, 1, 1] = (rand(nx+1, ny+1) - 0.5)*0.1 for j=1:size(sim.ocean.u, 2) sim.ocean.v[:, j, 1, 1] = -(j/ny - 0.5)*10.0 diff --git a/examples/logo.jl b/examples/logo.jl @@ -119,12 +119,12 @@ if forcing == "gyres" end elseif forcing == "down" - srand(1) + Random.seed!(1) sim.ocean.u[:, :, 1, 1] = (rand(nx+1, ny+1) - .5)*.1 sim.ocean.v[:, :, 1, 1] = -5. elseif forcing == "convergent" - srand(1) + Random.seed!(1) sim.ocean.u[:, :, 1, 1] = (rand(nx+1, ny+1) - .5)*.1 for j=1:size(sim.ocean.u, 2) sim.ocean.v[:, j, 1, 1] = -(j/ny - .5)*10. diff --git a/examples/strait.jl b/examples/strait.jl @@ -86,7 +86,7 @@ dy = sqrt((2.*r_walls)^2. - dx^2.) spacing_to_boundaries = 4.*r floe_padding = .5*r noise_amplitude = floe_padding -srand(1) +Random.seed!(1) for y in (L[2] - r - noise_amplitude):(-(2.*r + floe_padding)):((L[2] - Ly_constriction)/2. + Ly_constriction) for x in (r + noise_amplitude):(2.*r + floe_padding):(Lx - r -