comparison src/SbpOperators/stencil.jl @ 1758:d8fabe814d06 feature/jet_aqua

Fix unbound parameters for NestedStencil
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 13 Sep 2024 13:33:17 +0200
parents 8b9cdadb845a
children d28562d5ca8f
comparison
equal deleted inserted replaced
1757:3bf4677b67c7 1758:d8fabe814d06
115 # Stencil input 115 # Stencil input
116 NestedStencil(s::Vararg{Stencil}; center) = NestedStencil(Stencil(s... ; center)) 116 NestedStencil(s::Vararg{Stencil}; center) = NestedStencil(Stencil(s... ; center))
117 CenteredNestedStencil(s::Vararg{Stencil}) = NestedStencil(CenteredStencil(s...)) 117 CenteredNestedStencil(s::Vararg{Stencil}) = NestedStencil(CenteredStencil(s...))
118 118
119 # Tuple input 119 # Tuple input
120 function NestedStencil(weights::Vararg{NTuple{N,Any}}; center) where N 120 function NestedStencil(weights::Vararg{NTuple{N,Any} where N}; center)
121 inner_stencils = map(w -> Stencil(w...; center), weights) 121 inner_stencils = map(w -> Stencil(w...; center), weights)
122 return NestedStencil(Stencil(inner_stencils... ; center)) 122 return NestedStencil(Stencil(inner_stencils... ; center))
123 end 123 end
124 function CenteredNestedStencil(weights::Vararg{NTuple{N,Any}}) where N 124
125 function CenteredNestedStencil(weights::Vararg{NTuple{N,Any} where N})
125 inner_stencils = map(w->CenteredStencil(w...), weights) 126 inner_stencils = map(w->CenteredStencil(w...), weights)
126 return CenteredNestedStencil(inner_stencils...) 127 return CenteredNestedStencil(inner_stencils...)
127 end 128 end
128
129 129
130 # Conversion 130 # Conversion
131 function NestedStencil{T,N,M}(ns::NestedStencil{S,N,M}) where {T,S,N,M} 131 function NestedStencil{T,N,M}(ns::NestedStencil{S,N,M}) where {T,S,N,M}
132 return NestedStencil(Stencil{Stencil{T}}(ns.s)) 132 return NestedStencil(Stencil{Stencil{T}}(ns.s))
133 end 133 end