comparison diffOp.jl @ 105:44cd6b4371de cell_based_test

Specify region types in Laplace 2d apply!
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Fri, 08 Feb 2019 10:55:22 +0100
parents a274d6384e91
children 8010aadc4ff1
comparison
equal deleted inserted replaced
104:1862e901febb 105:44cd6b4371de
75 end 75 end
76 end 76 end
77 return nothing 77 return nothing
78 end 78 end
79 79
80 function apply!(L::Laplace{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}, r1::R1, r2::R2) where {T, R1, R2} 80 function apply!(L::Laplace{2}, u::AbstractArray{T,2}, v::AbstractArray{T,2}, r1::Type{<:Region}, r2::Type{<:Region}) where T
81 N = L.grid.numberOfPointsPerDim; 81 N = L.grid.numberOfPointsPerDim
82 closuresize = closureSize(L.op); 82 closuresize = closureSize(L.op)
83 for I ∈ regionindices(N, closuresize, (r1,r2)) 83 regionTuple = (r1,r2)
84 for I ∈ regionindices(N, closuresize, regionTuple)
84 @inbounds indextuple = (Index(I[1], r1), Index(I[2], r2)) 85 @inbounds indextuple = (Index(I[1], r1), Index(I[2], r2))
85 @inbounds u[I] = apply(L, v, indextuple) 86 @inbounds u[I] = apply(L, v, indextuple)
86 end 87 end
87 return nothing 88 return nothing
88 end 89 end