comparison sbpD2.jl @ 122:6c6979ff17f4 cell_based_test

Introduce and use apply_backwards for stencils
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 12 Feb 2019 15:18:18 +0100
parents 19031733bbbf
children 1aaeb46ba5f4
comparison
equal deleted inserted replaced
121:3560f54e3eb3 122:6c6979ff17f4
9 return @inbounds apply(op.innerStencil, v, Int(i))/h^2 9 return @inbounds apply(op.innerStencil, v, Int(i))/h^2
10 end 10 end
11 11
12 @inline function apply(op::ConstantStencilOperator, h::Real, v::AbstractVector, i::Index{Upper}) 12 @inline function apply(op::ConstantStencilOperator, h::Real, v::AbstractVector, i::Index{Upper})
13 N = length(v) 13 N = length(v)
14 return @inbounds Int(op.parity)*apply(flip(op.closureStencils[N-Int(i)+1]), v, Int(i))/h^2 14 return @inbounds Int(op.parity)*apply_backwards(op.closureStencils[N-Int(i)+1], v, Int(i))/h^2
15 end 15 end
16 16
17 @inline function apply(op::ConstantStencilOperator, h::Real, v::AbstractVector, index::Index{Unknown}) 17 @inline function apply(op::ConstantStencilOperator, h::Real, v::AbstractVector, index::Index{Unknown})
18 cSize = closureSize(op) 18 cSize = closureSize(op)
19 N = length(v) 19 N = length(v)