Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/stencil.jl @ 1221:b3b4d29b46c3 refactor/grids
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 10 Feb 2023 08:36:56 +0100 |
parents | 14cb97284373 |
children | 6baed7b081f2 4f79ab676ebc e1222fbb7c4d c10c6c3e9247 f13857f37b8f |
comparison
equal
deleted
inserted
replaced
1220:93bba649aea2 | 1221:b3b4d29b46c3 |
---|---|
83 w += s.weights[k]*v[i - s.range[k]] | 83 w += s.weights[k]*v[i - s.range[k]] |
84 end | 84 end |
85 return w | 85 return w |
86 end | 86 end |
87 | 87 |
88 function left_pad(s::Stencil, N) | |
89 weights = LazyTensors.left_pad_tuple(s.weights, zero(eltype(s)), N) | |
90 range = (first(s.range) - (N - length(s.weights))):last(s.range) | |
91 | |
92 return Stencil(range, weights) | |
93 end | |
94 | |
95 function right_pad(s::Stencil, N) | |
96 weights = LazyTensors.right_pad_tuple(s.weights, zero(eltype(s)), N) | |
97 range = first(s.range):(last(s.range) + (N - length(s.weights))) | |
98 | |
99 return Stencil(range, weights) | |
100 end | |
101 | |
102 | |
88 | 103 |
89 struct NestedStencil{T,N,M} | 104 struct NestedStencil{T,N,M} |
90 s::Stencil{Stencil{T,N},M} | 105 s::Stencil{Stencil{T,N},M} |
91 end | 106 end |
92 | 107 |