comparison diffOp.jl @ 112:98c788cba9bf cell_based_test

Rename the apply! that applies in regions to apply_region!
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 08 Feb 2019 21:14:39 +0100
parents 18b86c33b35a
children 3b89aa6dc7f2
comparison
equal deleted inserted replaced
111:18b86c33b35a 112:98c788cba9bf
42 end 42 end
43 43
44 return nothing 44 return nothing
45 end 45 end
46 46
47 function apply!(D::DiffOpCartesian{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}) where T 47 function apply_region!(D::DiffOpCartesian{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}) where T
48 apply!(D, u, v, Lower, Lower) 48 apply_region!(D, u, v, Lower, Lower)
49 apply!(D, u, v, Lower, Interior) 49 apply_region!(D, u, v, Lower, Interior)
50 apply!(D, u, v, Lower, Upper) 50 apply_region!(D, u, v, Lower, Upper)
51 apply!(D, u, v, Interior, Lower) 51 apply_region!(D, u, v, Interior, Lower)
52 apply!(D, u, v, Interior, Interior) 52 apply_region!(D, u, v, Interior, Interior)
53 apply!(D, u, v, Interior, Upper) 53 apply_region!(D, u, v, Interior, Upper)
54 apply!(D, u, v, Upper, Lower) 54 apply_region!(D, u, v, Upper, Lower)
55 apply!(D, u, v, Upper, Interior) 55 apply_region!(D, u, v, Upper, Interior)
56 apply!(D, u, v, Upper, Upper) 56 apply_region!(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 function apply_region!(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 for I ∈ regionindices(N, closuresize, (r1,r2))
64 @inbounds indextuple = (Index{r1}(I[1]), Index{r2}(I[2])) 64 @inbounds indextuple = (Index{r1}(I[1]), Index{r2}(I[2]))
65 @inbounds u[I] = apply(D, v, indextuple) 65 @inbounds u[I] = apply(D, v, indextuple)