Mercurial > repos > public > sbplib_julia
comparison DiffOps/src/DiffOps.jl @ 253:396eadb652bd boundary_conditions
Rename function closureSize to closuresize
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 27 Jun 2019 16:05:26 +0200 |
parents | a5fdc00d5070 |
children | ce6a2f3f732a |
comparison
equal
deleted
inserted
replaced
252:9405c19b76bc | 253:396eadb652bd |
---|---|
45 return nothing | 45 return nothing |
46 end | 46 end |
47 | 47 |
48 # Maybe this should be split according to b3fbef345810 after all?! Seems like it makes performance more predictable | 48 # Maybe this should be split according to b3fbef345810 after all?! Seems like it makes performance more predictable |
49 function apply_region!(D::DiffOpCartesian{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}, r1::Type{<:Region}, r2::Type{<:Region}) where T | 49 function apply_region!(D::DiffOpCartesian{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}, r1::Type{<:Region}, r2::Type{<:Region}) where T |
50 for I ∈ regionindices(D.grid.size, closureSize(D.op), (r1,r2)) | 50 for I ∈ regionindices(D.grid.size, closuresize(D.op), (r1,r2)) |
51 @inbounds indextuple = (Index{r1}(I[1]), Index{r2}(I[2])) | 51 @inbounds indextuple = (Index{r1}(I[1]), Index{r2}(I[2])) |
52 @inbounds u[I] = apply(D, v, indextuple) | 52 @inbounds u[I] = apply(D, v, indextuple) |
53 end | 53 end |
54 return nothing | 54 return nothing |
55 end | 55 end |
68 return nothing | 68 return nothing |
69 end | 69 end |
70 | 70 |
71 using TiledIteration | 71 using TiledIteration |
72 function apply_region_tiled!(D::DiffOpCartesian{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}, r1::Type{<:Region}, r2::Type{<:Region}) where T | 72 function apply_region_tiled!(D::DiffOpCartesian{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}, r1::Type{<:Region}, r2::Type{<:Region}) where T |
73 ri = regionindices(D.grid.size, closureSize(D.op), (r1,r2)) | 73 ri = regionindices(D.grid.size, closuresize(D.op), (r1,r2)) |
74 # TODO: Pass Tilesize to function | 74 # TODO: Pass Tilesize to function |
75 for tileaxs ∈ TileIterator(axes(ri), padded_tilesize(T, (5,5), 2)) | 75 for tileaxs ∈ TileIterator(axes(ri), padded_tilesize(T, (5,5), 2)) |
76 for j ∈ tileaxs[2], i ∈ tileaxs[1] | 76 for j ∈ tileaxs[2], i ∈ tileaxs[1] |
77 I = ri[i,j] | 77 I = ri[i,j] |
78 u[I] = apply(D, v, (Index{r1}(I[1]), Index{r2}(I[2]))) | 78 u[I] = apply(D, v, (Index{r1}(I[1]), Index{r2}(I[2]))) |