tfix packing test and minor indentation and style fixes - Granular.jl - Julia p… | |
git clone git://src.adamsgaard.dk/Granular.jl | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 5ac16e5a720ebb6d1d93d253f3d8a06ab2800b3a | |
parent 7995e2dd023e4a70bc29f0fad44def77512adf70 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 13 Jul 2021 14:50:10 +0200 | |
fix packing test and minor indentation and style fixes | |
Diffstat: | |
M src/contact_search.jl | 14 +++++++------- | |
M src/packing.jl | 4 ++-- | |
2 files changed, 9 insertions(+), 9 deletions(-) | |
--- | |
diff --git a/src/contact_search.jl b/src/contact_search.jl | |
t@@ -50,7 +50,7 @@ Returns a `vector` pointing from grain `i` to grain `j` in t… | |
* `j::Int`: index of the second grain. | |
""" | |
function interGrainPositionVector(simulation::Simulation, | |
- i::Int, j::Int) | |
+ i::Int, j::Int) | |
@inbounds return simulation.grains[i].lin_pos - | |
simulation.grains[j].lin_pos | |
end | |
t@@ -78,15 +78,15 @@ function findContactsAllToAll!(simulation::Simulation) | |
simulation.ocean.bc_east > 1 || | |
simulation.ocean.bc_north > 1 || | |
simulation.ocean.bc_south > 1 | |
- println("Ocean boundary conditions do not work with all-to-all " * | |
- "contact search") | |
+ error("Ocean boundary conditions do 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 | |
- println("Atmopshere boundary conditions do not work with " * | |
- "all-to-all contact search") | |
+ error("Atmopshere boundary conditions do not work with " * | |
+ "all-to-all contact search") | |
end | |
@inbounds for i = 1:length(simulation.grains) | |
t@@ -123,8 +123,8 @@ function findContactsInGrid!(simulation::Simulation, grid:… | |
end | |
nx, ny = size(grid.xh) | |
- for i=(grid_pos[1] - 1):(grid_pos[1] + 1) | |
- for j=(grid_pos[2] - 1):(grid_pos[2] + 1) | |
+ for i = (grid_pos[1] - 1):(grid_pos[1] + 1) | |
+ for j = (grid_pos[2] - 1):(grid_pos[2] + 1) | |
# correct indexes if necessary | |
i_corrected, j_corrected, distance_modifier = | |
diff --git a/src/packing.jl b/src/packing.jl | |
t@@ -282,7 +282,7 @@ function irregularPacking!(simulation::Simulation; | |
# If the binary_radius_search is selected, try to adjust the radius | |
# to a value as large as possible | |
- sortGrainsInGrid!(simulation, grid) | |
+ sortGrainsInGrid!(simulation, grid) | |
if binary_radius_search | |
# first test the maximum radius. If unsuccessful, iteratively | |
t@@ -321,7 +321,7 @@ function irregularPacking!(simulation::Simulation; | |
# if the grain candidate doesn't overlap with any other grains, | |
# add it and mark it as active | |
- sortGrainsInGrid!(simulation, grid) | |
+ sortGrainsInGrid!(simulation, grid) | |
if checkForContacts(simulation, grid, x_candidate, r_candidate, | |
return_when_overlap_found=true) | |
#println("Added grain from parent $i") |