Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Commit 0e66af1

Browse files
Merge pull request #104 from JuliaDiffEq/convolutions
[WIP] Fixing Convolutions
2 parents 012b63d + b3e899e commit 0e66af1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/derivative_operators/convolutions.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function convolve_interior!(x_temp::AbstractVector{T}, x::AbstractVector{T}, A::
2222
end
2323
end
2424

25-
function convolve_BC_left!(x_temp::AbstractVector{T}, x::AbstractVector, A::DerivativeOperator{T,S}) where {T<:Real,S<:SVector}
25+
function convolve_BC_left!(x_temp::AbstractVector{T}, x::AbstractVector{T}, A::DerivativeOperator{T,S}) where {T<:Real,S<:SVector}
2626
coeffs = A.low_boundary_coefs
2727
Threads.@threads for i in 1 : A.boundary_length
2828
xtempi = coeffs[i][1]*x[1]
@@ -33,15 +33,14 @@ function convolve_BC_left!(x_temp::AbstractVector{T}, x::AbstractVector, A::Deri
3333
end
3434
end
3535

36-
function convolve_BC_right!(x_temp::AbstractVector{T}, x::AbstractVector, A::DerivativeOperator{T,S}) where {T<:Real,S<:SVector}
37-
coeffs = A.low_boundary_coefs
38-
bc_start = length(x) - A.stencil_length
36+
function convolve_BC_right!(x_temp::AbstractVector{T}, x::AbstractVector{T}, A::DerivativeOperator{T,S}) where {T<:Real,S<:SVector}
37+
coeffs = A.high_boundary_coefs
3938
Threads.@threads for i in 1 : A.boundary_length
4039
xtempi = coeffs[i][end]*x[end]
41-
@inbounds for idx in A.stencil_length:-1:2
40+
@inbounds for idx in A.stencil_length:-1:1
4241
xtempi += coeffs[i][end-idx] * x[end-idx]
4342
end
44-
x_temp[i] = xtempi
43+
x_temp[end-A.boundary_length+i] = xtempi
4544
end
4645
end
4746

0 commit comments

Comments
 (0)