Mercurial > repos > public > sbplib_julia
diff src/SbpOperators/stencil.jl @ 864:9a2776352c2a
Merge operator_storage_array_of_table
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 19 Jan 2022 11:08:43 +0100 |
parents | 4433be383840 |
children | 313648b01504 11767fbb29f4 |
line wrap: on
line diff
--- a/src/SbpOperators/stencil.jl Wed Jan 19 07:24:36 2022 +0100 +++ b/src/SbpOperators/stencil.jl Wed Jan 19 11:08:43 2022 +0100 @@ -22,6 +22,12 @@ return Stencil(range, weights) end +function Stencil{T}(s::Stencil) where T + return Stencil(s.range, T.(s.weights)) +end + +Base.convert(::Type{Stencil{T}}, stencil) where T = Stencil{T}(stencil) + function CenteredStencil(weights::Vararg) if iseven(length(weights)) throw(ArgumentError("a centered stencil must have an odd number of weights."))