Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/laplace/secondderivative.jl @ 356:0844069ab5ff refactor/remove_dynamic_size_tensormapping
Reinclude SbpOperators and fix most of the code and tests there.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sun, 27 Sep 2020 22:51:31 +0200 |
parents | 7fe43d902a27 |
children | e73af120ad38 |
comparison
equal
deleted
inserted
replaced
355:5c9212a8ee4f | 356:0844069ab5ff |
---|---|
7 struct SecondDerivative{T,N,M,K} <: TensorMapping{T,1,1} | 7 struct SecondDerivative{T,N,M,K} <: TensorMapping{T,1,1} |
8 h_inv::T # The grid spacing could be included in the stencil already. Preferable? | 8 h_inv::T # The grid spacing could be included in the stencil already. Preferable? |
9 innerStencil::Stencil{T,N} | 9 innerStencil::Stencil{T,N} |
10 closureStencils::NTuple{M,Stencil{T,K}} | 10 closureStencils::NTuple{M,Stencil{T,K}} |
11 parity::Parity | 11 parity::Parity |
12 #TODO: Write a nice constructor | 12 size::NTuple{1,Int} |
13 end | 13 end |
14 export SecondDerivative | 14 export SecondDerivative |
15 | 15 |
16 LazyTensors.domain_size(D2::SecondDerivative, range_size::NTuple{1,Integer}) = range_size | 16 function SecondDerivative(grid::EquidistantGrid{1}, innerStencil, closureStencils) |
17 h_inv = grid.inverse_spacing[1] | |
18 return SecondDerivative(h_inv, innerStencil, closureStencils, even, size(grid)) | |
19 end | |
20 | |
21 LazyTensors.range_size(D2::SecondDerivative) = D2.size | |
22 LazyTensors.domain_size(D2::SecondDerivative) = D2.size | |
17 | 23 |
18 #TODO: The 1D tensor mappings should not have to dispatch on 1D tuples if we write LazyTensor.apply for vararg right?!?! | 24 #TODO: The 1D tensor mappings should not have to dispatch on 1D tuples if we write LazyTensor.apply for vararg right?!?! |
19 # Currently have to index the Tuple{Index} in each method in order to call the stencil methods which is ugly. | 25 # Currently have to index the Tuple{Index} in each method in order to call the stencil methods which is ugly. |
20 # I thought I::Vararg{Index,R} fell back to just Index for R = 1 | 26 # I thought I::Vararg{Index,R} fell back to just Index for R = 1 |
21 | 27 |