diff diffOp.jl @ 136:c6aaf061c0a9 cell_based_test

Fix incorrect indexing of solution vector in apply_region_tiled
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 21 Feb 2019 16:46:01 +0100
parents 1aaeb46ba5f4
children f54dd4408fa7
line wrap: on
line diff
--- a/diffOp.jl	Thu Feb 21 14:11:08 2019 +0100
+++ b/diffOp.jl	Thu Feb 21 16:46:01 2019 +0100
@@ -82,10 +82,11 @@
 using TiledIteration
 function apply_region_tiled!(D::DiffOpCartesian{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}, r1::Type{<:Region}, r2::Type{<:Region}) where T
     ri = regionindices(D.grid.size, closureSize(D.op), (r1,r2))
-    for tileaxs ∈ TileIterator(axes(ri), padded_tilesize(T, (5,5), 2)) # TBD: Is this the right way, the right size?
+    # TODO: Pass Tilesize to function
+    for tileaxs ∈ TileIterator(axes(ri), padded_tilesize(T, (5,5), 2))
         for j ∈ tileaxs[2], i ∈ tileaxs[1]
             I = ri[i,j]
-            u[i,j] = apply(D, v, (Index{r1}(I[1]), Index{r2}(I[2])))
+            u[I] = apply(D, v, (Index{r1}(I[1]), Index{r2}(I[2])))
         end
     end
     return nothing