Mercurial > repos > public > sbplib_julia
diff sbpD2.jl @ 94:84b1ad5a3755 stencil_index
Made everything work(?) but also go really slow. And also not type-stable.
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Mon, 04 Feb 2019 16:09:07 +0100 |
parents | 93df72e2b135 |
children |
line wrap: on
line diff
--- a/sbpD2.jl Mon Feb 04 09:13:48 2019 +0100 +++ b/sbpD2.jl Mon Feb 04 16:09:07 2019 +0100 @@ -15,15 +15,15 @@ return uᵢ end -Base.@propagate_inbounds function apply(op::ConstantStencilOperator, h::Real, v::AbstractVector, i::Int, ::InteriorIndex) +Base.@propagate_inbounds function apply(op::ConstantStencilOperator, h::Real, v::AbstractVector, i::Int, ::StencilIndex{Interior}) return apply(op.innerStencil, v, i)/h^2 end -Base.@propagate_inbounds function apply(op::ConstantStencilOperator, h::Real, v::AbstractVector, i::Int, ::LowerClosureIndex) +Base.@propagate_inbounds function apply(op::ConstantStencilOperator, h::Real, v::AbstractVector, i::Int, ::StencilIndex{Lower}) return apply(op.closureStencils[i], v, i)/h^2 end -Base.@propagate_inbounds function apply(op::ConstantStencilOperator, h::Real, v::AbstractVector, i::Int, ::UpperClosureIndex) +Base.@propagate_inbounds function apply(op::ConstantStencilOperator, h::Real, v::AbstractVector, i::Int, ::StencilIndex{Upper}) N = length(v) return Int(op.parity)*apply(flip(op.closureStencils[N-i+1]), v, i)/h^2 #TODO: Write an applybackwards instead? end