Granular.jl

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

commit 3c3b0f50604fe20bb5fcae0438ff15151e96d1e9
parent e8dac6694d087e8d0f174260b7c674897978b320
Author: Anders Damsgaard <andersd@riseup.net>
Date:   Mon,  2 Apr 2018 15:28:17 -0400

Manually fix repeat commands across Julia 0.6 and 0.7

Diffstat:
Msrc/atmosphere.jl | 48++++++++++++++++++++++++++++++++++--------------
Msrc/ocean.jl | 48++++++++++++++++++++++++++++++++++--------------
2 files changed, 68 insertions(+), 28 deletions(-)

diff --git a/src/atmosphere.jl b/src/atmosphere.jl @@ -136,22 +136,42 @@ function createRegularAtmosphereGrid(n::Vector{Int}, bc_east::Integer = 1, bc_north::Integer = 1) - xq = Compat.repeat(Compat.range(origo[1], stop=origo[1] + L[1], - length=n[1] + 1), - 1, n[2] + 1) - yq = Compat.repeat(Compat.range(origo[2], stop=origo[2] + L[2], - length=n[2] + 1)', - n[1] + 1, 1) + if VERSION < v"0.7.0-DEV" + xq = repmat(Compat.range(origo[1], stop=origo[1] + L[1], + length=n[1] + 1), + 1, n[2] + 1) + yq = repmat(Compat.range(origo[2], stop=origo[2] + L[2], + length=n[2] + 1)', + n[1] + 1, 1) + else + xq = Compat.repeat(Compat.range(origo[1], stop=origo[1] + L[1], + length=n[1] + 1), + 1, n[2] + 1) + yq = Compat.repeat(Compat.range(origo[2], stop=origo[2] + L[2], + length=n[2] + 1)', + n[1] + 1, 1) + end dx = L./n - xh = Compat.repeat(Compat.range(origo[1] + .5*dx[1], - stop=origo[1] + L[1] - .5*dx[1], - length=n[1]), - 1, n[2]) - yh = Compat.repeat(Compat.range(origo[2] + .5*dx[2], - stop=origo[1] + L[2] - .5*dx[2], - length=n[2])', - n[1], 1) + if VERSION < v"0.7.0-DEV" + xh = repmat(Compat.range(origo[1] + .5*dx[1], + stop=origo[1] + L[1] - .5*dx[1], + length=n[1]), + 1, n[2]) + yh = repmat(Compat.range(origo[2] + .5*dx[2], + stop=origo[1] + L[2] - .5*dx[2], + length=n[2])', + n[1], 1) + else + xh = Compat.repeat(Compat.range(origo[1] + .5*dx[1], + stop=origo[1] + L[1] - .5*dx[1], + length=n[1]), + 1, n[2]) + yh = Compat.repeat(Compat.range(origo[2] + .5*dx[2], + stop=origo[1] + L[2] - .5*dx[2], + length=n[2])', + n[1], 1) + end zl = -Compat.range(.5*dx[3], stop=L[3] - .5*dx[3], length=n[3]) diff --git a/src/ocean.jl b/src/ocean.jl @@ -289,22 +289,42 @@ function createRegularOceanGrid(n::Vector{Int}, bc_east::Integer = 1, bc_north::Integer = 1) - xq = Compat.repeat(Compat.range(origo[1], stop=origo[1] + L[1], - length=n[1] + 1), - 1, n[2] + 1) - yq = Compat.repeat(Compat.range(origo[2], stop=origo[2] + L[2], - length=n[2] + 1)', - n[1] + 1, 1) + if VERSION < v"0.7.0-DEV" + xq = repmat(Compat.range(origo[1], stop=origo[1] + L[1], + length=n[1] + 1), + 1, n[2] + 1) + yq = repmat(Compat.range(origo[2], stop=origo[2] + L[2], + length=n[2] + 1)', + n[1] + 1, 1) + else + xq = Compat.repeat(Compat.range(origo[1], stop=origo[1] + L[1], + length=n[1] + 1), + 1, n[2] + 1) + yq = Compat.repeat(Compat.range(origo[2], stop=origo[2] + L[2], + length=n[2] + 1)', + n[1] + 1, 1) + end dx = L./n - xh = Compat.repeat(Compat.range(origo[1] + .5*dx[1], - stop=origo[1] + L[1] - .5*dx[1], - length=n[1]), - 1, n[2]) - yh = Compat.repeat(Compat.range(origo[2] + .5*dx[2], - stop=origo[2] + L[2] - .5*dx[2], - length=n[2])', - n[1], 1) + if VERSION < v"0.7.0-DEV" + xh = repmat(Compat.range(origo[1] + .5*dx[1], + stop=origo[1] + L[1] - .5*dx[1], + length=n[1]), + 1, n[2]) + yh = repmat(Compat.range(origo[2] + .5*dx[2], + stop=origo[2] + L[2] - .5*dx[2], + length=n[2])', + n[1], 1) + else + xh = Compat.repeat(Compat.range(origo[1] + .5*dx[1], + stop=origo[1] + L[1] - .5*dx[1], + length=n[1]), + 1, n[2]) + yh = Compat.repeat(Compat.range(origo[2] + .5*dx[2], + stop=origo[2] + L[2] - .5*dx[2], + length=n[2])', + n[1], 1) + end zl = -Compat.range(.5*dx[3], stop=L[3] - .5*dx[3], length=n[3]) zi = -Compat.range(0., stop=L[3], length=n[3] + 1)