tUse Compat calls for logging, norm. Import Random for srand - Granular.jl - Ju… | |
git clone git://src.adamsgaard.dk/Granular.jl | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit e8fa40594999e8bccbc71f56cd20629a96877c17 | |
parent c9bfcd094f1ee3ff4617eadea2818467df2a268b | |
Author: Anders Damsgaard <[email protected]> | |
Date: Mon, 2 Apr 2018 13:38:16 -0400 | |
Use Compat calls for logging, norm. Import Random for srand | |
Diffstat: | |
M Makefile | 4 ++-- | |
M REQUIRE | 2 +- | |
M examples/double_gyre.jl | 12 +++++++----- | |
M examples/image.jl | 11 ++++++----- | |
M examples/logo.jl | 11 ++++++----- | |
M examples/shear.jl | 3 ++- | |
M examples/strait.jl | 35 ++++++++++++++++++-----------… | |
M examples/two-grains.jl | 5 +++-- | |
M src/atmosphere.jl | 28 ++++++++++++++++++---------- | |
M src/contact_search.jl | 28 ++++++++++++++++------------ | |
M src/grain.jl | 20 ++++++++++++-------- | |
M src/grid.jl | 57 +++++++++++++++++------------… | |
M src/interaction.jl | 59 ++++++++++++++++-------------… | |
M src/io.jl | 52 +++++++++++++++++------------… | |
M src/ocean.jl | 53 +++++++++++++++++++----------… | |
M src/packing.jl | 26 ++++++++++++++------------ | |
M src/simulation.jl | 9 +++++---- | |
M src/temporal.jl | 16 +++++++++------- | |
M src/temporal_integration.jl | 2 ++ | |
M src/util.jl | 2 +- | |
M src/wall.jl | 20 +++++++++++--------- | |
M test/atmosphere.jl | 12 ++++++------ | |
M test/cohesion.jl | 16 ++++++++-------- | |
M test/collision-2floes-normal.jl | 78 ++++++++++++++++-------------… | |
M test/collision-2floes-oblique.jl | 136 ++++++++++++++++-------------… | |
M test/collision-5floes-normal.jl | 73 ++++++++++++++++-------------… | |
M test/contact-search-and-geometry.jl | 22 +++++++++++----------- | |
M test/grain.jl | 16 ++++++++-------- | |
M test/grid-boundaries.jl | 16 ++++++++-------- | |
M test/grid.jl | 48 ++++++++++++++++-------------… | |
M test/jld.jl | 12 ++++++------ | |
M test/netcdf.jl | 6 +++--- | |
M test/ocean.jl | 12 ++++++------ | |
M test/packing.jl | 20 ++++++++++---------- | |
M test/profiling.jl | 6 +++--- | |
M test/runtests.jl | 2 ++ | |
M test/temporal.jl | 2 +- | |
M test/util.jl | 7 ++++--- | |
M test/vtk.jl | 12 ++++++------ | |
M test/wall.jl | 66 ++++++++++++++++-------------… | |
40 files changed, 540 insertions(+), 477 deletions(-) | |
--- | |
diff --git a/Makefile b/Makefile | |
t@@ -1,7 +1,7 @@ | |
default: test | |
.PHONY: test | |
-test: test-julia-0.6 #test-julia-0.7 | |
+test: test-julia-0.6 test-julia-0.7 | |
.PHONY: test-julia-0.6 | |
test-julia-0.6: | |
t@@ -13,7 +13,7 @@ test-julia-0.6: | |
.PHONY: test-julia-0.7 | |
test-julia-0.7: | |
@#julia-0.7 --color=yes -e 'Pkg.test("Granular")' | |
- julia-0.7 --color=yes -e 'Pkg.test("Granular")' \ | |
+ julia-0.7 --color=yes -e 'import Pkg; Pkg.test("Granular")' \ | |
&& notify-send Granular.jl tests completed successfully on Jul… | |
|| notify-send Granular.jl failed on Julia 0.7 | |
diff --git a/REQUIRE b/REQUIRE | |
t@@ -1,4 +1,4 @@ | |
julia 0.6 | |
WriteVTK | |
Documenter | |
-Compat 0.42.0 | |
+Compat 0.63.0 | |
diff --git a/examples/double_gyre.jl b/examples/double_gyre.jl | |
t@@ -1,5 +1,6 @@ | |
#!/usr/bin/env julia | |
import Granular | |
+import Compat | |
sim = Granular.createSimulation(id="double_gyre") | |
t@@ -34,7 +35,7 @@ r = minimum(L[1:2]/n[1:2])/2. | |
h = 1. | |
## N-S wall segments | |
-for y in linspace(r, L[2]-r, Int(round((L[2] - 2.*r)/(r*2)))) | |
+for y in Compat.range(r, stop=L[2]-r, length=Int(round((L[2] - 2.*r)/(r*2)))) | |
Granular.addGrainCylindrical!(sim, [r, y], r, h, fixed=true, | |
verbose=false) | |
Granular.addGrainCylindrical!(sim, [L[1]-r, y], r, h, fixed=true, | |
t@@ -42,7 +43,8 @@ for y in linspace(r, L[2]-r, Int(round((L[2] - 2.*r)/(r*2)))) | |
end | |
## E-W wall segments | |
-for x in linspace(3.*r, L[1]-3.*r, Int(round((L[1] - 6.*r)/(r*2)))) | |
+for x in Compat.range(3.*r, stop=L[1]-3.*r, | |
+ length=Int(round((L[1] - 6.*r)/(r*2)))) | |
Granular.addGrainCylindrical!(sim, [x, r], r, h, fixed=true, | |
verbose=false) | |
Granular.addGrainCylindrical!(sim, [x, L[2]-r], r, h, fixed=true, | |
t@@ -50,14 +52,14 @@ for x in linspace(3.*r, L[1]-3.*r, Int(round((L[1] - 6.*r)… | |
end | |
n_walls = length(sim.grains) | |
-info("added $(n_walls) fixed ice floes as walls") | |
+Compat.@info "added $(n_walls) fixed ice floes as walls" | |
# Initialize ice floes everywhere | |
floe_padding = .5*r | |
noise_amplitude = .8*floe_padding | |
-srand(1) | |
+Compat.srand(1) | |
for y in (4.*r + noise_amplitude):(2.*r + floe_padding):(L[2] - 4.*r - | |
noise_amplitude) | |
t@@ -74,7 +76,7 @@ for y in (4.*r + noise_amplitude):(2.*r + floe_padding):(L[2… | |
end | |
end | |
n = length(sim.grains) - n_walls | |
-info("added $(n) ice floes") | |
+Compat.@info "added $(n) ice floes" | |
# Remove old simulation files | |
Granular.removeSimulationFiles(sim) | |
diff --git a/examples/image.jl b/examples/image.jl | |
t@@ -3,6 +3,7 @@ | |
import Granular | |
import FileIO | |
import Colors | |
+import Compat | |
const verbose = true | |
t@@ -43,7 +44,7 @@ const h = .5 | |
sim = Granular.createSimulation(id="image") | |
-info("nx = $nx, ny = $ny") | |
+Compat.@info "nx = $nx, ny = $ny" | |
for iy=1:size(img_bw, 1) | |
for ix=1:size(img_bw, 2) | |
t@@ -88,12 +89,12 @@ if forcing == "gyres" | |
end | |
elseif forcing == "down" || forcing == "sandpile" | |
- srand(1) | |
+ Compat.srand(1) | |
sim.ocean.u[:, :, 1, 1] = (rand(nx+1, ny+1) - .5)*.1 | |
sim.ocean.v[:, :, 1, 1] = -Ly/5. | |
elseif forcing == "convergent" | |
- srand(1) | |
+ Compat.srand(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. | |
t@@ -107,7 +108,7 @@ end | |
r = dx/4. | |
## N-S wall segments | |
-for y in linspace(r, Ly-r, Int(round((Ly - 2.*r)/(r*2)))) | |
+for y in Compat.range(r, stop=Ly-r, length=Int(round((Ly - 2.*r)/(r*2)))) | |
Granular.addGrainCylindrical!(sim, [r, y], r, h, fixed=true, | |
youngs_modulus=youngs_modulus, | |
verbose=false) | |
t@@ -117,7 +118,7 @@ for y in linspace(r, Ly-r, Int(round((Ly - 2.*r)/(r*2)))) | |
end | |
## E-W wall segments | |
-for x in linspace(3.*r, Lx-3.*r, Int(round((Lx - 6.*r)/(r*2)))) | |
+for x in Compat.range(3.*r, stop=Lx-3.*r, length=Int(round((Lx - 6.*r)/(r*2)))) | |
Granular.addGrainCylindrical!(sim, [x, r], r, h, fixed=true, | |
youngs_modulus=youngs_modulus, | |
verbose=false) | |
diff --git a/examples/logo.jl b/examples/logo.jl | |
t@@ -1,6 +1,7 @@ | |
#!/usr/bin/env julia | |
import Granular | |
+import Compat | |
const verbose = true | |
t@@ -53,7 +54,7 @@ const youngs_modulus = 2e6 | |
sim = Granular.createSimulation(id="logo") | |
print(logo_string) | |
-info("nx = $nx, ny = $ny") | |
+Compat.@info "nx = $nx, ny = $ny" | |
for iy=1:length(logo_string_split) | |
for ix=1:length(logo_string_split[iy]) | |
t@@ -118,12 +119,12 @@ if forcing == "gyres" | |
end | |
elseif forcing == "down" | |
- srand(1) | |
+ Compat.srand(1) | |
sim.ocean.u[:, :, 1, 1] = (rand(nx+1, ny+1) - .5)*.1 | |
sim.ocean.v[:, :, 1, 1] = -5. | |
elseif forcing == "convergent" | |
- srand(1) | |
+ Compat.srand(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. | |
t@@ -137,7 +138,7 @@ end | |
r = dx/4. | |
## N-S wall segments | |
-for y in linspace(r, Ly-r, Int(round((Ly - 2.*r)/(r*2)))) | |
+for y in Compat.range(r, stop=Ly-r, length=Int(round((Ly - 2.*r)/(r*2)))) | |
Granular.addGrainCylindrical!(sim, [r, y], r, h, fixed=true, | |
youngs_modulus=youngs_modulus, | |
verbose=false) | |
t@@ -147,7 +148,7 @@ for y in linspace(r, Ly-r, Int(round((Ly - 2.*r)/(r*2)))) | |
end | |
## E-W wall segments | |
-for x in linspace(3.*r, Lx-3.*r, Int(round((Lx - 6.*r)/(r*2)))) | |
+for x in Compat.range(3.*r, stop=Lx-3.*r, length=Int(round((Lx - 6.*r)/(r*2)))) | |
Granular.addGrainCylindrical!(sim, [x, r], r, h, fixed=true, | |
youngs_modulus=youngs_modulus, | |
verbose=false) | |
diff --git a/examples/shear.jl b/examples/shear.jl | |
t@@ -3,6 +3,7 @@ ENV["MPLBACKEND"] = "Agg" | |
import Granular | |
import JLD | |
import PyPlot | |
+import Compat | |
##############################################################################… | |
#### SIMULATION PARAMETERS … | |
t@@ -132,7 +133,7 @@ end | |
Granular.addWallLinearFrictionless!(sim, [0., 1.], y_top, | |
bc="normal stress", normal_stress=-N, | |
contact_viscosity_normal=1e3) | |
-info("Placing top wall at y=$y_top") | |
+Compat.@info "Placing top wall at y=$y_top" | |
# Resize the grid to span the current state | |
Granular.fitGridToGrains!(sim, sim.ocean) | |
diff --git a/examples/strait.jl b/examples/strait.jl | |
t@@ -1,5 +1,6 @@ | |
#!/usr/bin/env julia | |
import SeaIce | |
+import Compat | |
sim = SeaIce.createSimulation(id="strait") | |
n = [10, 10, 2] | |
t@@ -22,15 +23,15 @@ h = 1. | |
## N-S segments | |
r_walls = r_min | |
-for y in linspace((L[2] - Ly_constriction)/2., | |
- Ly_constriction + (L[2] - Ly_constriction)/2., | |
- Int(round(Ly_constriction/(r_walls*2)))) | |
+for y in Compat.range((L[2] - Ly_constriction)/2., | |
+ stop=Ly_constriction + (L[2] - Ly_constriction)/2., | |
+ length=Int(round(Ly_constriction/(r_walls*2)))) | |
SeaIce.addIceFloeCylindrical!(sim, [(Lx - Lx_constriction)/2., y], r_walls… | |
h, fixed=true, verbose=false) | |
end | |
-for y in linspace((L[2] - Ly_constriction)/2., | |
- Ly_constriction + (L[2] - Ly_constriction)/2., | |
- Int(round(Ly_constriction/(r_walls*2)))) | |
+for y in Compat.range((L[2] - Ly_constriction)/2., | |
+ stop=Ly_constriction + (L[2] - Ly_constriction)/2., | |
+ length=Int(round(Ly_constriction/(r_walls*2)))) | |
SeaIce.addIceFloeCylindrical!(sim, | |
[Lx_constriction + | |
(L[1] - Lx_constriction)/2., y], r_walls, h… | |
t@@ -41,8 +42,9 @@ dx = 2.*r_walls*sin(atan((Lx - Lx_constriction)/(L[2] - Ly_c… | |
## NW diagonal | |
x = r_walls:dx:((Lx - Lx_constriction)/2.) | |
-y = linspace(L[2] - r_walls, (L[2] - Ly_constriction)/2. + Ly_constriction + | |
- r_walls, length(x)) | |
+y = Compat.range(L[2] - r_walls, | |
+ stop=(L[2] - Ly_constriction)/2. + Ly_constriction + r_walls, | |
+ length=length(x)) | |
for i in 1:length(x) | |
SeaIce.addIceFloeCylindrical!(sim, [x[i], y[i]], r_walls, h, fixed=true, | |
verbose=false) | |
t@@ -50,8 +52,9 @@ end | |
## NE diagonal | |
x = (L[1] - r_walls):(-dx):((Lx - Lx_constriction)/2. + Lx_constriction) | |
-y = linspace(L[2] - r_walls, (L[2] - Ly_constriction)/2. + Ly_constriction + | |
- r_walls, length(x)) | |
+y = Compat.range(L[2] - r_walls, | |
+ stop=(L[2] - Ly_constriction)/2. + Ly_constriction + r_walls, | |
+ length=length(x)) | |
for i in 1:length(x) | |
SeaIce.addIceFloeCylindrical!(sim, [x[i], y[i]], r_walls, h, fixed=true, | |
verbose=false) | |
t@@ -59,7 +62,8 @@ end | |
## SW diagonal | |
x = r_walls:dx:((Lx - Lx_constriction)/2.) | |
-y = linspace(r, (L[2] - Ly_constriction)/2. - r_walls, length(x)) | |
+y = Compat.range(r, stop=(L[2] - Ly_constriction)/2. - r_walls, | |
+ length=length(x)) | |
for i in 1:length(x) | |
SeaIce.addIceFloeCylindrical!(sim, [x[i], y[i]], r_walls, h, fixed=true, | |
verbose=false) | |
t@@ -67,14 +71,15 @@ end | |
## SE diagonal | |
x = (L[1] - r_walls):(-dx):((Lx - Lx_constriction)/2. + Lx_constriction) | |
-y = linspace(r_walls, (L[2] - Ly_constriction)/2. - r_walls, length(x)) | |
+y = Compat.range(r_walls, stop=(L[2] - Ly_constriction)/2. - r_walls, | |
+ length=length(x)) | |
for i in 1:length(x) | |
SeaIce.addIceFloeCylindrical!(sim, [x[i], y[i]], r_walls, h, fixed=true, | |
verbose=false) | |
end | |
n_walls = length(sim.ice_floes) | |
-info("added $(n_walls) fixed ice floes as walls") | |
+Compat.@info "added $(n_walls) fixed ice floes as walls" | |
# Initialize ice floes in wedge north of the constriction | |
iy = 1 | |
t@@ -82,7 +87,7 @@ dy = sqrt((2.*r_walls)^2. - dx^2.) | |
spacing_to_boundaries = 4.*r | |
floe_padding = .5*r | |
noise_amplitude = floe_padding | |
-srand(1) | |
+Compat.srand(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 - | |
t@@ -108,7 +113,7 @@ for y in (L[2] - r - noise_amplitude):(-(2.*r + floe_paddi… | |
iy += 1 | |
end | |
n = length(sim.ice_floes) - n_walls | |
-info("added $(n) ice floes") | |
+Compat.@info "added $(n) ice floes" | |
# Remove old simulation files | |
SeaIce.removeSimulationFiles(sim) | |
diff --git a/examples/two-grains.jl b/examples/two-grains.jl | |
t@@ -1,5 +1,6 @@ | |
#!/usr/bin/env julia | |
import Granular | |
+import Compat | |
# Create the simulation object which, among other things, will hold all | |
# imformation on the simulated grains. You can call this object whatever you | |
t@@ -35,8 +36,8 @@ Granular.run!(sim) | |
E_kin_after = Granular.totalGrainKineticTranslationalEnergy(sim) | |
# Report these values to console | |
-info("Kinetic energy before: $E_kin_before J") | |
-info("Kinetic energy after: $E_kin_after J") | |
+Compat.@info "Kinetic energy before: $E_kin_before J" | |
+Compat.@info "Kinetic energy after: $E_kin_after J" | |
Granular.render(sim, animation=true) | |
diff --git a/src/atmosphere.jl b/src/atmosphere.jl | |
t@@ -1,4 +1,6 @@ | |
+import Compat | |
using Compat.Test | |
+using Compat.LinearAlgebra | |
export createEmptyAtmosphere | |
"Returns empty ocean type for initialization purposes." | |
t@@ -73,8 +75,8 @@ function interpolateAtmosphereState(atmosphere::Atmosphere, … | |
if length(atmosphere.time) == 1 | |
return atmosphere.u, atmosphere.v | |
elseif t < atmosphere.time[1] || t > atmosphere.time[end] | |
- error("selected time (t = $(t)) is outside the range of time steps in | |
- the atmosphere data") | |
+ error("selected time (t = $(t)) is outside the range of " * | |
+ "time steps in the atmosphere data") | |
end | |
i = 1 | |
t@@ -134,16 +136,22 @@ function createRegularAtmosphereGrid(n::Vector{Int}, | |
bc_east::Integer = 1, | |
bc_north::Integer = 1) | |
- xq = repmat(linspace(origo[1], origo[1] + L[1], n[1] + 1), 1, n[2] + 1) | |
- yq = repmat(linspace(origo[2], origo[2] + L[2], n[2] + 1)', n[1] + 1, 1) | |
+ xq = repeat(Compat.range(origo[1], stop=origo[1] + L[1], length=n[1] + 1), | |
+ 1, n[2] + 1) | |
+ yq = repeat(Compat.range(origo[2], stop=origo[2] + L[2], length=n[2] + 1)', | |
+ n[1] + 1, 1) | |
dx = L./n | |
- xh = repmat(linspace(origo[1] + .5*dx[1], origo[1] + L[1] - .5*dx[1], | |
- n[1]), 1, n[2]) | |
- yh = repmat(linspace(origo[2] + .5*dx[2], origo[1] + L[2] - .5*dx[2], | |
- n[2])', n[1], 1) | |
- | |
- zl = -linspace(.5*dx[3], L[3] - .5*dx[3], n[3]) | |
+ xh = repeat(Compat.range(origo[1] + .5*dx[1], | |
+ stop=origo[1] + L[1] - .5*dx[1], | |
+ length=n[1]), | |
+ 1, n[2]) | |
+ yh = repeat(Compat.range(origo[2] + .5*dx[2], | |
+ stop=origo[1] + L[2] - .5*dx[2], | |
+ length=n[2])', | |
+ n[1], 1) | |
+ | |
+ zl = -Compat.range(.5*dx[3], stop=L[3] - .5*dx[3], length=n[3]) | |
u = zeros(n[1] + 1, n[2] + 1, n[3], length(time)) | |
v = zeros(n[1] + 1, n[2] + 1, n[3], length(time)) | |
diff --git a/src/contact_search.jl b/src/contact_search.jl | |
t@@ -1,3 +1,6 @@ | |
+import Compat | |
+using Compat.LinearAlgebra | |
+ | |
## Contact mapping | |
export findContacts! | |
""" | |
t@@ -76,15 +79,15 @@ function findContactsAllToAll!(simulation::Simulation) | |
simulation.ocean.bc_east > 1 || | |
simulation.ocean.bc_north > 1 || | |
simulation.ocean.bc_south > 1 | |
- error("Ocean boundary conditions to not work with all-to-all contact "… | |
- "search") | |
+ error("Ocean boundary conditions to not work with all-to-all " * | |
+ "contact search") | |
end | |
if simulation.atmosphere.bc_west > 1 || | |
simulation.atmosphere.bc_east > 1 || | |
simulation.atmosphere.bc_north > 1 || | |
simulation.atmosphere.bc_south > 1 | |
- error("Atmopshere boundary conditions to not work with all-to-all " * | |
- "contact search") | |
+ error("Atmopshere boundary conditions to not work with " * | |
+ "all-to-all contact search") | |
end | |
@inbounds for i = 1:length(simulation.grains) | |
t@@ -289,7 +292,7 @@ function checkAndAddContact!(sim::Simulation, i::Int, j::I… | |
for ic=1:sim.Nc_max | |
@inbounds if sim.grains[i].contacts[ic] == j | |
contact_found = true | |
- @inbounds sim.grains[i].position_vector[ic] .= position_ij | |
+ @inbounds sim.grains[i].position_vector[ic] = position_ij | |
nothing # contact already registered | |
end | |
end | |
t@@ -305,13 +308,14 @@ function checkAndAddContact!(sim::Simulation, i::Int, j:… | |
# Test if this contact exceeds the number of contacts | |
if ic == (sim.Nc_max + 1) | |
for ic=1:sim.Nc_max | |
- warn("grains[$i].contacts[$ic] = " * | |
- "$(sim.grains[i].contacts[ic])") | |
- warn("grains[$i].contact_age[$ic] = " * | |
- "$(sim.grains[i].contact_age[ic])") | |
+ Compat.@warn "grains[$i].contacts[$ic] = " * | |
+ "$(sim.grains[i].contacts[ic])" | |
+ Compat.@warn "grains[$i].contact_age[$ic] = " * | |
+ "$(sim.grains[i].contact_age[ic])" | |
end | |
- error("contact $i-$j exceeds max. number of contacts "… | |
- "(sim.Nc_max = $(sim.Nc_max)) for grain $i") | |
+ error("contact $i-$j exceeds max. number of " * | |
+ "contacts (sim.Nc_max = $(sim.Nc_max)) " * | |
+ "for grain $i") | |
end | |
# Register as new contact | |
t@@ -319,7 +323,7 @@ function checkAndAddContact!(sim::Simulation, i::Int, j::I… | |
@inbounds sim.grains[i].n_contacts += 1 | |
@inbounds sim.grains[j].n_contacts += 1 | |
@inbounds sim.grains[i].contacts[ic] = j | |
- @inbounds sim.grains[i].position_vector[ic] .= | |
+ @inbounds sim.grains[i].position_vector[ic] = | |
position_ij | |
@inbounds fill!(sim.grains[i]. | |
contact_parallel_displacement[ic] , 0.) | |
diff --git a/src/grain.jl b/src/grain.jl | |
t@@ -1,6 +1,8 @@ | |
## Manage grains in the model | |
+import Compat | |
using Compat.Test | |
+using Compat.LinearAlgebra | |
export addGrainCylindrical! | |
""" | |
t@@ -182,22 +184,24 @@ function addGrainCylindrical!(simulation::Simulation, | |
# Check input values | |
if length(lin_pos) != 2 | |
- error("Linear position must be a two-element array (lin_pos = ", | |
- "$lin_pos)") | |
+ error("Linear position must be a two-element array " * | |
+ "(lin_pos = $lin_pos)") | |
end | |
if length(lin_vel) != 2 | |
- error("Linear velocity must be a two-element array (lin_vel = ", | |
- "$lin_vel)") | |
+ error("Linear velocity must be a two-element array " * | |
+ "(lin_vel = $lin_vel)") | |
end | |
if length(lin_acc) != 2 | |
- error("Linear acceleration must be a two-element array (lin_acc = ", | |
- "$lin_acc)") | |
+ error("Linear acceleration must be a two-element array " * | |
+ "(lin_acc = $lin_acc)") | |
end | |
if contact_radius <= 0.0 | |
- error("Radius must be greater than 0.0 (radius = $contact_radius m)") | |
+ error("Radius must be greater than 0.0 " * | |
+ "(radius = $contact_radius m)") | |
end | |
if density <= 0.0 | |
- error("Density must be greater than 0.0 (density = $density kg/m^3)") | |
+ error("Density must be greater than 0.0 " * | |
+ "(density = $density kg/m^3)") | |
end | |
if !areal_radius | |
diff --git a/src/grid.jl b/src/grid.jl | |
t@@ -1,3 +1,6 @@ | |
+import Compat | |
+using Compat.LinearAlgebra | |
+ | |
""" | |
bilinearInterpolation(field, x_tilde, y_tilde, i, j, k, it) | |
t@@ -211,8 +214,8 @@ function sortGrainsInGrid!(simulation::Simulation, grid::A… | |
i > grid.n[1] || j > grid.n[2])) | |
if verbose | |
- info("Disabling grain $idx at pos (" * | |
- "$(simulation.grains[idx].lin_pos))") | |
+ Compat.@info "Disabling grain $idx at pos (" * | |
+ "$(simulation.grains[idx].lin_pos))" | |
end | |
disableGrain!(simulation, idx) | |
continue | |
t@@ -220,9 +223,11 @@ function sortGrainsInGrid!(simulation::Simulation, grid::… | |
# add cell to grain | |
if typeof(grid) == Ocean | |
- @inbounds simulation.grains[idx].ocean_grid_pos .= i, j | |
+ @inbounds simulation.grains[idx].ocean_grid_pos[1] = i | |
+ @inbounds simulation.grains[idx].ocean_grid_pos[2] = j | |
elseif typeof(grid) == Atmosphere | |
- @inbounds simulation.grains[idx].atmosphere_grid_pos .= i, j | |
+ @inbounds simulation.grains[idx].atmosphere_grid_pos[1] = i | |
+ @inbounds simulation.grains[idx].atmosphere_grid_pos[2] = j | |
else | |
error("grid type not understood.") | |
end | |
t@@ -507,9 +512,9 @@ function conformalQuadrilateralCoordinates(A::Vector{Float… | |
y_tilde = yy2 | |
end | |
else | |
- error("could not perform conformal mapping\n", | |
- "A = $(A), B = $(B), C = $(C), D = $(D), point = $(p),\n", | |
- "alpha = $(alpha), beta = $(beta), gamma = $(gamma), ", | |
+ error("could not perform conformal mapping\n" * | |
+ "A = $(A), B = $(B), C = $(C), D = $(D), point = $(p),\n" * | |
+ "alpha = $(alpha), beta = $(beta), gamma = $(gamma), " * | |
"delta = $(delta), epsilon = $(epsilon), kappa = $(kappa)") | |
end | |
else | |
t@@ -526,10 +531,10 @@ function conformalQuadrilateralCoordinates(A::Vector{Flo… | |
elseif !(b ≈ 0.) | |
x_tilde = (dy - epsilon*y_tilde)/b | |
else | |
- error("could not determine non-dimensional position in quadrilateral ", | |
- "(a = 0. and b = 0.)\n", | |
- "A = $(A), B = $(B), C = $(C), D = $(D), point = $(p),\n", | |
- "alpha = $(alpha), beta = $(beta), gamma = $(gamma), ", | |
+ error("could not determine non-dimensional position in quadrilateral "… | |
+ "(a = 0. and b = 0.)\n" * | |
+ "A = $(A), B = $(B), C = $(C), D = $(D), point = $(p),\n" * | |
+ "alpha = $(alpha), beta = $(beta), gamma = $(gamma), " * | |
"delta = $(delta), epsilon = $(epsilon), kappa = $(kappa)") | |
end | |
return Float64[x_tilde, y_tilde] | |
t@@ -580,13 +585,13 @@ function findEmptyPositionInGridCell(simulation::Simulat… | |
for i_iter=1:n_iter | |
overlap_found = false | |
- srand(i*j*seed*i_iter) | |
+ Compat.srand(i*j*seed*i_iter) | |
# generate random candidate position | |
x_tilde = rand() | |
y_tilde = rand() | |
bilinearInterpolation!(pos, grid.xq, grid.yq, x_tilde, y_tilde, i, j) | |
if verbose | |
- info("trying position $pos in cell $i,$j") | |
+ Compat.@info "trying position $pos in cell $i,$j" | |
end | |
# do not penetrate outside of grid boundaries | |
t@@ -620,7 +625,7 @@ function findEmptyPositionInGridCell(simulation::Simulatio… | |
if overlap < 0. | |
if verbose | |
- info("overlap with $grain_idx in cell $i,$j") | |
+ Compat.@info "overlap with $grain_idx in cell … | |
end | |
overlap_found = true | |
break | |
t@@ -642,13 +647,13 @@ function findEmptyPositionInGridCell(simulation::Simulat… | |
if spot_found | |
if verbose | |
- info("Found position $pos in cell $i,$j") | |
+ Compat.@info "Found position $pos in cell $i,$j" | |
end | |
return pos | |
else | |
if verbose | |
- warn("could not insert an grain into " * | |
- "$(typeof(grid)) grid cell ($i, $j)") | |
+ Compat.@warn "could not insert an grain into " * | |
+ "$(typeof(grid)) grid cell ($i, $j)" | |
end | |
return false | |
end | |
t@@ -727,22 +732,22 @@ function setGridBoundaryConditions!(grid::Any, | |
error("Mode '$mode' not recognized as a valid boundary condition type") | |
end | |
- if contains(grid_face, "west") | |
+ if Compat.occursin("west", grid_face) | |
grid.bc_west = grid_bc_flags[mode] | |
something_changed = true | |
end | |
- if contains(grid_face, "south") | |
+ if Compat.occursin("south", grid_face) | |
grid.bc_south = grid_bc_flags[mode] | |
something_changed = true | |
end | |
- if contains(grid_face, "east") | |
+ if Compat.occursin("east", grid_face) | |
grid.bc_east = grid_bc_flags[mode] | |
something_changed = true | |
end | |
- if contains(grid_face, "north") | |
+ if Compat.occursin("north", grid_face) | |
grid.bc_north = grid_bc_flags[mode] | |
something_changed = true | |
end | |
t@@ -756,8 +761,8 @@ function setGridBoundaryConditions!(grid::Any, | |
end | |
if !something_changed | |
- error("grid_face string '$grid_face' not understood, must be east, " * | |
- "west, north, and/or south.") | |
+ error("grid_face string '$grid_face' not understood, " * | |
+ "must be east, west, north, and/or south.") | |
end | |
if verbose | |
t@@ -1028,9 +1033,9 @@ function fitGridToGrains!(simulation::Simulation, grid::… | |
end | |
if verbose | |
- info("Created regular $(typeof(grid)) grid from " * | |
+ Compat.@info "Created regular $(typeof(grid)) grid from " * | |
"[$min_x, $min_y] to [$max_x, $max_y] " * | |
- "with a cell size of $dx ($n).") | |
+ "with a cell size of $dx ($n)." | |
end | |
nothing | |
t@@ -1039,7 +1044,7 @@ end | |
function findPorosity!(sim::Simulation, grid::Any; verbose::Bool=true) | |
if !isassigned(grid.grain_list) | |
- info("Sorting grains in grid") | |
+ Compat.@info "Sorting grains in grid" | |
sortGrainsInGrid!(sim, grid, verbose=verbose) | |
end | |
diff --git a/src/interaction.jl b/src/interaction.jl | |
t@@ -1,4 +1,6 @@ | |
## Interaction functions | |
+import Compat | |
+using Compat.LinearAlgebra | |
export interact! | |
""" | |
t@@ -125,51 +127,50 @@ function interactGrains!(simulation::Simulation, i::Int,… | |
# Inter-position vector, use stored value which is corrected for boundary | |
# periodicity | |
- const p = simulation.grains[i].position_vector[ic] | |
- const dist = norm(p) | |
+ p = simulation.grains[i].position_vector[ic] | |
+ dist = norm(p) | |
- const r_i = simulation.grains[i].contact_radius | |
- const r_j = simulation.grains[j].contact_radius | |
+ r_i = simulation.grains[i].contact_radius | |
+ r_j = simulation.grains[j].contact_radius | |
# Floe distance; <0: compression, >0: tension | |
- const δ_n = dist - (r_i + r_j) | |
+ δ_n = dist - (r_i + r_j) | |
# Local axes | |
- const n = p/dist | |
- const t = [-n[2], n[1]] | |
+ n = p/dist | |
+ t = [-n[2], n[1]] | |
# Contact kinematics | |
- const vel_lin = simulation.grains[i].lin_vel - | |
- simulation.grains[j].lin_vel | |
- const vel_n = dot(vel_lin, n) | |
- const vel_t = dot(vel_lin, t) - | |
+ vel_lin = simulation.grains[i].lin_vel - simulation.grains[j].lin_vel | |
+ vel_n = dot(vel_lin, n) | |
+ vel_t = dot(vel_lin, t) - | |
harmonicMean(r_i, r_j)*(simulation.grains[i].ang_vel + | |
simulation.grains[j].ang_vel) | |
# Correct old tangential displacement for contact rotation and add new | |
- const δ_t0 = simulation.grains[i].contact_parallel_displacement[ic] | |
- const δ_t = dot(t, δ_t0 - (n*dot(n, δ_t0))) + vel_t*simulation.time_step | |
+ δ_t0 = simulation.grains[i].contact_parallel_displacement[ic] | |
+ δ_t = dot(t, δ_t0 - (n*dot(n, δ_t0))) + vel_t*simulation.time_step | |
# Determine the contact rotation | |
- const θ_t = simulation.grains[i].contact_rotation[ic] + | |
+ θ_t = simulation.grains[i].contact_rotation[ic] + | |
(simulation.grains[j].ang_vel - simulation.grains[i].ang_vel) * | |
simulation.time_step | |
# Effective radius | |
- const R_ij = harmonicMean(r_i, r_j) | |
+ R_ij = harmonicMean(r_i, r_j) | |
# Contact area | |
- const A_ij = R_ij*min(simulation.grains[i].thickness, | |
- simulation.grains[j].thickness) | |
+ A_ij = R_ij*min(simulation.grains[i].thickness, | |
+ simulation.grains[j].thickness) | |
# Contact mechanical parameters | |
if simulation.grains[i].youngs_modulus > 0. && | |
simulation.grains[j].youngs_modulus > 0. | |
- const E = harmonicMean(simulation.grains[i].youngs_modulus, | |
- simulation.grains[j].youngs_modulus) | |
- const ν = harmonicMean(simulation.grains[i].poissons_ratio, | |
- simulation.grains[j].poissons_ratio) | |
+ E = harmonicMean(simulation.grains[i].youngs_modulus, | |
+ simulation.grains[j].youngs_modulus) | |
+ ν = harmonicMean(simulation.grains[i].poissons_ratio, | |
+ simulation.grains[j].poissons_ratio) | |
# Effective normal and tangential stiffness | |
k_n = E * A_ij/R_ij | |
t@@ -184,14 +185,14 @@ function interactGrains!(simulation::Simulation, i::Int,… | |
simulation.grains[j].contact_stiffness_tangential) | |
end | |
- const γ_n = harmonicMean(simulation.grains[i].contact_viscosity_normal, | |
- simulation.grains[j].contact_viscosity_normal) | |
+ γ_n = harmonicMean(simulation.grains[i].contact_viscosity_normal, | |
+ simulation.grains[j].contact_viscosity_normal) | |
- const γ_t = harmonicMean(simulation.grains[i].contact_viscosity_tangentia… | |
- simulation.grains[j].contact_viscosity_tangential) | |
+ γ_t = harmonicMean(simulation.grains[i].contact_viscosity_tangential, | |
+ simulation.grains[j].contact_viscosity_tangential) | |
- const μ_d_minimum = min(simulation.grains[i].contact_dynamic_friction, | |
- simulation.grains[j].contact_dynamic_friction) | |
+ μ_d_minimum = min(simulation.grains[i].contact_dynamic_friction, | |
+ simulation.grains[j].contact_dynamic_friction) | |
# Determine contact forces | |
if k_n ≈ 0. && γ_n ≈ 0. # No interaction | |
t@@ -222,8 +223,8 @@ function interactGrains!(simulation::Simulation, i::Int, j… | |
end | |
# Grain-pair moment of inertia [m^4] | |
- const I_ij = 2.0/3.0*R_ij^3*min(simulation.grains[i].thickness, | |
- simulation.grains[j].thickness) | |
+ I_ij = 2.0/3.0*R_ij^3*min(simulation.grains[i].thickness, | |
+ simulation.grains[j].thickness) | |
# Contact tensile strength increases linearly with contact age until | |
diff --git a/src/io.jl b/src/io.jl | |
t@@ -1,4 +1,6 @@ | |
import WriteVTK | |
+import Compat | |
+using Compat.LinearAlgebra | |
hasJLD = false | |
if typeof(Pkg.installed("JLD")) == VersionNumber | |
t@@ -28,9 +30,10 @@ function writeSimulation(simulation::Simulation; | |
folder::String=".", | |
verbose::Bool=true) | |
if !hasJLD | |
- warn("Package JLD not found. Simulation save/read not supported. " * | |
+ Compat.@warn "Package JLD not found. " * | |
+ "Simulation save/read not supported. " * | |
"Please install JLD and its " * | |
- "requirements with `Pkg.add(\"JLD\")`.") | |
+ "requirements with `Pkg.add(\"JLD\")`." | |
else | |
if filename == "" | |
folder = folder * "/" * simulation.id | |
t@@ -42,7 +45,7 @@ function writeSimulation(simulation::Simulation; | |
JLD.save(filename, "simulation", simulation) | |
if verbose | |
- info("simulation written to $filename") | |
+ Compat.@info "simulation written to $filename" | |
end | |
end | |
nothing | |
t@@ -63,14 +66,15 @@ Return `Simulation` content read from disk using the JDL f… | |
function readSimulation(filename::String; | |
verbose::Bool=true) | |
if !hasJLD | |
- warn("Package JLD not found. Simulation save/read not supported. " * | |
+ Compat.@warn "Package JLD not found. " * | |
+ "Simulation save/read not supported. " * | |
"Please install JLD and its " * | |
- "requirements with `Pkg.add(\"JLD\")`.") | |
+ "requirements with `Pkg.add(\"JLD\")`." | |
nothing | |
else | |
return JLD.load(filename, "simulation") | |
if verbose | |
- info("Read simulation from $filename") | |
+ Compat.@info "Read simulation from $filename" | |
end | |
end | |
end | |
t@@ -93,9 +97,9 @@ function readSimulation(simulation::Simulation; | |
step::Integer = -1, | |
verbose::Bool = true) | |
if !hasJLD | |
- warn("Package JLD not found. Simulation save/read not supported. " * | |
+ Compat.@warn "Package JLD not found. Simulation save/read not supporte… | |
"Please install JLD and its " * | |
- "requirements with `Pkg.add(\"JLD\")`.") | |
+ "requirements with `Pkg.add(\"JLD\")`." | |
nothing | |
else | |
if step == -1 | |
t@@ -103,7 +107,7 @@ function readSimulation(simulation::Simulation; | |
end | |
filename = string(simulation.id, "/", simulation.id, ".$step.jld") | |
if verbose | |
- info("Read simulation from $filename") | |
+ Compat.@info "Read simulation from $filename" | |
end | |
return JLD.load(filename, "simulation") | |
end | |
t@@ -128,7 +132,7 @@ function writeSimulationStatus(simulation::Simulation; | |
simulation.time/simulation.time_total*100. | |
float(simulation.file_number)]) | |
if verbose | |
- info("Wrote status to $filename") | |
+ Compat.@info "Wrote status to $filename" | |
end | |
nothing | |
end | |
t@@ -154,10 +158,10 @@ function readSimulationStatus(simulation_id::String; | |
data = readdlm(filename) | |
if verbose | |
- info("$simulation_id:\n" * | |
+ Compat.@info "$simulation_id:\n" * | |
" time: $(data[1]) s\n" * | |
" complete: $(data[2])%\n" * | |
- " last output file: $(Int(round(data[3])))\n") | |
+ " last output file: $(Int(round(data[3])))\n" | |
end | |
return Int(round(data[3])) | |
""" | |
t@@ -226,7 +230,7 @@ function status(folder::String="."; | |
for (root, dirs, files) in walkdir(folder, follow_symlinks=false) | |
for file in files | |
- if contains(file, ".status.txt") | |
+ if Compat.occursin(".status.txt", file) | |
push!(status_files, joinpath(root, file)) | |
end | |
end | |
t@@ -272,7 +276,7 @@ function status(folder::String="."; | |
"--------------------------------------") | |
end | |
else | |
- warn("no simulations found in $(pwd())/$folder") | |
+ Compat.@warn "no simulations found in $(pwd())/$folder" | |
end | |
if loop && t_int > 0 | |
t@@ -443,7 +447,7 @@ function writeGrainVTK(simulation::Simulation, | |
outfiles = WriteVTK.vtk_save(vtkfile) | |
if verbose | |
- info("Output file: " * outfiles[1]) | |
+ Compat.@info "Output file: $(outfiles[1])" | |
end | |
nothing | |
end | |
t@@ -773,7 +777,7 @@ function writeGridVTK(grid::Any, | |
outfiles = WriteVTK.vtk_save(vtkfile) | |
if verbose | |
- info("Output file: " * outfiles[1]) | |
+ Compat.@info "Output file: $(outfiles[1])" | |
end | |
nothing | |
end | |
t@@ -1045,8 +1049,8 @@ FrameWindow=[0, $(simulation.file_number)]) | |
end | |
end | |
if verbose | |
- info("$(filename) written, execute with " * | |
- "'pvpython $(vtk_folder)/$(simulation.id).py'") | |
+ Compat.@info "$(filename) written, execute with " * | |
+ "'pvpython $(vtk_folder)/$(simulation.id).py'" | |
end | |
end | |
t@@ -1098,14 +1102,16 @@ function render(simulation::Simulation; pvpython::Stri… | |
-loop 0 $(simulation.id)/$(simulation.id).'*'.png | |
$(simulation.id)/$(simulation.id).gif`) | |
if reverse | |
- run(`$convert -trim +repage -delay 10 -transparent-color w… | |
+ run(`$convert -trim +repage -delay 10 | |
+ -transparent-color white | |
-loop 0 -reverse | |
$(simulation.id)/$(simulation.id).'*'.png | |
$(simulation.id)/$(simulation.id)-reverse.gif`) | |
end | |
catch return_signal | |
if isa(return_signal, Base.UVError) | |
- info("Skipping gif merge since `$convert` was not found.") | |
+ Compat.@info "Skipping gif merge since `$convert` " * | |
+ "was not found." | |
end | |
end | |
end | |
t@@ -1194,7 +1200,7 @@ function plotGrainSizeDistribution(simulation::Simulatio… | |
gnuplotscript = Base.Filesystem.tempname() | |
#if maximum(diameters) ≈ minimum(diameters) | |
- #info("Overriding `nbins = $nbins` -> `nbins = 1`.") | |
+ #Compat.@info "Overriding `nbins = $nbins` -> `nbins = 1`." | |
#nbins = 1 | |
#end | |
t@@ -1227,7 +1233,7 @@ function plotGrainSizeDistribution(simulation::Simulatio… | |
end | |
if verbose | |
- info(filename) | |
+ Compat.@info filename | |
end | |
end | |
t@@ -1451,7 +1457,7 @@ function plotGrains(sim::Simulation; | |
end | |
if verbose | |
- info(filename) | |
+ Compat.@info filename | |
end | |
if show_figure | |
diff --git a/src/ocean.jl b/src/ocean.jl | |
t@@ -1,18 +1,20 @@ | |
+import Compat | |
+using Compat.Test | |
+using Compat.LinearAlgebra | |
+ | |
hasNetCDF = false | |
if typeof(Pkg.installed("NetCDF")) == VersionNumber | |
import NetCDF | |
hasNetCDF = true | |
else | |
if !hasNetCDF | |
- warn("Package NetCDF not found. " * | |
+ Compat.@warn "Package NetCDF not found. " * | |
"Ocean/atmosphere grid read not supported. " * | |
"Please install NetCDF and its " * | |
- "requirements with `Pkg.add(\"NetCDF\")`.") | |
+ "requirements with `Pkg.add(\"NetCDF\")`." | |
end | |
end | |
-using Compat.Test | |
- | |
export createEmptyOcean | |
"Returns empty ocean type for initialization purposes." | |
function createEmptyOcean() | |
t@@ -55,9 +57,10 @@ function readOceanNetCDF(velocity_file::String, grid_file::… | |
regular_grid::Bool=false) | |
if !hasNetCDF | |
- warn("Package NetCDF not found. Ocean/atmosphere grid read not support… | |
+ Compat.@warn "Package NetCDF not found. " * | |
+ "Ocean/atmosphere grid read not supported. " * | |
"Please install NetCDF and its " * | |
- "requirements with `Pkg.add(\"NetCDF\")`.") | |
+ "requirements with `Pkg.add(\"NetCDF\")`." | |
else | |
time, u, v, h, e, zl, zi = readOceanStateNetCDF(velocity_file) | |
t@@ -118,9 +121,10 @@ layer thicknesses, interface heights, and vertical coordi… | |
function readOceanStateNetCDF(filename::String) | |
if !hasNetCDF | |
- warn("Package NetCDF not found. Ocean/atmosphere grid read not support… | |
+ Compat.@warn "Package NetCDF not found. " * | |
+ "Ocean/atmosphere grid read not supported. " * | |
"Please install NetCDF and its " * | |
- "requirements with `Pkg.add(\"NetCDF\")`.") | |
+ "requirements with `Pkg.add(\"NetCDF\")`." | |
else | |
if !isfile(filename) | |
t@@ -158,9 +162,10 @@ located in the simulation `INPUT/` subdirectory. | |
function readOceanGridNetCDF(filename::String) | |
if !hasNetCDF | |
- warn("Package NetCDF not found. Ocean/atmosphere grid read not support… | |
+ Compat.@warn "Package NetCDF not found. " * | |
+ "Ocean/atmosphere grid read not supported. " * | |
"Please install NetCDF and its " * | |
- "requirements with `Pkg.add(\"NetCDF\")`.") | |
+ "requirements with `Pkg.add(\"NetCDF\")`." | |
else | |
if !isfile(filename) | |
t@@ -222,8 +227,8 @@ function interpolateOceanState(ocean::Ocean, t::Float64) | |
if length(ocean.time) == 1 | |
return ocean.u, ocean.v, ocean.h, ocean.e | |
elseif t < ocean.time[1] || t > ocean.time[end] | |
- error("selected time (t = $(t)) is outside the range of time steps in | |
- the ocean data") | |
+ error("selected time (t = $(t)) is outside the range of time steps " * | |
+ "in the ocean data") | |
end | |
i = 1 | |
t@@ -284,17 +289,23 @@ function createRegularOceanGrid(n::Vector{Int}, | |
bc_east::Integer = 1, | |
bc_north::Integer = 1) | |
- xq = repmat(linspace(origo[1], origo[1] + L[1], n[1] + 1), 1, n[2] + 1) | |
- yq = repmat(linspace(origo[2], origo[2] + L[2], n[2] + 1)', n[1] + 1, 1) | |
+ xq = repeat(Compat.range(origo[1], stop=origo[1] + L[1], length=n[1] + 1), | |
+ 1, n[2] + 1) | |
+ yq = repeat(Compat.range(origo[2], stop=origo[2] + L[2], length=n[2] + 1)', | |
+ n[1] + 1, 1) | |
dx = L./n | |
- xh = repmat(linspace(origo[1] + .5*dx[1], origo[1] + L[1] - .5*dx[1], | |
- n[1]), 1, n[2]) | |
- yh = repmat(linspace(origo[2] + .5*dx[2], origo[2] + L[2] - .5*dx[2], | |
- n[2])', n[1], 1) | |
- | |
- zl = -linspace(.5*dx[3], L[3] - .5*dx[3], n[3]) | |
- zi = -linspace(0., L[3], n[3] + 1) | |
+ xh = repeat(Compat.range(origo[1] + .5*dx[1], | |
+ stop=origo[1] + L[1] - .5*dx[1], | |
+ length=n[1]), | |
+ 1, n[2]) | |
+ yh = repeat(Compat.range(origo[2] + .5*dx[2], | |
+ stop=origo[2] + L[2] - .5*dx[2], | |
+ length=n[2])', | |
+ n[1], 1) | |
+ | |
+ 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) | |
u = zeros(n[1] + 1, n[2] + 1, n[3], length(time)) | |
v = zeros(n[1] + 1, n[2] + 1, n[3], length(time)) | |
diff --git a/src/packing.jl b/src/packing.jl | |
t@@ -1,4 +1,6 @@ | |
## Functions for creating grain packings | |
+import Compat | |
+using Compat.LinearAlgebra | |
export regularPacking! | |
""" | |
t@@ -42,7 +44,7 @@ function regularPacking!(simulation::Simulation, | |
r_rand = 0. | |
pos = zeros(2) | |
h = .5 # disc tickness | |
- srand(seed) | |
+ Compat.srand(seed) | |
if tiling == "square" | |
dx = r_max * 2. * (1. + padding_factor) # cell size | |
t@@ -176,7 +178,7 @@ function irregularPacking!(simulation::Simulation; | |
seed::Integer=1, | |
plot_during_packing::Bool=false, | |
verbose::Bool=true) | |
- srand(seed) | |
+ Compat.srand(seed) | |
active_list = Int[] # list of points to originate search from | |
i = 0 | |
t@@ -346,7 +348,7 @@ function irregularPacking!(simulation::Simulation; | |
end # end while !isempty(active_list) | |
if verbose | |
- info("Generated $(length(simulation.grains) - np_init) points") | |
+ Compat.@info "Generated $(length(simulation.grains) - np_init) points" | |
end | |
end | |
t@@ -361,16 +363,16 @@ function rasterPacking!(sim::Simulation, | |
verbose::Bool=true) | |
r_rand = 0. | |
- const h = .5 # disc tickness | |
- const dx = r_max * 2. * (1. + padding_factor) # cell size | |
- const dx_padding = r_max * 2. * padding_factor | |
- srand(seed) | |
+ h = .5 # disc tickness | |
+ dx = r_max * 2. * (1. + padding_factor) # cell size | |
+ dx_padding = r_max * 2. * padding_factor | |
+ Compat.srand(seed) | |
- const np_init = length(sim.grains) | |
+ np_init = length(sim.grains) | |
# Generate a grid spanning the entire domain, with cell width corresponding | |
# to the largest grain to be inserted | |
- const occupied = rasterMap(sim, dx) | |
+ occupied = rasterMap(sim, dx) | |
# Add grains in unoccupied places | |
pos = zeros(2) | |
t@@ -398,7 +400,7 @@ function rasterPacking!(sim::Simulation, | |
end | |
end | |
if verbose | |
- info("Generated $(length(sim.grains) - np_init) points") | |
+ Compat.@info "Generated $(length(sim.grains) - np_init) points" | |
end | |
end | |
t@@ -433,7 +435,7 @@ function rasterMap(sim::Simulation, dx::Real) | |
L = [se[1] - sw[1], nw[2] - sw[2]] | |
origo = [sw[1], sw[2]] | |
end | |
- const dims = floor.(L./dx) | |
+ dims = floor.(L./dx) | |
occupied = zeros(Bool, dims[1], dims[2]) | |
# Loop over existing grains and mark their extent in the `occupied` array | |
t@@ -441,7 +443,7 @@ function rasterMap(sim::Simulation, dx::Real) | |
min_i = 0; min_j = 0 | |
max_i = 0; max_j = 0 | |
cell_mid_point = zeros(2) | |
- const dist = sqrt(2.0*(dx/2.0)^2.) | |
+ dist = sqrt(2.0*(dx/2.0)^2.) | |
for grain in sim.grains | |
# Find center position in `occupied` grid | |
diff --git a/src/simulation.jl b/src/simulation.jl | |
t@@ -1,3 +1,4 @@ | |
+import Compat | |
using Compat.Printf | |
## General simulation functions | |
t@@ -111,8 +112,8 @@ function run!(simulation::Simulation; | |
if simulation.ocean.xq ≈ simulation.atmosphere.xq && | |
simulation.ocean.yq ≈ simulation.atmosphere.yq | |
if verbose | |
- info("identical ocean and atmosphere grids, turning on " * | |
- "optimizations") | |
+ Compat.@info "identical ocean and atmosphere grids, " * | |
+ "turning on grid optimizations" | |
end | |
simulation.atmosphere.collocated_with_ocean_grid = true | |
end | |
t@@ -219,7 +220,7 @@ function addGrain!(simulation::Simulation, | |
push!(simulation.grains, grain) | |
if verbose | |
- info("Added grain $(length(simulation.grains))") | |
+ Compat.@info "Added grain $(length(simulation.grains))" | |
end | |
nothing | |
end | |
t@@ -239,7 +240,7 @@ function addWall!(simulation::Simulation, | |
push!(simulation.walls, wall) | |
if verbose | |
- info("Added wall $(length(simulation.walls))") | |
+ Compat.@info "Added wall $(length(simulation.walls))" | |
end | |
nothing | |
end | |
diff --git a/src/temporal.jl b/src/temporal.jl | |
t@@ -1,3 +1,5 @@ | |
+import Compat | |
+ | |
export setTotalTime! | |
""" | |
setTotalTime!(simulation::Simulation, t::Float64) | |
t@@ -54,7 +56,7 @@ this value is zero or negative, no output files will be writ… | |
function setOutputFileInterval!(simulation::Simulation, t::Float64; | |
verbose=true) | |
if t <= 0.0 && verbose | |
- info("No output files will be written") | |
+ Compat.@info "No output files will be written" | |
end | |
simulation.file_time_step = t | |
nothing | |
t@@ -72,12 +74,12 @@ export checkTimeParameters | |
function checkTimeParameters(simulation::Simulation; single_step::Bool=false) | |
if !single_step && (simulation.time_total <= 0.0 || simulation.time_total … | |
simulation.time) | |
- error("Total time should be positive and larger than current time.\n", | |
- " t_total = ", simulation.time_total, " s, t = ", simulation.time… | |
- " s") | |
+ error("Total time should be positive and larger than current " * | |
+ "time.\n t_total = $(simulation.time_total) s, " * | |
+ "t = $(simulation.time) s") | |
end | |
if simulation.time_step <= 0.0 | |
- error("Time step should be positive (t = ", simulation.time_step, ")") | |
+ error("Time step should be positive (t = $(simulation.time_step))") | |
end | |
nothing | |
end | |
t@@ -157,11 +159,11 @@ function setTimeStep!(simulation::Simulation; | |
simulation.time_step = epsilon/(sqrt(maximum([k_n_max, k_t_max])/m_min)) | |
if simulation.time_step <= 1.0e-20 | |
- error("Time step too small or negative (", simulation.time_step, " s)") | |
+ error("Time step too small or negative ($(simulation.time_step) s)") | |
end | |
if verbose | |
- info("Time step length t=", simulation.time_step, " s") | |
+ Compat.@info "Time step length t=$(simulation.time_step) s" | |
end | |
nothing | |
end | |
diff --git a/src/temporal_integration.jl b/src/temporal_integration.jl | |
t@@ -1,3 +1,5 @@ | |
+import Compat | |
+ | |
export updateGrainKinematics! | |
""" | |
updateGrainKinematics!(simulation::Simulation[, | |
diff --git a/src/util.jl b/src/util.jl | |
t@@ -18,7 +18,7 @@ Returns one or more random numbers from a power-law probabil… | |
max_val::Number = 1.) | |
val = ((max_val^(distribution_power + 1.) - | |
- min_val^(distribution_power + 1.)) * rand(dims) .+ | |
+ min_val^(distribution_power + 1.)) * rand(Float64, dims) .+ | |
min_val^(distribution_power + 1.)) .^ | |
(1. / (distribution_power + 1.)) | |
diff --git a/src/wall.jl b/src/wall.jl | |
t@@ -1,5 +1,7 @@ | |
## Manage dynamic walls in the model | |
+import Compat | |
+ | |
export addWallLinearFrictionless! | |
""" | |
function addWallLinear!(simulation, normal, pos[, bc, mass, thickness, | |
t@@ -84,7 +86,7 @@ function addWallLinearFrictionless!(simulation::Simulation, | |
# Check input values | |
if length(normal) != 2 | |
- error("Wall normal must be a two-element array (normal = ", | |
+ error("Wall normal must be a two-element array (normal = " * | |
"$normal)") | |
end | |
t@@ -102,23 +104,23 @@ function addWallLinearFrictionless!(simulation::Simulati… | |
# if not set, set wall mass to equal the mass of all grains. | |
if mass < 0. | |
if length(simulation.grains) < 1 | |
- error("If wall mass is not specified, walls should be added " * | |
- "after grains have been added to the simulation.") | |
+ error("If wall mass is not specified, walls should be " * | |
+ "added after grains have been added to the simulation.") | |
end | |
mass = 0. | |
for grain in simulation.grains | |
mass += grain.mass | |
end | |
if verbose | |
- info("Setting wall mass to total grain mass: $mass kg") | |
+ Compat.@info "Setting wall mass to total grain mass: $mass kg" | |
end | |
end | |
# if not set, set wall thickness to equal largest grain thickness | |
if thickness < 0. | |
if length(simulation.grains) < 1 | |
- error("If wall thickness is not specified, walls should be added "… | |
- "after grains have been added to the simulation.") | |
+ error("If wall thickness is not specified, walls should " * | |
+ "be added after grains have been added to the simulation.") | |
end | |
thickness = -Inf | |
for grain in simulation.grains | |
t@@ -127,7 +129,7 @@ function addWallLinearFrictionless!(simulation::Simulation, | |
end | |
end | |
if verbose | |
- info("Setting wall thickness to max grain thickness: $thickness m") | |
+ Compat.@info "Setting wall thickness to max grain thickness: $thic… | |
end | |
end | |
t@@ -219,7 +221,7 @@ function getWallNormalStress(sim::Simulation; | |
elseif stress_type == "effective" | |
return sim.walls[wall_index].force / getWallSurfaceArea(sim, wall_inde… | |
else | |
- error("stress_type not understood, should be 'effective' or 'defined'"… | |
- " but is '$stress_type'.") | |
+ error("stress_type not understood, " * | |
+ "should be 'effective' or 'defined' but is '$stress_type'.") | |
end | |
end | |
diff --git a/test/atmosphere.jl b/test/atmosphere.jl | |
t@@ -3,9 +3,9 @@ | |
# Check if atmosphere-specific functions and grid operations are functioning | |
# correctly | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
-info("Testing regular grid generation") | |
+Compat.@info "Testing regular grid generation" | |
sim = Granular.createSimulation() | |
sim.atmosphere = Granular.createRegularAtmosphereGrid([6, 6, 6], [1., 1., 1.]) | |
@test size(sim.atmosphere.xq) == (7, 7) | |
t@@ -23,7 +23,7 @@ sim.atmosphere = Granular.createRegularAtmosphereGrid([6, 6,… | |
@test sim.atmosphere.u ≈ zeros(7, 7, 6, 1) | |
@test sim.atmosphere.v ≈ zeros(7, 7, 6, 1) | |
-info("Testing velocity drag interaction (static atmosphere)") | |
+Compat.@info "Testing velocity drag interaction (static atmosphere)" | |
Granular.addGrainCylindrical!(sim, [.5, .5], .25, .1) | |
Granular.setTotalTime!(sim, 5.) | |
Granular.setTimeStep!(sim) | |
t@@ -39,7 +39,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy… | |
@test sim.grains[1].atmosphere_stress[1] < 0. | |
@test sim.grains[1].atmosphere_stress[2] ≈ 0. | |
-info("Testing velocity drag interaction (static ice floe)") | |
+Compat.@info "Testing velocity drag interaction (static ice floe)" | |
sim = deepcopy(sim_init) | |
sim.atmosphere.v[:, :, 1, 1] = 0.1 | |
E_kin_lin_init = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -52,7 +52,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy… | |
@test sim.grains[1].atmosphere_stress[1] ≈ 0. | |
@test sim.grains[1].atmosphere_stress[2] > 0. | |
-info("Testing vortex interaction (static atmosphere)") | |
+Compat.@info "Testing vortex interaction (static atmosphere)" | |
sim = deepcopy(sim_init) | |
sim.grains[1].ang_vel = 0.1 | |
E_kin_lin_init = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -65,7 +65,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy… | |
@test sim.grains[1].ang_pos > 0. # check angular position orientation | |
@test E_kin_lin_init ≈ E_kin_lin_final # no linear velocity gained | |
-info("Testing vortex interaction (static ice floe)") | |
+Compat.@info "Testing vortex interaction (static ice floe)" | |
sim = deepcopy(sim_init) | |
sim.atmosphere = Granular.createRegularAtmosphereGrid([1, 1, 1], [1., 1., 1.]) | |
sim.grains[1].lin_pos[1] = 0.5 | |
diff --git a/test/cohesion.jl b/test/cohesion.jl | |
t@@ -5,7 +5,7 @@ import Granular | |
# Check for conservation of kinetic energy (=momentum) during a normal collisi… | |
# between two ice cylindrical grains | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
verbose=false | |
t@@ -16,14 +16,14 @@ sim_init.grains[1].youngs_modulus = 1e-5 # repulsion is n… | |
sim_init.grains[2].youngs_modulus = 1e-5 # repulsion is negligible | |
Granular.setTimeStep!(sim_init, verbose=verbose) | |
-info("# Check contact age scheme") | |
+Compat.@info "# Check contact age scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTotalTime!(sim, 10.) | |
sim.time_step = 1. | |
Granular.run!(sim, verbose=verbose) | |
@test sim.grains[1].contact_age[1] ≈ sim.time | |
-info("# Check if bonds add tensile strength") | |
+Compat.@info "# Check if bonds add tensile strength" | |
sim = Granular.createSimulation(id="cohesion") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., tensile_strength=500e3) | |
Granular.addGrainCylindrical!(sim, [20.1, 0.], 10., 1., tensile_strength=500e3) | |
t@@ -38,7 +38,7 @@ Granular.run!(sim, verbose=verbose) | |
@test sim.grains[1].ang_vel ≈ 0. | |
@test sim.grains[2].ang_vel ≈ 0. | |
-info("# Add shear strength and test bending resistance (one grain rotating)") | |
+Compat.@info "# Add shear strength and test bending resistance (one grain rota… | |
sim = Granular.createSimulation(id="cohesion") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10.1, 1., tensile_strength=500e3, | |
shear_strength=500e3) | |
t@@ -65,7 +65,7 @@ E_therm_final = Granular.totalGrainThermalEnergy(sim) | |
@test E_kin_lin_init ≈ E_kin_lin_final | |
@test E_kin_rot_init > E_kin_rot_final + E_therm_final | |
-info("# Add shear strength and test bending resistance (one grain rotating)") | |
+Compat.@info "# Add shear strength and test bending resistance (one grain rota… | |
sim = Granular.createSimulation(id="cohesion") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10.1, 1., tensile_strength=500e3, | |
shear_strength=500e3) | |
t@@ -92,7 +92,7 @@ E_therm_final = Granular.totalGrainThermalEnergy(sim) | |
@test E_kin_lin_init ≈ E_kin_lin_final | |
@test E_kin_rot_init > E_kin_rot_final + E_therm_final | |
-info("# Add shear strength and test bending resistance (both grains rotating)") | |
+Compat.@info "# Add shear strength and test bending resistance (both grains ro… | |
sim = Granular.createSimulation(id="cohesion") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10.0000001, 1., tensile_strength=… | |
shear_strength=500e3) | |
t@@ -120,7 +120,7 @@ E_therm_final = Granular.totalGrainThermalEnergy(sim) | |
@test E_kin_lin_init ≈ E_kin_lin_final | |
@test E_kin_rot_init > E_kin_rot_final + E_therm_final | |
-info("# Break bond through bending I") | |
+Compat.@info "# Break bond through bending I" | |
sim = Granular.createSimulation(id="cohesion") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10.0000001, 1., tensile_strength=… | |
shear_strength=500e3) | |
t@@ -149,7 +149,7 @@ E_therm_final = Granular.totalGrainThermalEnergy(sim) | |
@test sim.grains[1].n_contacts == 0 | |
@test sim.grains[2].n_contacts == 0 | |
-info("# Break bond through bending II") | |
+Compat.@info "# Break bond through bending II" | |
sim = Granular.createSimulation(id="cohesion") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10.1, 1., tensile_strength=500e3, | |
shear_strength=50e3) | |
diff --git a/test/collision-2floes-normal.jl b/test/collision-2floes-normal.jl | |
t@@ -3,11 +3,11 @@ | |
# Check for conservation of kinetic energy (=momentum) during a normal collisi… | |
# between two ice cylindrical grains | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
verbose=false | |
-info("# One ice floe fixed") | |
+Compat.@info "# One ice floe fixed" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
Granular.addGrainCylindrical!(sim, [20.05, 0.], 10., 1., verbose=verbose) | |
t@@ -23,10 +23,10 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEnerg… | |
Granular.setTotalTime!(sim, 10.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.2 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -35,11 +35,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.02 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -48,11 +48,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.01 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -62,7 +62,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("# Ice floes free to move") | |
+Compat.@info "# Ice floes free to move" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
t@@ -78,10 +78,10 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEnerg… | |
Granular.setTotalTime!(sim, 10.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.2 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -90,11 +90,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.02 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -103,11 +103,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.01 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -117,8 +117,8 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("# Adding contact-normal viscosity") | |
-info("# One ice floe fixed") | |
+Compat.@info "# Adding contact-normal viscosity" | |
+Compat.@info "# One ice floe fixed" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
Granular.addGrainCylindrical!(sim, [20.05, 0.], 10., 1., verbose=verbose) | |
t@@ -137,11 +137,11 @@ Granular.setTotalTime!(sim, 10.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.02 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -150,11 +150,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.01 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -164,7 +164,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("# Ice floes free to move") | |
+Compat.@info "# Ice floes free to move" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
t@@ -182,11 +182,11 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEne… | |
Granular.setTotalTime!(sim, 10.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.02 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -195,11 +195,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.01 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -209,7 +209,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("# Testing allow_*_acc for fixed grains") | |
+Compat.@info "# Testing allow_*_acc for fixed grains" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
Granular.addGrainCylindrical!(sim, [20.05, 0.], 10., 1., verbose=verbose) | |
t@@ -225,7 +225,7 @@ Granular.setTimeStep!(sim, epsilon=0.07) | |
sim_init = deepcopy(sim) | |
sim.grains[2].allow_y_acc = true # should not influence result | |
-info("Two-term Taylor scheme: allow_y_acc") | |
+Compat.@info "Two-term Taylor scheme: allow_y_acc" | |
sim = deepcopy(sim_init) | |
sim.grains[2].allow_y_acc = true # should not influence result | |
tol = 0.2 | |
t@@ -237,7 +237,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
@test sim.grains[2].lin_pos ≈ grain2_pos_init | |
-info("Two-term Taylor scheme: allow_x_acc") | |
+Compat.@info "Two-term Taylor scheme: allow_x_acc" | |
sim = deepcopy(sim_init) | |
sim.grains[2].allow_x_acc = true # should influence result | |
tol = 0.2 | |
t@@ -249,7 +249,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
@test sim.grains[2].lin_pos[1] > grain2_pos_init[1] | |
-info("Three-term Taylor scheme: allow_y_acc") | |
+Compat.@info "Three-term Taylor scheme: allow_y_acc" | |
sim = deepcopy(sim_init) | |
tol = 0.02 | |
sim.grains[2].allow_y_acc = true # should influence result | |
t@@ -261,7 +261,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
@test sim.grains[2].lin_pos ≈ grain2_pos_init | |
-info("Three-term Taylor scheme: allow_x_acc") | |
+Compat.@info "Three-term Taylor scheme: allow_x_acc" | |
sim = deepcopy(sim_init) | |
tol = 0.02 | |
sim.grains[2].allow_x_acc = true # should influence result | |
t@@ -274,18 +274,18 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test sim.grains[2].lin_pos[1] > grain2_pos_init[1] | |
#= | |
-info("# Test stability under collision with fixed particles different allow_*_… | |
+Compat.@info "# Test stability under collision with fixed particles different … | |
r = 10. | |
i = 1 | |
for tensile_strength in [0.0, 200e3] | |
- for angle in linspace(0, 2π, 7) | |
+ for angle in Compat.range(0, 2π, 7) | |
for allow_x_acc in [false, true] | |
for allow_y_acc in [false, true] | |
- info("Test $i") | |
- info("Contact angle: $angle rad") | |
- info("allow_x_acc = $allow_x_acc") | |
- info("allow_y_acc = $allow_y_acc") | |
- info("tensile_strength = $tensile_strength Pa") | |
+ Compat.@info "Test $i" | |
+ Compat.@info "Contact angle: $angle rad" | |
+ Compat.@info "allow_x_acc = $allow_x_acc" | |
+ Compat.@info "allow_y_acc = $allow_y_acc" | |
+ Compat.@info "tensile_strength = $tensile_strength Pa" | |
sim = Granular.createSimulation() | |
sim.id = "test-$i-$allow_x_acc-$allow_y_acc-C=$tensile_strengt… | |
t@@ -314,7 +314,7 @@ for tensile_strength in [0.0, 200e3] | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
sim_init = deepcopy(sim) | |
- info("TY3") | |
+ Compat.@info "TY3" | |
sim = deepcopy(sim_init) | |
tol = 0.02 | |
Granular.setOutputFileInterval!(sim, 1.0) | |
diff --git a/test/collision-2floes-oblique.jl b/test/collision-2floes-oblique.jl | |
t@@ -3,12 +3,12 @@ | |
# Check for conservation of kinetic energy (=momentum) during a normal collisi… | |
# between two ice cylindrical grains | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
verbose=false | |
-info("## Contact-normal elasticity only") | |
-info("# One ice floe fixed") | |
+Compat.@info "## Contact-normal elasticity only" | |
+Compat.@info "# One ice floe fixed" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 10.], 10., 1., verbose=verbose) | |
Granular.addGrainCylindrical!(sim, [19., 0.], 10., 1., verbose=verbose) | |
t@@ -27,10 +27,10 @@ Granular.setTotalTime!(sim, 30.0) | |
#sim.file_time_step = 1. | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.1 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -43,11 +43,11 @@ println(E_thermal_final) | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.01 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -57,11 +57,11 @@ E_thermal_final = Granular.totalGrainThermalEnergy(sim) | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.01 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", verbose=ve… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -70,7 +70,7 @@ E_thermal_final = Granular.totalGrainThermalEnergy(sim) | |
@test E_kin_lin_init ≈ E_kin_lin_final+E_thermal_final atol=E_kin_lin_init*t… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("# Ice floes free to move") | |
+Compat.@info "# Ice floes free to move" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 10.], 10., 1., verbose=verbose) | |
t@@ -88,10 +88,10 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEnerg… | |
Granular.setTotalTime!(sim, 30.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.1 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -100,11 +100,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.01 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -113,11 +113,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.01 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -127,7 +127,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("## Contact-normal elasticity and tangential viscosity and friction") | |
+Compat.@info "## Contact-normal elasticity and tangential viscosity and fricti… | |
Granular.setTotalTime!(sim, 30.0) | |
sim_init.grains[1].contact_viscosity_tangential = 1e6 | |
sim_init.grains[2].contact_viscosity_tangential = 1e6 | |
t@@ -136,10 +136,10 @@ sim_init.grains[2].contact_dynamic_friction = 1e2 # no … | |
sim_init.grains[2].fixed = true | |
sim = deepcopy(sim_init) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.1 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", | |
verbose=verbose) | |
t@@ -151,12 +151,12 @@ E_kin_lin_final = Granular.totalGrainKineticTranslationa… | |
E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy(sim) | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("mu_d = 0.") | |
+Compat.@info "mu_d = 0." | |
sim = deepcopy(sim_init) | |
sim.grains[1].contact_dynamic_friction = 0. | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.01 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
E_kin_lin_init = Granular.totalGrainKineticTranslationalEnergy(sim) | |
E_kin_rot_init = Granular.totalGrainKineticRotationalEnergy(sim) | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
t@@ -170,11 +170,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_lin_init ≈ E_kin_lin_final atol=E_kin_lin_init*tol | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.1 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", | |
verbose=verbose) | |
t@@ -187,11 +187,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.09 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -203,7 +203,7 @@ E_kin_lin_final = Granular.totalGrainKineticTranslationalE… | |
E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy(sim) | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("# Ice floes free to move") | |
+Compat.@info "# Ice floes free to move" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 10.], 10., 1., verbose=verbose) | |
t@@ -221,10 +221,10 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEne… | |
Granular.setTotalTime!(sim, 30.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.1 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", | |
verbose=verbose) | |
t@@ -236,11 +236,11 @@ E_kin_lin_final = Granular.totalGrainKineticTranslationa… | |
E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy(sim) | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.04 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", | |
verbose=verbose) | |
t@@ -249,11 +249,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.04 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -266,7 +266,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("# Ice floes free to move, mirrored") | |
+Compat.@info "# Ice floes free to move, mirrored" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
t@@ -284,10 +284,10 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEne… | |
Granular.setTotalTime!(sim, 30.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.1 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", | |
verbose=verbose) | |
t@@ -299,11 +299,11 @@ E_kin_lin_final = Granular.totalGrainKineticTranslationa… | |
E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy(sim) | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.04 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", | |
verbose=verbose) | |
t@@ -312,11 +312,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.04 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -329,7 +329,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("# Ice floes free to move, mirrored #2") | |
+Compat.@info "# Ice floes free to move, mirrored #2" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
t@@ -345,10 +345,10 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEne… | |
Granular.setTotalTime!(sim, 30.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.1 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", | |
verbose=verbose) | |
t@@ -360,11 +360,11 @@ E_kin_lin_final = Granular.totalGrainKineticTranslationa… | |
E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy(sim) | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.04 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", | |
verbose=verbose) | |
t@@ -373,11 +373,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.04 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -390,7 +390,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("# Tangential elasticity, no tangential viscosity, no Coulomb slip") | |
+Compat.@info "# Tangential elasticity, no tangential viscosity, no Coulomb sli… | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
t@@ -414,10 +414,10 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEne… | |
Granular.setTotalTime!(sim, 30.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.1 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", | |
verbose=verbose) | |
t@@ -429,11 +429,11 @@ E_kin_lin_final = Granular.totalGrainKineticTranslationa… | |
E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy(sim) | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.04 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", | |
verbose=verbose) | |
t@@ -442,11 +442,11 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.04 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -459,7 +459,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_lin_init+E_kin_rot_init ≈ E_kin_lin_final+E_kin_rot_final atol=E… | |
-info("# Tangential elasticity, no tangential viscosity, Coulomb slip") | |
+Compat.@info "# Tangential elasticity, no tangential viscosity, Coulomb slip" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
t@@ -483,11 +483,11 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEne… | |
Granular.setTotalTime!(sim, 30.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.02 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", | |
verbose=verbose) | |
t@@ -495,11 +495,11 @@ E_kin_lin_final = Granular.totalGrainKineticTranslationa… | |
E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy(sim) | |
@test E_kin_lin_init+E_kin_rot_init > E_kin_lin_final+E_kin_rot_final | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.03 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -512,7 +512,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_lin_init+E_kin_rot_init > E_kin_lin_final+E_kin_rot_final | |
-info("# Tangential elasticity, tangential viscosity, no Coulomb slip") | |
+Compat.@info "# Tangential elasticity, tangential viscosity, no Coulomb slip" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
t@@ -536,11 +536,11 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEne… | |
Granular.setTotalTime!(sim, 30.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.02 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", | |
verbose=verbose) | |
t@@ -548,11 +548,11 @@ E_kin_lin_final = Granular.totalGrainKineticTranslationa… | |
E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy(sim) | |
@test E_kin_lin_init+E_kin_rot_init > E_kin_lin_final+E_kin_rot_final | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.03 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -565,7 +565,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_lin_init+E_kin_rot_init > E_kin_lin_final+E_kin_rot_final | |
-info("# Tangential elasticity, tangential viscosity, Coulomb slip") | |
+Compat.@info "# Tangential elasticity, tangential viscosity, Coulomb slip" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
t@@ -589,11 +589,11 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEne… | |
Granular.setTotalTime!(sim, 30.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.02 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", | |
verbose=verbose) | |
t@@ -601,11 +601,11 @@ E_kin_lin_final = Granular.totalGrainKineticTranslationa… | |
E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy(sim) | |
@test E_kin_lin_init+E_kin_rot_init > E_kin_lin_final+E_kin_rot_final | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.03 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
diff --git a/test/collision-5floes-normal.jl b/test/collision-5floes-normal.jl | |
t@@ -1,13 +1,14 @@ | |
#!/usr/bin/env julia | |
+using Compat.LinearAlgebra | |
# Check for conservation of kinetic energy (=momentum) during a normal collisi… | |
# between two ice cylindrical grains | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
verbose=false | |
-info("# One ice floe fixed") | |
+Compat.@info "# One ice floe fixed" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
Granular.addGrainCylindrical!(sim, [20.05, 0.], 10., 1., verbose=verbose) | |
t@@ -29,10 +30,10 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEnerg… | |
Granular.setTotalTime!(sim, 10.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.2 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -41,16 +42,16 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
@test 0. < norm(sim.grains[1].lin_vel) | |
for i=2:5 | |
- info("testing ice floe $i") | |
+ Compat.@info "testing ice floe $i" | |
@test 0. ≈ norm(sim.grains[i].lin_vel) | |
end | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.02 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -59,16 +60,16 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
@test 0. < norm(sim.grains[1].lin_vel) | |
for i=2:5 | |
- info("testing ice floe $i") | |
+ Compat.@info "testing ice floe $i" | |
@test 0. ≈ norm(sim.grains[i].lin_vel) | |
end | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.01 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -78,12 +79,12 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
@test 0. < norm(sim.grains[1].lin_vel) | |
for i=2:5 | |
- info("testing ice floe $i") | |
+ Compat.@info "testing ice floe $i" | |
@test 0. ≈ norm(sim.grains[i].lin_vel) | |
end | |
-info("# Ice floes free to move") | |
+Compat.@info "# Ice floes free to move" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
t@@ -102,10 +103,10 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEne… | |
Granular.setTotalTime!(sim, 40.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.2 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -113,16 +114,16 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_lin_init ≈ E_kin_lin_final atol=E_kin_lin_init*tol | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
for i=1:5 | |
- info("testing ice floe $i") | |
+ Compat.@info "testing ice floe $i" | |
@test 0. < norm(sim.grains[i].lin_vel) | |
end | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.02 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -130,16 +131,16 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_lin_init ≈ E_kin_lin_final atol=E_kin_lin_init*tol | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
for i=1:5 | |
- info("testing ice floe $i") | |
+ Compat.@info "testing ice floe $i" | |
@test 0. < norm(sim.grains[i].lin_vel) | |
end | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.01 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -148,13 +149,13 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_lin_init ≈ E_kin_lin_final atol=E_kin_lin_init*tol | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
for i=1:5 | |
- info("testing ice floe $i") | |
+ Compat.@info "testing ice floe $i" | |
@test 0. < norm(sim.grains[i].lin_vel) | |
end | |
-info("# Adding contact-normal viscosity") | |
-info("# One ice floe fixed") | |
+Compat.@info "# Adding contact-normal viscosity" | |
+Compat.@info "# One ice floe fixed" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
Granular.addGrainCylindrical!(sim, [20.05, 0.], 10., 1., verbose=verbose) | |
t@@ -182,11 +183,11 @@ Granular.setTotalTime!(sim, 10.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.02 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -195,16 +196,16 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
@test 0. < norm(sim.grains[1].lin_vel) | |
for i=2:5 | |
- info("testing ice floe $i") | |
+ Compat.@info "testing ice floe $i" | |
@test 0. ≈ norm(sim.grains[i].lin_vel) | |
end | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.01 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -214,12 +215,12 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
@test 0. < norm(sim.grains[1].lin_vel) | |
for i=2:5 | |
- info("testing ice floe $i") | |
+ Compat.@info "testing ice floe $i" | |
@test 0. ≈ norm(sim.grains[i].lin_vel) | |
end | |
-info("# Ice floes free to move") | |
+Compat.@info "# Ice floes free to move" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [0., 0.], 10., 1., verbose=verbose) | |
t@@ -243,11 +244,11 @@ E_kin_rot_init = Granular.totalGrainKineticRotationalEne… | |
Granular.setTotalTime!(sim, 10.0) | |
sim_init = deepcopy(sim) | |
-info("Testing kinetic energy conservation with Two-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Two-term Taylor scheme" | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.007) | |
tol = 0.02 | |
-info("Relative tolerance: $(tol*100.)%") | |
+Compat.@info "Relative tolerance: $(tol*100.)%" | |
Granular.run!(sim, temporal_integration_method="Two-term Taylor", verbose=verb… | |
E_kin_lin_final = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -255,16 +256,16 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEn… | |
@test E_kin_lin_init > E_kin_lin_final | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
for i=1:5 | |
- info("testing ice floe $i") | |
+ Compat.@info "testing ice floe $i" | |
@test 0. < norm(sim.grains[i].lin_vel) | |
end | |
-info("Testing kinetic energy conservation with Three-term Taylor scheme") | |
+Compat.@info "Testing kinetic energy conservation with Three-term Taylor schem… | |
sim = deepcopy(sim_init) | |
Granular.setTimeStep!(sim, epsilon=0.07) | |
tol = 0.01 | |
-info("Relative tolerance: $(tol*100.)% with time step: $(sim.time_step)") | |
+Compat.@info "Relative tolerance: $(tol*100.)% with time step: $(sim.time_step… | |
Granular.run!(sim, temporal_integration_method="Three-term Taylor", | |
verbose=verbose) | |
t@@ -273,6 +274,6 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEner… | |
@test E_kin_lin_init > E_kin_lin_final | |
@test E_kin_rot_init ≈ E_kin_rot_final | |
for i=1:5 | |
- info("testing ice floe $i") | |
+ Compat.@info "testing ice floe $i" | |
@test 0. < norm(sim.grains[i].lin_vel) | |
end | |
diff --git a/test/contact-search-and-geometry.jl b/test/contact-search-and-geom… | |
t@@ -4,9 +4,9 @@ import Granular | |
# Check the contact search and geometry of a two-particle interaction | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
-info("Testing interGrainPositionVector(...) and findOverlap(...)") | |
+Compat.@info "Testing interGrainPositionVector(...) and findOverlap(...)" | |
sim = Granular.createSimulation("test") | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [ 0.01, 0.01], 10., 1., verbose=false) | |
t@@ -19,12 +19,12 @@ overlap_ij = Granular.findOverlap(sim, 1, 2, position_ij) | |
@test -2. ≈ overlap_ij | |
-info("Testing findContactsAllToAll(...)") | |
+Compat.@info "Testing findContactsAllToAll(...)" | |
sim_copy = deepcopy(sim) | |
Granular.findContactsAllToAll!(sim) | |
-info("Testing findContacts(...)") | |
+Compat.@info "Testing findContacts(...)" | |
sim = deepcopy(sim_copy) | |
Granular.findContacts!(sim) | |
t@@ -45,7 +45,7 @@ end | |
@test 1 == sim.grains[1].n_contacts | |
@test 1 == sim.grains[2].n_contacts | |
-info("Testing findContacts(...)") | |
+Compat.@info "Testing findContacts(...)" | |
sim = deepcopy(sim_copy) | |
Granular.findContacts!(sim) | |
t@@ -118,7 +118,7 @@ end | |
@test 0 == sim.grains[1].n_contacts | |
@test 0 == sim.grains[2].n_contacts | |
-info("Testing if interact(...) removes contacts correctly") | |
+Compat.@info "Testing if interact(...) removes contacts correctly" | |
sim = deepcopy(sim_copy) | |
Granular.findContacts!(sim) | |
Granular.interact!(sim) | |
t@@ -140,7 +140,7 @@ end | |
@test 1 == sim.grains[2].n_contacts | |
-info("Testing findContactsGrid(...)") | |
+Compat.@info "Testing findContactsGrid(...)" | |
sim = deepcopy(sim_copy) | |
sim.ocean = Granular.createRegularOceanGrid([4, 4, 2], [80., 80., 2.]) | |
Granular.sortGrainsInGrid!(sim, sim.ocean) | |
t@@ -202,7 +202,7 @@ end | |
@test 0 == sim.grains[1].n_contacts | |
@test 0 == sim.grains[2].n_contacts | |
-info("Testing findContacts(...)") | |
+Compat.@info "Testing findContacts(...)" | |
sim = deepcopy(sim_copy) | |
sim.ocean = Granular.createRegularOceanGrid([4, 4, 2], [80., 80., 2.]) | |
Granular.sortGrainsInGrid!(sim, sim.ocean) | |
t@@ -224,7 +224,7 @@ end | |
@test_throws ErrorException Granular.findContacts!(sim, method="") | |
-info("Testing contact registration with multiple contacts") | |
+Compat.@info "Testing contact registration with multiple contacts" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [2., 2.], 1.01, 1., verbose=false) | |
Granular.addGrainCylindrical!(sim, [4., 2.], 1.01, 1., verbose=false) | |
t@@ -268,7 +268,7 @@ for i=1:9 | |
@test sim.grains[i].n_contacts == 0 | |
end | |
-info("Test contact search in regular square grid (all to all)") | |
+Compat.@info "Test contact search in regular square grid (all to all)" | |
sim = Granular.createSimulation() | |
nx = 60; ny = 50 | |
Granular.regularPacking!(sim, [nx, ny], 1., 1., padding_factor=0, | |
t@@ -285,7 +285,7 @@ for j=2:(ny-1) | |
end | |
end | |
-info("Test contact search in regular square grid (sorting grid)") | |
+Compat.@info "Test contact search in regular square grid (sorting grid)" | |
sim = Granular.createSimulation() | |
nx = 60; ny = 50 | |
Granular.regularPacking!(sim, [nx, ny], 1., 1., padding_factor=0, | |
diff --git a/test/grain.jl b/test/grain.jl | |
t@@ -2,14 +2,14 @@ | |
# Check the basic icefloe functionality | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
-info("Writing simple simulation to VTK file") | |
+Compat.@info "Writing simple simulation to VTK file" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 10., 1., verbose=false) | |
Granular.printGrainInfo(sim.grains[1]) | |
-info("Testing grain value checks ") | |
+Compat.@info "Testing grain value checks " | |
@test_throws ErrorException Granular.addGrainCylindrical!(sim, [.1, .1, .1], | |
10., 1.) | |
@test_throws ErrorException Granular.addGrainCylindrical!(sim, [.1, .1], | |
t@@ -24,7 +24,7 @@ info("Testing grain value checks ") | |
10., 1., density=-2.) | |
@test_throws ErrorException Granular.disableGrain!(sim, 0) | |
-info("Testing grain comparison ") | |
+Compat.@info "Testing grain comparison " | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 10., 1., verbose=false) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 10., 1., verbose=false) | |
t@@ -35,12 +35,12 @@ try | |
run(`gnuplot --version`) | |
catch return_signal | |
if isa(return_signal, Base.UVError) | |
- warn("Skipping plotting routines: Could not launch gnuplot process") | |
+ Compat.@warn "Skipping plotting routines: Could not launch gnuplot pro… | |
gnuplot = false | |
end | |
end | |
if gnuplot | |
- info("Testing GSD plotting ") | |
+ Compat.@info "Testing GSD plotting " | |
Granular.plotGrainSizeDistribution(sim) | |
@test isfile("test-grain-size-distribution.png") | |
rm("test-grain-size-distribution.png") | |
t@@ -53,7 +53,7 @@ if gnuplot | |
@test_throws ErrorException Granular.plotGrainSizeDistribution(sim, size_t… | |
end | |
-info("Testing external body force routines") | |
+Compat.@info "Testing external body force routines" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 10., 1., verbose=false) | |
Granular.setBodyForce!(sim.grains[1], [1., 2.]) | |
t@@ -61,7 +61,7 @@ Granular.setBodyForce!(sim.grains[1], [1., 2.]) | |
Granular.addBodyForce!(sim.grains[1], [1., 2.]) | |
@test sim.grains[1].external_body_force ≈ [2., 4.] | |
-info("Testing zeroKinematics!()") | |
+Compat.@info "Testing zeroKinematics!()" | |
sim.grains[1].force .= ones(2) | |
sim.grains[1].lin_acc .= ones(2) | |
sim.grains[1].lin_vel .= ones(2) | |
diff --git a/test/grid-boundaries.jl b/test/grid-boundaries.jl | |
t@@ -1,13 +1,13 @@ | |
#!/usr/bin/env julia | |
import Compat | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
verbose=false | |
-info("## Inactive/Periodic BCs") | |
+Compat.@info "## Inactive/Periodic BCs" | |
-info("Testing assignment and reporting of grid boundary conditions") | |
+Compat.@info "Testing assignment and reporting of grid boundary conditions" | |
ocean = Granular.createEmptyOcean() | |
@test ocean.bc_west == 1 | |
t@@ -16,7 +16,7 @@ ocean = Granular.createEmptyOcean() | |
@test ocean.bc_south == 1 | |
if !Compat.Sys.iswindows() | |
- const originalSTDOUT = STDOUT | |
+ const originalSTDOUT = Compat.stdout | |
(out_r, out_w) = redirect_stdout() | |
Granular.reportGridBoundaryConditions(ocean) | |
close(out_w) | |
t@@ -108,7 +108,7 @@ if !Compat.Sys.iswindows() | |
"asdf") | |
end | |
-info("Testing granular interaction across periodic boundaries") | |
+Compat.@info "Testing granular interaction across periodic boundaries" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([5, 5, 2], [1., 1., 1.]) | |
Granular.setGridBoundaryConditions!(sim.ocean, "periodic") | |
t@@ -127,7 +127,7 @@ Granular.findContacts!(sim, method="ocean grid") | |
@test 1 == sim.grains[2].n_contacts | |
-info("Test grain position adjustment across periodic boundaries") | |
+Compat.@info "Test grain position adjustment across periodic boundaries" | |
# do not readjust inside grid, inactive boundaries | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([5, 5, 2], [1., 1., 1.]) | |
t@@ -193,9 +193,9 @@ Granular.addGrainCylindrical!(sim, [0.3, 1.1], 0.11, 0.1, … | |
@test_throws ErrorException Granular.moveGrainsAcrossPeriodicBoundaries!(sim) | |
-info("## Impermeable BCs") | |
+Compat.@info "## Impermeable BCs" | |
-info("Test grain velocity adjustment across impermeable boundaries") | |
+Compat.@info "Test grain velocity adjustment across impermeable boundaries" | |
# do not readjust inside grid, inactive boundaries | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([5, 5, 2], [1., 1., 1.]) | |
diff --git a/test/grid.jl b/test/grid.jl | |
t@@ -5,13 +5,13 @@ import Granular | |
# Check the grid interpolation and sorting functions | |
verbose = false | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
if Granular.hasNetCDF | |
ocean = Granular.readOceanNetCDF("Baltic/00010101.ocean_month.nc", | |
"Baltic/ocean_hgrid.nc") | |
- info("Testing coordinate retrieval functions") | |
+ Compat.@info "Testing coordinate retrieval functions" | |
sw, se, ne, nw = Granular.getCellCornerCoordinates(ocean.xq, ocean.yq, 1, … | |
@test sw ≈ [6., 53.] | |
@test se ≈ [7., 53.] | |
t@@ -19,12 +19,12 @@ if Granular.hasNetCDF | |
@test nw ≈ [6., 54.] | |
@test Granular.getCellCenterCoordinates(ocean.xh, ocean.yh, 1, 1) ≈ [6.5… | |
- info("Testing area-determination methods") | |
+ Compat.@info "Testing area-determination methods" | |
@test Granular.areaOfTriangle([0., 0.], [1., 0.], [0., 1.]) ≈ .5 | |
@test Granular.areaOfTriangle([1., 0.], [0., 1.], [0., 0.]) ≈ .5 | |
@test Granular.areaOfQuadrilateral([1., 0.], [0., 1.], [0., 0.], [1., 1.])… | |
- info("Testing area-based cell content determination") | |
+ Compat.@info "Testing area-based cell content determination" | |
@test Granular.isPointInCell(ocean, 1, 1, [6.5, 53.5], sw, se, ne, nw) == … | |
@test Granular.isPointInCell(ocean, 1, 1, [6.5, 53.5]) == true | |
@test Granular.getNonDimensionalCellCoordinates(ocean, 1, 1, [6.5, 53.5]) … | |
t@@ -45,7 +45,7 @@ if Granular.hasNetCDF | |
x_tilde, _ = Granular.getNonDimensionalCellCoordinates(ocean, 1, 1, [0., 5… | |
@test x_tilde < 0. | |
- info("Testing conformal mapping methods") | |
+ Compat.@info "Testing conformal mapping methods" | |
@test Granular.conformalQuadrilateralCoordinates([0., 0.], | |
[5., 0.], | |
[5., 3.], | |
t@@ -67,7 +67,7 @@ if Granular.hasNetCDF | |
[5., … | |
[7.5,… | |
- info("Checking cell content using conformal mapping methods") | |
+ Compat.@info "Checking cell content using conformal mapping methods" | |
@test Granular.isPointInCell(ocean, 1, 1, [6.4, 53.4], sw, se, ne, nw, | |
method="Conformal") == true | |
@test Granular.isPointInCell(ocean, 1, 1, [6.1, 53.5], sw, se, ne, nw, | |
t@@ -85,7 +85,7 @@ if Granular.hasNetCDF | |
@test Granular.isPointInCell(ocean, 1, 1, [0.0, 53.5], sw, se, ne, nw, | |
method="Conformal") == false | |
- info("Testing bilinear interpolation scheme on conformal mapping") | |
+ Compat.@info "Testing bilinear interpolation scheme on conformal mapping" | |
ocean.u[1, 1, 1, 1] = 1.0 | |
ocean.u[2, 1, 1, 1] = 1.0 | |
ocean.u[2, 2, 1, 1] = 0.0 | |
t@@ -114,12 +114,12 @@ if Granular.hasNetCDF | |
@test val[1] ≈ .25 | |
@test val[2] ≈ .25 | |
- info("Testing cell binning - Area-based approach") | |
+ Compat.@info "Testing cell binning - Area-based approach" | |
@test Granular.findCellContainingPoint(ocean, [6.2,53.4], method="Area") =… | |
@test Granular.findCellContainingPoint(ocean, [7.2,53.4], method="Area") =… | |
@test Granular.findCellContainingPoint(ocean, [0.2,53.4], method="Area") =… | |
- info("Testing cell binning - Conformal mapping") | |
+ Compat.@info "Testing cell binning - Conformal mapping" | |
@test Granular.findCellContainingPoint(ocean, [6.2,53.4], method="Conforma… | |
(1, 1) | |
@test Granular.findCellContainingPoint(ocean, [7.2,53.4], method="Conforma… | |
t@@ -141,7 +141,7 @@ if Granular.hasNetCDF | |
@test sim.ocean.grain_list[2, 1] == [3] | |
end | |
-info("Testing ocean drag") | |
+Compat.@info "Testing ocean drag" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([4, 4, 2], [4., 4., 2.]) | |
sim.ocean.u[:,:,1,1] = 5. | |
t@@ -169,7 +169,7 @@ Granular.addOceanDrag!(sim) | |
@test sim.grains[2].force[1] < 0. | |
@test sim.grains[2].force[2] > 0. | |
-info("Testing curl function") | |
+Compat.@info "Testing curl function" | |
ocean.u[1, 1, 1, 1] = 1.0 | |
ocean.u[2, 1, 1, 1] = 1.0 | |
ocean.u[2, 2, 1, 1] = 0.0 | |
t@@ -188,7 +188,7 @@ ocean.u[1, 2, 1, 1] = 1.0 | |
ocean.v[:, :, 1, 1] = 0.0 | |
@test Granular.curl(ocean, .5, .5, 1, 1, 1, 1, sw, se, ne, nw) < 0. | |
-info("Testing atmosphere drag") | |
+Compat.@info "Testing atmosphere drag" | |
sim = Granular.createSimulation() | |
sim.atmosphere = Granular.createRegularAtmosphereGrid([4, 4, 2], [4., 4., 2.]) | |
atmosphere = Granular.createRegularAtmosphereGrid([4, 4, 2], [4., 4., 2.]) | |
t@@ -214,7 +214,7 @@ Granular.addAtmosphereDrag!(sim) | |
@test sim.grains[2].force[1] < 0. | |
@test sim.grains[2].force[2] > 0. | |
-info("Testing curl function") | |
+Compat.@info "Testing curl function" | |
atmosphere.u[1, 1, 1, 1] = 1.0 | |
atmosphere.u[2, 1, 1, 1] = 1.0 | |
atmosphere.u[2, 2, 1, 1] = 0.0 | |
t@@ -232,8 +232,8 @@ atmosphere.v[:, :, 1, 1] = 0.0 | |
@test Granular.curl(atmosphere, .5, .5, 1, 1, 1, 1, sw, se, ne, nw) < 0. | |
-info("Testing findEmptyPositionInGridCell") | |
-info("# Insert into empty cell") | |
+Compat.@info "Testing findEmptyPositionInGridCell" | |
+Compat.@info "# Insert into empty cell" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([4, 4, 2], [4., 4., 2.]) | |
Granular.sortGrainsInGrid!(sim, sim.ocean, verbose=verbose) | |
t@@ -242,7 +242,7 @@ pos = Granular.findEmptyPositionInGridCell(sim, sim.ocean,… | |
@test pos != false | |
@test Granular.isPointInCell(sim.ocean, 1, 1, pos) == true | |
-info("# Insert into cell with one other ice floe") | |
+Compat.@info "# Insert into cell with one other ice floe" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([4, 4, 2], [4., 4., 2.]) | |
Granular.addGrainCylindrical!(sim, [.25, .25], .25, 1., verbose=verbose) | |
t@@ -252,7 +252,7 @@ pos = Granular.findEmptyPositionInGridCell(sim, sim.ocean,… | |
@test pos != false | |
@test Granular.isPointInCell(sim.ocean, 1, 1, pos) == true | |
-info("# Insert into cell with two other grains") | |
+Compat.@info "# Insert into cell with two other grains" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([4, 4, 2], [4., 4., 2.]) | |
Granular.addGrainCylindrical!(sim, [.25, .25], .25, 1., verbose=verbose) | |
t@@ -263,7 +263,7 @@ pos = Granular.findEmptyPositionInGridCell(sim, sim.ocean,… | |
@test pos != false | |
@test Granular.isPointInCell(sim.ocean, 1, 1, pos) == true | |
-info("# Insert into full cell") | |
+Compat.@info "# Insert into full cell" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([4, 4, 2], [4., 4., 2.]) | |
Granular.addGrainCylindrical!(sim, [.25, .25], 1., 1., verbose=verbose) | |
t@@ -275,7 +275,7 @@ pos = Granular.findEmptyPositionInGridCell(sim, sim.ocean,… | |
verbose=false) | |
@test pos == false | |
-info("# Insert into empty cell") | |
+Compat.@info "# Insert into empty cell" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([4, 4, 2], [4., 4., 2.]) | |
Granular.sortGrainsInGrid!(sim, sim.ocean, verbose=verbose) | |
t@@ -284,7 +284,7 @@ pos = Granular.findEmptyPositionInGridCell(sim, sim.ocean,… | |
@test pos != false | |
@test Granular.isPointInCell(sim.ocean, 2, 2, pos) == true | |
-info("# Insert into full cell") | |
+Compat.@info "# Insert into full cell" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([4, 4, 2], [4., 4., 2.]) | |
Granular.addGrainCylindrical!(sim, [1.5, 1.5], 1., 1., verbose=verbose) | |
t@@ -296,7 +296,7 @@ pos = Granular.findEmptyPositionInGridCell(sim, sim.ocean,… | |
verbose=false) | |
@test pos == false | |
-info("Test default sorting with ocean/atmosphere grids") | |
+Compat.@info "Test default sorting with ocean/atmosphere grids" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([4, 4, 2], [4., 4., 2.]) | |
sim.atmosphere = Granular.createRegularAtmosphereGrid([4, 4, 2], [4., 4.000001… | |
t@@ -321,7 +321,7 @@ Granular.run!(sim, single_step=true, verbose=verbose) | |
@test sim.atmosphere.grain_list[2, 2] == [] | |
@test sim.atmosphere.grain_list[3, 3] == [3] | |
-info("Test optimization when ocean/atmosphere grids are collocated") | |
+Compat.@info "Test optimization when ocean/atmosphere grids are collocated" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([4, 4, 2], [4., 4., 2.]) | |
sim.atmosphere = Granular.createRegularAtmosphereGrid([4, 4, 2], [4., 4., 2.]) | |
t@@ -346,7 +346,7 @@ Granular.run!(sim, single_step=true, verbose=false) | |
@test sim.atmosphere.grain_list[2, 2] == [] | |
@test sim.atmosphere.grain_list[3, 3] == [3] | |
-info("Testing automatic grid-size adjustment") | |
+Compat.@info "Testing automatic grid-size adjustment" | |
# ocean grid | |
sim = Granular.createSimulation() | |
@test_throws ErrorException Granular.fitGridToGrains!(sim, sim.ocean) | |
t@@ -407,7 +407,7 @@ Granular.fitGridToGrains!(sim, sim.atmosphere, padding=.5,… | |
@test sim.atmosphere.xq[end,end] ≈ 3.5 | |
@test sim.atmosphere.yq[end,end] ≈ 5.5 | |
-info("Testing porosity estimation") | |
+Compat.@info "Testing porosity estimation" | |
sim = Granular.createSimulation() | |
dx = 1.0; dy = 1.0 | |
nx = 3; ny = 3 | |
diff --git a/test/jld.jl b/test/jld.jl | |
t@@ -1,12 +1,12 @@ | |
#!/usr/bin/env julia | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
-info("Determining if JLD is installed") | |
+Compat.@info "Determining if JLD is installed" | |
if typeof(Pkg.installed("JLD")) == VersionNumber | |
- info("JLD found, proceeding with JLD-specific tests") | |
+ Compat.@info "JLD found, proceeding with JLD-specific tests" | |
- info("Writing simple simulation to JLD file") | |
+ Compat.@info "Writing simple simulation to JLD file" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 10., 1., verbose=false) | |
Granular.addGrainCylindrical!(sim, [18., 0.], 10., 1., verbose=false) | |
t@@ -17,11 +17,11 @@ if typeof(Pkg.installed("JLD")) == VersionNumber | |
Granular.writeSimulation(sim) | |
Granular.writeSimulationStatus(sim) | |
- info("Reading from JLD file by specifying the input file name") | |
+ Compat.@info "Reading from JLD file by specifying the input file name" | |
sim2 = Granular.readSimulation("./test/test.1.jld") | |
Granular.compareSimulations(sim, sim2) | |
- info("Reading and overwriting from JLD file by simulation id") | |
+ Compat.@info "Reading and overwriting from JLD file by simulation id" | |
sim3 = Granular.createSimulation("test") | |
@test 1 == Granular.readSimulationStatus(sim3) | |
sim3 = Granular.readSimulation(sim3) | |
diff --git a/test/netcdf.jl b/test/netcdf.jl | |
t@@ -2,12 +2,12 @@ | |
# Check if NetCDF files are read correctly from the disk. | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
@test_throws ErrorException Granular.readOceanStateNetCDF("nonexistentfile") | |
@test_throws ErrorException Granular.readOceanGridNetCDF("nonexistentfile") | |
-info("Testing dimensions of content read from Baltic test case") | |
+Compat.@info "Testing dimensions of content read from Baltic test case" | |
ocean = Granular.readOceanNetCDF("Baltic/00010101.ocean_month.nc", | |
"Baltic/ocean_hgrid.nc") | |
@test ocean.time / (24. * 60. * 60.) ≈ [.5, 1.5, 2.5, 3.5, 4.5] | |
t@@ -20,7 +20,7 @@ ocean = Granular.readOceanNetCDF("Baltic/00010101.ocean_mont… | |
@test size(ocean.h) == (23, 14, 63, 5) | |
@test size(ocean.e) == (23, 14, 64, 5) | |
-info("Testing ocean state interpolation") | |
+Compat.@info "Testing ocean state interpolation" | |
@test_throws ErrorException Granular.interpolateOceanState(ocean, time=0.) | |
@test_throws ErrorException Granular.interpolateOceanState(ocean, time=1.e34) | |
u1, v1, h1, e1 = Granular.interpolateOceanState(ocean, ocean.time[1]) | |
diff --git a/test/ocean.jl b/test/ocean.jl | |
t@@ -3,9 +3,9 @@ | |
# Check if ocean-specific functions and grid operations are functioning | |
# correctly | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
-info("Testing regular grid generation") | |
+Compat.@info "Testing regular grid generation" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([6, 6, 6], [1., 1., 1.]) | |
@test size(sim.ocean.xq) == (7, 7) | |
t@@ -27,7 +27,7 @@ sim.ocean = Granular.createRegularOceanGrid([6, 6, 6], [1., … | |
@test sim.ocean.h ≈ zeros(7, 7, 6, 1) | |
@test sim.ocean.e ≈ zeros(7, 7, 6, 1) | |
-info("Testing velocity drag interaction (static ocean)") | |
+Compat.@info "Testing velocity drag interaction (static ocean)" | |
Granular.addGrainCylindrical!(sim, [.5, .5], .25, .1) | |
Granular.setTotalTime!(sim, 5.) | |
Granular.setTimeStep!(sim) | |
t@@ -43,7 +43,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy… | |
@test sim.grains[1].ocean_stress[1] < 0. | |
@test sim.grains[1].ocean_stress[2] ≈ 0. | |
-info("Testing velocity drag interaction (static ice floe)") | |
+Compat.@info "Testing velocity drag interaction (static ice floe)" | |
sim = deepcopy(sim_init) | |
sim.ocean.v[:, :, 1, 1] = 0.1 | |
E_kin_lin_init = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -56,7 +56,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy… | |
@test sim.grains[1].ocean_stress[1] ≈ 0. | |
@test sim.grains[1].ocean_stress[2] > 0. | |
-info("Testing vortex interaction (static ocean)") | |
+Compat.@info "Testing vortex interaction (static ocean)" | |
sim = deepcopy(sim_init) | |
sim.grains[1].ang_vel = 0.1 | |
E_kin_lin_init = Granular.totalGrainKineticTranslationalEnergy(sim) | |
t@@ -69,7 +69,7 @@ E_kin_rot_final = Granular.totalGrainKineticRotationalEnergy… | |
@test sim.grains[1].ang_pos > 0. # check angular position orientation | |
@test E_kin_lin_init ≈ E_kin_lin_final # no linear velocity gained | |
-info("Testing vortex interaction (static ice floe)") | |
+Compat.@info "Testing vortex interaction (static ice floe)" | |
sim = deepcopy(sim_init) | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [1., 1., 1.]) | |
sim.grains[1].lin_pos[1] = 0.5 | |
diff --git a/test/packing.jl b/test/packing.jl | |
t@@ -5,9 +5,9 @@ import Granular | |
verbose = true | |
plot = false | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
-info("Testing regular packing generation (power law GSD)") | |
+Compat.@info "Testing regular packing generation (power law GSD)" | |
sim = Granular.createSimulation() | |
Granular.regularPacking!(sim, [2, 2], 1., 1., size_distribution="powerlaw") | |
@test 4 == length(sim.grains) | |
t@@ -24,7 +24,7 @@ for grain in sim.grains | |
end | |
plot && Granular.plotGrains(sim, filetype="regular-powerlaw.png", show_figure=… | |
-info("Testing regular packing generation (uniform GSD)") | |
+Compat.@info "Testing regular packing generation (uniform GSD)" | |
sim = Granular.createSimulation() | |
Granular.regularPacking!(sim, [2, 2], 1., 1., size_distribution="uniform") | |
@test 4 == length(sim.grains) | |
t@@ -45,7 +45,7 @@ plot && Granular.plotGrains(sim, filetype="regular-uniform.p… | |
plot_packings=false | |
verbose=false | |
-info("Testing irregular (Poisson-disk) packing generation (monodisperse size)") | |
+Compat.@info "Testing irregular (Poisson-disk) packing generation (monodispers… | |
sim = Granular.createSimulation("poisson1-monodisperse-nopadding") | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [1., 1., 1.]) | |
Granular.irregularPacking!(sim, | |
t@@ -56,7 +56,7 @@ Granular.irregularPacking!(sim, | |
verbose=verbose) | |
@test length(sim.grains) > 23 | |
-info("Testing irregular (Poisson-disk) packing generation (wide PSD)") | |
+Compat.@info "Testing irregular (Poisson-disk) packing generation (wide PSD)" | |
sim = Granular.createSimulation("poisson2-wide-nopadding") | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [1., 1., 1.]) | |
Granular.irregularPacking!(sim, | |
t@@ -87,7 +87,7 @@ Granular.irregularPacking!(sim, | |
@test length(sim.grains) > 280 | |
-info("Testing raster-based mapping algorithm") | |
+Compat.@info "Testing raster-based mapping algorithm" | |
sim = Granular.createSimulation("raster-packing1") | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [1., 1., 1.]) | |
Granular.addGrainCylindrical!(sim, [0.5, 0.5], 0.4, 1.0) | |
t@@ -125,14 +125,14 @@ occupied_ans = Array{Bool}([ | |
sim_init = deepcopy(sim) | |
plot && Granular.plotGrains(sim, filetype="rastermap.png", show_figure=false) | |
-info("Testing raster-based mapping algorithm (power law GSD)") | |
+Compat.@info "Testing raster-based mapping algorithm (power law GSD)" | |
sim = deepcopy(sim_init) | |
np_init = length(sim.grains) | |
Granular.rasterPacking!(sim, 0.02, 0.04, verbose=verbose) | |
@test np_init < length(sim.grains) | |
plot && Granular.plotGrains(sim, filetype="powerlaw.png", show_figure=false) | |
-info("Testing raster-based mapping algorithm (uniform GSD)") | |
+Compat.@info "Testing raster-based mapping algorithm (uniform GSD)" | |
sim = deepcopy(sim_init) | |
np_init = length(sim.grains) | |
Granular.rasterPacking!(sim, 0.02, 0.04, size_distribution="uniform", | |
t@@ -140,14 +140,14 @@ Granular.rasterPacking!(sim, 0.02, 0.04, size_distributi… | |
@test np_init < length(sim.grains) | |
plot && Granular.plotGrains(sim, filetype="uniform.png", show_figure=false) | |
-info("Tesing square packing") | |
+Compat.@info "Tesing square packing" | |
sim = Granular.createSimulation() | |
Granular.regularPacking!(sim, [5,6], 1.0, 1.0, tiling="square", | |
padding_factor=0.0) | |
@test length(sim.grains) == 5*6 | |
plot && Granular.plotGrains(sim, filetype="square.png", show_figure=false) | |
-info("Tesing triangular packing") | |
+Compat.@info "Tesing triangular packing" | |
sim = Granular.createSimulation() | |
Granular.regularPacking!(sim, [6,6], 1.0, 1.0, tiling="triangular", | |
padding_factor=0.0) | |
diff --git a/test/profiling.jl b/test/profiling.jl | |
t@@ -9,11 +9,11 @@ import Plots | |
import Granular | |
import CurveFit | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
verbose=false | |
-info("Testing performance with many interacting grains") | |
+Compat.@info "Testing performance with many interacting grains" | |
function timeSingleStepInDenseSimulation(nx::Int; verbose::Bool=true, | |
profile::Bool=false, | |
t@@ -104,7 +104,7 @@ memory_usage_all_to_all = zeros(length(nx)) | |
memory_usage_cell_sorting = zeros(length(nx)) | |
memory_usage_cell_sorting2 = zeros(length(nx)) | |
for i=1:length(nx) | |
- info("nx = $(nx[i])") | |
+ Compat.@info "nx = $(nx[i])" | |
t_elapsed_all_to_all[i], memory_usage_all_to_all[i] = | |
timeSingleStepInDenseSimulation(Int(nx[i]), grid_sorting=false) | |
t_elapsed_cell_sorting[i], memory_usage_cell_sorting[i] = | |
diff --git a/test/runtests.jl b/test/runtests.jl | |
t@@ -1,4 +1,6 @@ | |
+import Compat | |
using Compat.Test | |
+using Compat.LinearAlgebra | |
import Granular | |
include("collision-2floes-normal.jl") | |
diff --git a/test/temporal.jl b/test/temporal.jl | |
t@@ -1,4 +1,4 @@ | |
-info("Testing temporal functionality") | |
+Compat.@info "Testing temporal functionality" | |
sim = Granular.createSimulation() | |
@test_throws ErrorException Granular.setTimeStep!(sim) | |
diff --git a/test/util.jl b/test/util.jl | |
t@@ -1,8 +1,9 @@ | |
#!/usr/bin/env julia | |
+import Compat | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
-info("Testing power-law RNG") | |
+Compat.@info "Testing power-law RNG" | |
@test 1 == length(Granular.randpower()) | |
@test () == size(Granular.randpower()) | |
t@@ -13,7 +14,7 @@ info("Testing power-law RNG") | |
@test 5 == length(Granular.randpower(5)) | |
@test (5,) == size(Granular.randpower(5)) | |
-srand(1) | |
+Compat.srand(1) | |
for i=1:10^5 | |
@test 0. <= Granular.randpower() <= 1. | |
@test 0. <= Granular.randpower(1, 1., 0., 1.) <= 1. | |
diff --git a/test/vtk.jl b/test/vtk.jl | |
t@@ -3,9 +3,9 @@ import Compat | |
# Check the contact search and geometry of a two-particle interaction | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
-info("Writing simple simulation to VTK file") | |
+Compat.@info "Writing simple simulation to VTK file" | |
sim = Granular.createSimulation(id="test") | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 10., 1., verbose=false) | |
Granular.addGrainCylindrical!(sim, [18., 0.], 10., 1., verbose=false) | |
t@@ -19,7 +19,7 @@ if Compat.Sys.islinux() | |
elseif Compat.Sys.isapple() | |
cmd = ["shasum", "-a", "256"] | |
elseif Compat.Sys.iswindows() | |
- info("checksum verification not yet implemented on Windows") | |
+ Compat.@info "checksum verification not yet implemented on Windows" | |
exit() | |
cmd = ["powershell", "-Command", "\"Get-FileHash", "-Algorithm", "SHA256"] | |
cmd_post = "\"" | |
t@@ -49,7 +49,7 @@ oceanpath * "\n" | |
Granular.removeSimulationFiles(sim) | |
-info("Testing VTK write during run!()") | |
+Compat.@info "Testing VTK write during run!()" | |
Granular.setOutputFileInterval!(sim, 1e-9) | |
Granular.setTotalTime!(sim, 1.5) | |
Granular.setTimeStep!(sim) | |
t@@ -61,13 +61,13 @@ Granular.run!(sim) | |
Granular.status() | |
-info("Testing generation of Paraview Python script") | |
+Compat.@info "Testing generation of Paraview Python script" | |
Granular.writeParaviewPythonScript(sim, | |
save_animation=true, | |
save_images=false) | |
@test isfile("$(sim.id)/$(sim.id).py") && filesize("$(sim.id)/$(sim.id).py") >… | |
-info("Testing Paraview rendering if `pvpython` is present") | |
+Compat.@info "Testing Paraview rendering if `pvpython` is present" | |
try | |
run(`pvpython $(sim.id)/$(sim.id).py`) | |
catch return_signal | |
diff --git a/test/wall.jl b/test/wall.jl | |
t@@ -2,10 +2,10 @@ | |
# Check the basic dynamic wall functionality | |
-info("#### $(basename(@__FILE__)) ####") | |
+Compat.@info "#### $(basename(@__FILE__)) ####" | |
-info("# Test wall initialization") | |
-info("Testing argument value checks") | |
+Compat.@info "# Test wall initialization" | |
+Compat.@info "Testing argument value checks" | |
sim = Granular.createSimulation() | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 10., 2., verbose=false) | |
@test_throws ErrorException Granular.addWallLinearFrictionless!(sim, | |
t@@ -25,7 +25,7 @@ sim = Granular.createSimulation() | |
1.) | |
-info("Check that wall mass equals total grain mass and max. thickness") | |
+Compat.@info "Check that wall mass equals total grain mass and max. thickness" | |
sim = Granular.createSimulation() | |
@test length(sim.walls) == 0 | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 10., 2., verbose=false) | |
t@@ -35,7 +35,7 @@ Granular.addWallLinearFrictionless!(sim, [1., 0.], 1., verbo… | |
@test sim.walls[1].mass ≈ 1.0 | |
@test sim.walls[1].thickness ≈ 2.0 | |
-info("Test wall surface area and defined normal stress") | |
+Compat.@info "Test wall surface area and defined normal stress" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 10., 2., verbose=false) | |
t@@ -50,9 +50,9 @@ Granular.addWallLinearFrictionless!(sim, [0., 1.], 1., verbo… | |
@test Granular.getWallSurfaceArea(sim, 1) ≈ 20.0*2.0 | |
@test Granular.getWallSurfaceArea(sim, 2) ≈ 10.0*2.0 | |
-info("# Test wall-grain interaction: elastic") | |
+Compat.@info "# Test wall-grain interaction: elastic" | |
-info("Wall present but no contact") | |
+Compat.@info "Wall present but no contact" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 1., 2., verbose=false) | |
t@@ -63,7 +63,7 @@ Granular.interactWalls!(sim) | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall present but no contact") | |
+Compat.@info "Wall present but no contact" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 1., 2., verbose=false) | |
t@@ -74,7 +74,7 @@ Granular.interactWalls!(sim) | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall at -x") | |
+Compat.@info "Wall at -x" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 1., 2., verbose=false) | |
t@@ -85,7 +85,7 @@ Granular.interactWalls!(sim) | |
@test sim.grains[1].force[1] > 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall at +x") | |
+Compat.@info "Wall at +x" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 1., 2., verbose=false) | |
t@@ -96,7 +96,7 @@ Granular.interactWalls!(sim) | |
@test sim.grains[1].force[1] < 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall at -y") | |
+Compat.@info "Wall at -y" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 1., 2., verbose=false) | |
t@@ -107,7 +107,7 @@ Granular.interactWalls!(sim) | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] > 0. | |
-info("Wall at +y") | |
+Compat.@info "Wall at +y" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 1., 2., verbose=false) | |
t@@ -118,9 +118,9 @@ Granular.interactWalls!(sim) | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] < 0. | |
-info("# Test wall-grain interaction: elastic-viscous") | |
+Compat.@info "# Test wall-grain interaction: elastic-viscous" | |
-info("Wall present but no contact") | |
+Compat.@info "Wall present but no contact" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 1., 2., verbose=false) | |
t@@ -132,7 +132,7 @@ Granular.interactWalls!(sim) | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall present but no contact") | |
+Compat.@info "Wall present but no contact" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 1., 2., verbose=false) | |
t@@ -144,7 +144,7 @@ Granular.interactWalls!(sim) | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall at -x") | |
+Compat.@info "Wall at -x" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 1., 2., verbose=false) | |
t@@ -156,7 +156,7 @@ Granular.interactWalls!(sim) | |
@test sim.grains[1].force[1] > 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall at +x") | |
+Compat.@info "Wall at +x" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 1., 2., verbose=false) | |
t@@ -168,7 +168,7 @@ Granular.interactWalls!(sim) | |
@test sim.grains[1].force[1] < 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall at -y") | |
+Compat.@info "Wall at -y" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 1., 2., verbose=false) | |
t@@ -180,7 +180,7 @@ Granular.interactWalls!(sim) | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] > 0. | |
-info("Wall at +y") | |
+Compat.@info "Wall at +y" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 0., 0.], 1., 2., verbose=false) | |
t@@ -192,7 +192,7 @@ Granular.interactWalls!(sim) | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] < 0. | |
-info("Full collision with wall") | |
+Compat.@info "Full collision with wall" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [1.2, 0.5], 1., 2., verbose=false) | |
t@@ -222,9 +222,9 @@ Granular.run!(sim) | |
@test sim.grains[1].lin_vel[2] ≈ 0. | |
-info("# Testing wall dynamics") | |
+Compat.@info "# Testing wall dynamics" | |
-info("Wall present, no contact, fixed (default)") | |
+Compat.@info "Wall present, no contact, fixed (default)" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 1., 1.], 1., 2., verbose=false) | |
t@@ -239,7 +239,7 @@ Granular.updateWallKinematics!(sim) | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall present, no contact, fixed (TY2)") | |
+Compat.@info "Wall present, no contact, fixed (TY2)" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 1., 1.], 1., 2., verbose=false) | |
t@@ -254,7 +254,7 @@ Granular.updateWallKinematics!(sim, method="Two-term Taylo… | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall present, no contact, fixed (TY3)") | |
+Compat.@info "Wall present, no contact, fixed (TY3)" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 1., 1.], 1., 2., verbose=false) | |
t@@ -270,7 +270,7 @@ Granular.updateWallKinematics!(sim, method="Three-term Tay… | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall present, contact, fixed") | |
+Compat.@info "Wall present, contact, fixed" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 1., 1.], 1., 2., verbose=false) | |
t@@ -282,7 +282,7 @@ Granular.updateWallKinematics!(sim) | |
@test sim.walls[1].vel ≈ 0. | |
@test sim.walls[1].pos ≈ -0.01 | |
-info("Wall present, no contact, velocity BC") | |
+Compat.@info "Wall present, no contact, velocity BC" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 1., 1.], 1., 2., verbose=false) | |
t@@ -299,7 +299,7 @@ Granular.updateWallKinematics!(sim) | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall present, no contact, velocity BC (TY2)") | |
+Compat.@info "Wall present, no contact, velocity BC (TY2)" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 1., 1.], 1., 2., verbose=false) | |
t@@ -316,7 +316,7 @@ Granular.updateWallKinematics!(sim, method="Two-term Taylo… | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall present, no contact, velocity BC (TY3)") | |
+Compat.@info "Wall present, no contact, velocity BC (TY3)" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 1., 1.], 1., 2., verbose=false) | |
t@@ -334,7 +334,7 @@ Granular.updateWallKinematics!(sim, method="Three-term Tay… | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall present, contact, velocity BC (TY2)") | |
+Compat.@info "Wall present, contact, velocity BC (TY2)" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 1., 1.], 1., 2., verbose=false) | |
t@@ -349,7 +349,7 @@ Granular.updateWallKinematics!(sim, method="Two-term Taylo… | |
@test sim.walls[1].vel ≈ 1. | |
@test sim.walls[1].pos > -0.9 | |
-info("Wall present, contact, velocity BC (TY2)") | |
+Compat.@info "Wall present, contact, velocity BC (TY2)" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [10., 20., 1.0]) | |
Granular.addGrainCylindrical!(sim, [ 1., 1.], 1., 2., verbose=false) | |
t@@ -363,7 +363,7 @@ Granular.updateWallKinematics!(sim, method="Two-term Taylo… | |
@test sim.walls[1].vel ≈ 1. | |
@test sim.walls[1].pos > -0.9 | |
-info("Wall present, contact, normal stress BC") | |
+Compat.@info "Wall present, contact, normal stress BC" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [2., 2., 1.]) | |
Granular.addGrainCylindrical!(sim, [ 1., 1.], 1., 1., verbose=false) | |
t@@ -380,7 +380,7 @@ Granular.updateWallKinematics!(sim) | |
@test sim.grains[1].force[1] ≈ 0. | |
@test sim.grains[1].force[2] ≈ 0. | |
-info("Wall present, contact, normal stress BC") | |
+Compat.@info "Wall present, contact, normal stress BC" | |
sim = Granular.createSimulation() | |
sim.ocean = Granular.createRegularOceanGrid([1, 1, 1], [2., 2., 1.]) | |
Granular.addGrainCylindrical!(sim, [ 1., 1.], 1., 1., verbose=false) | |
t@@ -408,7 +408,7 @@ for i=1:5 | |
@test sim.grains[1].force[2] ≈ 0. | |
end | |
-info("Granular packing, wall present, normal stress BC") | |
+Compat.@info "Granular packing, wall present, normal stress BC" | |
sim = Granular.createSimulation() | |
Granular.regularPacking!(sim, [5, 5], 1.0, 2.0) | |
Granular.fitGridToGrains!(sim, sim.ocean) |