From b3e899e34c12f53a71f57449566eb90d533d09ef Mon Sep 17 00:00:00 2001 From: Adam Jozefiak Date: Mon, 10 Jun 2019 04:39:01 -0700 Subject: [PATCH] convolutions for DerivativeOperator * AbstractVector fixed --- src/derivative_operators/convolutions.jl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/derivative_operators/convolutions.jl b/src/derivative_operators/convolutions.jl index 66ad01934..3bf322b13 100644 --- a/src/derivative_operators/convolutions.jl +++ b/src/derivative_operators/convolutions.jl @@ -22,7 +22,7 @@ function convolve_interior!(x_temp::AbstractVector{T}, x::AbstractVector{T}, A:: end end -function convolve_BC_left!(x_temp::AbstractVector{T}, x::AbstractVector, A::DerivativeOperator{T,S}) where {T<:Real,S<:SVector} +function convolve_BC_left!(x_temp::AbstractVector{T}, x::AbstractVector{T}, A::DerivativeOperator{T,S}) where {T<:Real,S<:SVector} coeffs = A.low_boundary_coefs Threads.@threads for i in 1 : A.boundary_length xtempi = coeffs[i][1]*x[1] @@ -33,15 +33,14 @@ function convolve_BC_left!(x_temp::AbstractVector{T}, x::AbstractVector, A::Deri end end -function convolve_BC_right!(x_temp::AbstractVector{T}, x::AbstractVector, A::DerivativeOperator{T,S}) where {T<:Real,S<:SVector} - coeffs = A.low_boundary_coefs - bc_start = length(x) - A.stencil_length +function convolve_BC_right!(x_temp::AbstractVector{T}, x::AbstractVector{T}, A::DerivativeOperator{T,S}) where {T<:Real,S<:SVector} + coeffs = A.high_boundary_coefs Threads.@threads for i in 1 : A.boundary_length xtempi = coeffs[i][end]*x[end] - @inbounds for idx in A.stencil_length:-1:2 + @inbounds for idx in A.stencil_length:-1:1 xtempi += coeffs[i][end-idx] * x[end-idx] end - x_temp[i] = xtempi + x_temp[end-A.boundary_length+i] = xtempi end end