diff src/SbpOperators/readoperator.jl @ 671:e14627e79a54 feature/stencil_convenience

Add stencil constructor for centered stencils and change from tuple to vararg in stencil constructor taking cneter
author Jonatan Werpers <jonatan@werpers.com>
date Sat, 06 Feb 2021 21:42:57 +0100
parents 4a81812150f4
children fdd48f6ace1c
line wrap: on
line diff
--- a/src/SbpOperators/readoperator.jl	Sun Jan 31 20:57:58 2021 +0100
+++ b/src/SbpOperators/readoperator.jl	Sat Feb 06 21:42:57 2021 +0100
@@ -26,13 +26,13 @@
         closureStencils = (closureStencils..., get_stencil(operators, "D2", "closure_stencils", i; center=i))
     end
     # TODO: Get rid of the padding here. Any padding should be handled by the consturctor accepting the stencils.
-    eClosure = Stencil(pad_tuple(toml_string_array_to_tuple(Float64, e["closure"]), boundarySize), center=1)
-    dClosure = Stencil(pad_tuple(toml_string_array_to_tuple(Float64, d1["closure"]), boundarySize), center=1)
+    eClosure = Stencil(pad_tuple(toml_string_array_to_tuple(Float64, e["closure"]), boundarySize)..., center=1)
+    dClosure = Stencil(pad_tuple(toml_string_array_to_tuple(Float64, d1["closure"]), boundarySize)..., center=1)
 
     q_tuple = pad_tuple(toml_string_array_to_tuple(Float64, H["closure"]), boundarySize)
     quadratureClosure = Vector{typeof(innerStencil)}()
     for i ∈ 1:boundarySize
-        quadratureClosure = (quadratureClosure..., Stencil((q_tuple[i],), center=1))
+        quadratureClosure = (quadratureClosure..., Stencil(q_tuple[i], center=1))
     end
 
     d2 = SbpOperators.D2(
@@ -99,7 +99,7 @@
         center = div(width,2)+1
     end
 
-    return Stencil(Tuple(stencil_weights), center=center)
+    return Stencil(stencil_weights..., center=center)
 end
 
 """