tChange regular indexing method to contain lower grid edge - Granular.jl - Juli… | |
git clone git://src.adamsgaard.dk/Granular.jl | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 3a804499104abb325af7654f1a52048c4edadec4 | |
parent f663f572c7f1b0e5aee6157f2925eeee508c4eef | |
Author: Anders Damsgaard <[email protected]> | |
Date: Fri, 5 Jan 2018 10:40:43 -0500 | |
Change regular indexing method to contain lower grid edge | |
Diffstat: | |
M src/grid.jl | 6 +++--- | |
1 file changed, 3 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/src/grid.jl b/src/grid.jl | |
t@@ -164,8 +164,8 @@ function sortGrainsInGrid!(simulation::Simulation, grid::A… | |
else | |
if grid.regular_grid | |
- i, j = Int.(ceil.(simulation.grains[idx].lin_pos | |
- ./ grid.dx[1:2])) | |
+ i, j = Int.(floor.(simulation.grains[idx].lin_pos | |
+ ./ grid.dx[1:2])) + [1,1] | |
else | |
# Search for point in 8 neighboring cells | |
t@@ -299,7 +299,7 @@ function isPointInCell(grid::Any, i::Int, j::Int, | |
method::String="Conformal") | |
if grid.regular_grid | |
- if [i,j] == Int.(ceil.(point ./ grid.dx[1:2])) | |
+ if [i,j] == Int.(floor.(point ./ grid.dx[1:2])) + [1,1] | |
return true | |
else | |
return false |