comparison 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
comparison
equal deleted inserted replaced
131:8569c637d923 136:c6aaf061c0a9
80 end 80 end
81 81
82 using TiledIteration 82 using TiledIteration
83 function apply_region_tiled!(D::DiffOpCartesian{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}, r1::Type{<:Region}, r2::Type{<:Region}) where T 83 function apply_region_tiled!(D::DiffOpCartesian{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}, r1::Type{<:Region}, r2::Type{<:Region}) where T
84 ri = regionindices(D.grid.size, closureSize(D.op), (r1,r2)) 84 ri = regionindices(D.grid.size, closureSize(D.op), (r1,r2))
85 for tileaxs ∈ TileIterator(axes(ri), padded_tilesize(T, (5,5), 2)) # TBD: Is this the right way, the right size? 85 # TODO: Pass Tilesize to function
86 for tileaxs ∈ TileIterator(axes(ri), padded_tilesize(T, (5,5), 2))
86 for j ∈ tileaxs[2], i ∈ tileaxs[1] 87 for j ∈ tileaxs[2], i ∈ tileaxs[1]
87 I = ri[i,j] 88 I = ri[i,j]
88 u[i,j] = apply(D, v, (Index{r1}(I[1]), Index{r2}(I[2]))) 89 u[I] = apply(D, v, (Index{r1}(I[1]), Index{r2}(I[2])))
89 end 90 end
90 end 91 end
91 return nothing 92 return nothing
92 end 93 end
93 94