Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/stencil.jl @ 1763:65fd5331caa5 feature/jet_aqua
Fix more ambiguities
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 13 Sep 2024 16:03:06 +0200 |
parents | d28562d5ca8f |
children | 244311761969 |
comparison
equal
deleted
inserted
replaced
1762:164e26a6cf79 | 1763:65fd5331caa5 |
---|---|
112 | 112 |
113 struct NestedStencil{T,N,M} | 113 struct NestedStencil{T,N,M} |
114 s::Stencil{Stencil{T,N},M} | 114 s::Stencil{Stencil{T,N},M} |
115 end | 115 end |
116 | 116 |
117 NestedStencil(;center) = NestedStencil(Stencil(;center)) | |
118 CenteredNestedStencil() = NestedStencil(CenteredStencil()) | |
119 | |
117 # Stencil input | 120 # Stencil input |
118 NestedStencil(s::Vararg{Stencil}; center) = NestedStencil(Stencil(s... ; center)) | 121 NestedStencil(s::Vararg{Stencil}; center) = NestedStencil(Stencil(s... ; center)) |
119 CenteredNestedStencil(s::Vararg{Stencil}) = NestedStencil(CenteredStencil(s...)) | 122 CenteredNestedStencil(s::Vararg{Stencil}) = NestedStencil(CenteredStencil(s...)) |
120 | 123 |
121 # Tuple input | 124 # Tuple input |
139 end | 142 end |
140 | 143 |
141 function Base.convert(::Type{NestedStencil{T,N,M}}, s::NestedStencil{S,N,M}) where {T,S,N,M} | 144 function Base.convert(::Type{NestedStencil{T,N,M}}, s::NestedStencil{S,N,M}) where {T,S,N,M} |
142 return NestedStencil{T,N,M}(s) | 145 return NestedStencil{T,N,M}(s) |
143 end | 146 end |
144 Base.convert(::Type{NestedStencil{T}}, stencil) where T = NestedStencil{T}(stencil) | 147 Base.convert(::Type{NestedStencil{T}}, stencil::NestedStencil) where T = NestedStencil{T}(stencil) |
145 | 148 |
146 function Base.promote_rule(::Type{NestedStencil{T,N,M}}, ::Type{NestedStencil{S,N,M}}) where {T,S,N,M} | 149 function Base.promote_rule(::Type{NestedStencil{T,N,M}}, ::Type{NestedStencil{S,N,M}}) where {T,S,N,M} |
147 return NestedStencil{promote_type(T,S),N,M} | 150 return NestedStencil{promote_type(T,S),N,M} |
148 end | 151 end |
149 | 152 |