Mercurial > repos > public > sbplib_julia
comparison diffOp.jl @ 109:b3fbef345810 cell_based_test
Introduce apply! for given indices
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 08 Feb 2019 13:08:07 +0100 |
parents | d0a28888528a |
children | ee071b8ed58c |
comparison
equal
deleted
inserted
replaced
108:d0a28888528a | 109:b3fbef345810 |
---|---|
55 apply!(D, u, v, Upper, Interior) | 55 apply!(D, u, v, Upper, Interior) |
56 apply!(D, u, v, Upper, Upper) | 56 apply!(D, u, v, Upper, Upper) |
57 return nothing | 57 return nothing |
58 end | 58 end |
59 | 59 |
60 function apply!(D::DiffOpCartesian{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}, r1::Type{<:Region}, r2::Type{<:Region}) where T | 60 @inline function apply!(D::DiffOpCartesian{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}, r1::Type{<:Region}, r2::Type{<:Region}) where T |
61 N = D.grid.numberOfPointsPerDim | 61 N = D.grid.numberOfPointsPerDim |
62 closuresize = closureSize(D.op) | 62 closuresize = closureSize(D.op) |
63 for I ∈ regionindices(N, closuresize, (r1,r2)) | 63 apply!(D, u, v, r1, r2, regionindices(N, closuresize, (r1,r2))) |
64 return nothing | |
65 end | |
66 | |
67 @inline function apply!(D::DiffOpCartesian{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}, r1::Type{<:Region}, r2::Type{<:Region}, ri::CartesianIndices{2}) where T | |
68 for I ∈ ri | |
64 @inbounds indextuple = (Index(I[1], r1), Index(I[2], r2)) | 69 @inbounds indextuple = (Index(I[1], r1), Index(I[2], r2)) |
65 @inbounds u[I] = apply(D, v, indextuple) | 70 @inbounds u[I] = apply(D, v, indextuple) |
66 end | 71 end |
67 return nothing | 72 return nothing |
68 end | 73 end |