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

Commit ce4d693

Browse files
Merge pull request #299 from grahamas/ghost_mul
mul! for GhostDerivativeOperators
2 parents 543d151 + abe42af commit ce4d693

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/derivative_operators/ghost_derivative_operator.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ function *(L::AbstractDiffEqCompositeOperator{T}, Q::AbstractBC{T}) where{T}
1111
return sum(map(op -> op * Q, L.ops))
1212
end
1313

14+
function LinearAlgebra.mul!(out::AbstractArray, A::GhostDerivativeOperator, u::AbstractArray)
15+
padded = A.Q * u # assume: creates boundary padded array w/o realloc
16+
LinearAlgebra.mul!(out, A.L, padded)
17+
end
18+
1419
function *(A::GhostDerivativeOperator{T1}, u::AbstractArray{T2}) where {T1,T2}
1520
#TODO Implement a function domaincheck(L::AbstractDiffEqLinearOperator, u) to see if components of L along each dimension match the size of u
1621
x = zeros(promote_type(T1,T2), unpadded_size(u))
17-
LinearAlgebra.mul!(x, A.L, A.Q*u)
22+
LinearAlgebra.mul!(x, A, u)
1823
return x
1924
end
2025

0 commit comments

Comments
 (0)