Mercurial > repos > public > sbplib_julia
diff src/SbpOperators/laplace/laplace.jl @ 542:011ca1639153 refactor/tensor_index_coupling
Remove Index{Unknown} and replace with general Any implementations
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 27 Nov 2020 11:27:37 +0100 |
parents | 0546cb279fc2 |
children | e71f2f81b5f8 |
line wrap: on
line diff
--- a/src/SbpOperators/laplace/laplace.jl Thu Nov 26 21:35:34 2020 +0100 +++ b/src/SbpOperators/laplace/laplace.jl Fri Nov 27 11:27:37 2020 +0100 @@ -23,24 +23,24 @@ LazyTensors.range_size(L::Laplace) = getindex.(range_size.(L.D2),1) LazyTensors.domain_size(L::Laplace) = getindex.(domain_size.(L.D2),1) -function LazyTensors.apply(L::Laplace{Dim,T}, v::AbstractArray{T,Dim}, I::Vararg{Index,Dim}) where {T,Dim} +function LazyTensors.apply(L::Laplace{Dim,T}, v::AbstractArray{T,Dim}, I::Vararg{Any,Dim}) where {T,Dim} error("not implemented") end # u = L*v -function LazyTensors.apply(L::Laplace{1,T}, v::AbstractVector{T}, I::Index) where T - @inbounds u = LazyTensors.apply(L.D2[1],v,I) +function LazyTensors.apply(L::Laplace{1,T}, v::AbstractVector{T}, i) where T + @inbounds u = LazyTensors.apply(L.D2[1],v,i) return u end -function LazyTensors.apply(L::Laplace{2,T}, v::AbstractArray{T,2}, I::Index, J::Index) where T +function LazyTensors.apply(L::Laplace{2,T}, v::AbstractArray{T,2}, i, j) where T # 2nd x-derivative - @inbounds vx = view(v, :, Int(J)) - @inbounds uᵢ = LazyTensors.apply(L.D2[1], vx , I) + @inbounds vx = view(v, :, Int(j)) + @inbounds uᵢ = LazyTensors.apply(L.D2[1], vx , i) # 2nd y-derivative - @inbounds vy = view(v, Int(I), :) - @inbounds uᵢ += LazyTensors.apply(L.D2[2], vy , J) + @inbounds vy = view(v, Int(i), :) + @inbounds uᵢ += LazyTensors.apply(L.D2[2], vy , j) return uᵢ end