comparison sbpD2.jl @ 80:700a74c41b26 patch_based_test

Improve type stability
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 24 Jan 2019 14:33:49 +0100
parents 8c4cfa680e5a
children 7f72e7e14659
comparison
equal deleted inserted replaced
79:015bd5f33a54 80:700a74c41b26
26 even = 1 26 even = 1
27 end 27 end
28 28
29 struct D2{T} <: ConstantStencilOperator 29 struct D2{T} <: ConstantStencilOperator
30 quadratureClosure::Vector{T} 30 quadratureClosure::Vector{T}
31 innerStencil::Stencil 31 innerStencil::Stencil{T}
32 closureStencils::Vector{Stencil} # TBD: Should this be a tuple? 32 closureStencils::Vector{Stencil{T}} # TBD: Should this be a tuple?
33 eClosure::Vector{T} 33 eClosure::Vector{T}
34 dClosure::Vector{T} 34 dClosure::Vector{T}
35 parity::Parity 35 parity::Parity
36 end 36 end
37 37
50 50
51 innerStencil = Stencil(r, innerStencilWeights) 51 innerStencil = Stencil(r, innerStencilWeights)
52 52
53 # Create boundary stencils 53 # Create boundary stencils
54 boundarySize = length(d["boundary_stencils"]) 54 boundarySize = length(d["boundary_stencils"])
55 closureStencils = Vector{Stencil}() 55 closureStencils = Vector{typeof(innerStencil)}()
56 56
57 for i ∈ 1:boundarySize 57 for i ∈ 1:boundarySize
58 stencilWeights = stringToVector(Float64, d["boundary_stencils"][i]) 58 stencilWeights = stringToVector(Float64, d["boundary_stencils"][i])
59 width = length(stencilWeights) 59 width = length(stencilWeights)
60 r = (1-i,width-i) 60 r = (1-i,width-i)