commit 3a804499104abb325af7654f1a52048c4edadec4
parent f663f572c7f1b0e5aee6157f2925eeee508c4eef
Author: Anders Damsgaard <andersd@riseup.net>
Date: Fri, 5 Jan 2018 10:40:43 -0500
Change regular indexing method to contain lower grid edge
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/grid.jl b/src/grid.jl
@@ -164,8 +164,8 @@ function sortGrainsInGrid!(simulation::Simulation, grid::Any; verbose=true)
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
@@ -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