diff sbpD2.jl @ 68:d485da6e3a77 cell_based_test

Make D2 more type stable
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 17 Jan 2019 16:04:07 +0100
parents 27a8d3021a1c
children 4640839b1616 fbf7398f8154
line wrap: on
line diff
--- a/sbpD2.jl	Thu Jan 17 15:52:25 2019 +0100
+++ b/sbpD2.jl	Thu Jan 17 16:04:07 2019 +0100
@@ -22,8 +22,8 @@
 
 struct D2{T} <: ConstantStencilOperator
     quadratureClosure::Vector{T}
-    innerStencil::Stencil
-    closureStencils::Vector{Stencil} # TBD: Should this be a tuple?
+    innerStencil::Stencil{T}
+    closureStencils::Vector{Stencil{T}} # TBD: Should this be a tuple?
     eClosure::Vector{T}
     dClosure::Vector{T}
     parity::Parity
@@ -46,7 +46,7 @@
 
     # Create boundary stencils
     boundarySize = length(d["boundary_stencils"])
-    closureStencils = Vector{Stencil}()
+    closureStencils = Vector{typeof(innerStencil)}() # TBD: is the the right way to get the correct type?
 
     for i ∈ 1:boundarySize
         stencilWeights = stringToVector(Float64, d["boundary_stencils"][i])