Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/laplace/secondderivative.jl @ 543:1a53eb83ed24 refactor/tensor_index_coupling
Remove some unecessary Index types
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 27 Nov 2020 12:02:47 +0100 |
parents | 011ca1639153 |
children | 9330338d6ab5 |
comparison
equal
deleted
inserted
replaced
542:011ca1639153 | 543:1a53eb83ed24 |
---|---|
17 return SecondDerivative(h_inv, innerStencil, closureStencils, size(grid)) | 17 return SecondDerivative(h_inv, innerStencil, closureStencils, size(grid)) |
18 end | 18 end |
19 | 19 |
20 LazyTensors.range_size(D2::SecondDerivative) = D2.size | 20 LazyTensors.range_size(D2::SecondDerivative) = D2.size |
21 LazyTensors.domain_size(D2::SecondDerivative) = D2.size | 21 LazyTensors.domain_size(D2::SecondDerivative) = D2.size |
22 | |
23 #TODO: The 1D tensor mappings should not have to dispatch on 1D tuples if we write LazyTensor.apply for vararg right?!?! | |
24 # Currently have to index the Tuple{Index} in each method in order to call the stencil methods which is ugly. | |
25 # I thought I::Vararg{Index,R} fell back to just Index for R = 1 | |
26 | 22 |
27 # Apply for different regions Lower/Interior/Upper or Unknown region | 23 # Apply for different regions Lower/Interior/Upper or Unknown region |
28 function LazyTensors.apply(D2::SecondDerivative{T}, v::AbstractVector{T}, I::Index{Lower}) where T | 24 function LazyTensors.apply(D2::SecondDerivative{T}, v::AbstractVector{T}, I::Index{Lower}) where T |
29 return @inbounds D2.h_inv*D2.h_inv*apply_stencil(D2.closureStencils[Int(I)], v, Int(I)) | 25 return @inbounds D2.h_inv*D2.h_inv*apply_stencil(D2.closureStencils[Int(I)], v, Int(I)) |
30 end | 26 end |