You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2023. It is now read-only.
high_boundary_coefs =convert(SVector{boundary_point_count},reverse(SVector{boundary_stencil_length, T}[reverse(low_boundary_coefs[i]) for i in1:boundary_point_count]))
Copy file name to clipboardExpand all lines: src/derivative_operators/derivative_operator_functions.jl
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
2
+
# Fallback mul! implementation for a single DerivativeOperator operating on an AbstractArray
1
3
function LinearAlgebra.mul!(x_temp::AbstractArray{T}, A::DerivativeOperator{T,N}, M::AbstractArray{T}) where {T<:Real,N}
2
4
3
5
# Check that x_temp has correct dimensions
@@ -25,6 +27,8 @@ function LinearAlgebra.mul!(x_temp::AbstractArray{T}, A::DerivativeOperator{T,N}
25
27
end
26
28
end
27
29
30
+
# A more efficient mul! implementation for a single, regular-grid, centered difference
31
+
# DerivativeOperator operating on a 2D or 3D AbstractArray
28
32
for MT in [2,3]
29
33
@evalbegin
30
34
function LinearAlgebra.mul!(x_temp::AbstractArray{T,$MT}, A::DerivativeOperator{T,N,false,T2,S1}, M::AbstractArray{T,$MT}) where {T<:Real,N,T2,SL,S1<:SArray{Tuple{SL},T,1,SL}}
@@ -92,9 +96,17 @@ function *(A::DerivativeOperator{T,N},M::AbstractArray{T}) where {T<:Real,N}
92
96
return x_temp
93
97
end
94
98
95
-
# Will eventually implement proper dispatch
99
+
# A more efficient mul! implementation for a composition of regular-grid, centered difference
100
+
# DerivativeOperator operating on a 2D or 3D AbstractArray
96
101
function LinearAlgebra.mul!(x_temp::AbstractArray{T,2}, A::AbstractDiffEqCompositeOperator, M::AbstractArray{T,2}) where {T}
97
102
103
+
#Check that composite operator satisfies: regular-grid, centered difference:
104
+
#for L in A.ops
105
+
# if L ... (does not satisfy conditions)
106
+
# return (call fall back for multiplication of composite operators)
107
+
# end
108
+
#end
109
+
98
110
ndimsM =ndims(M)
99
111
Wdims =ones(Int64,ndimsM)
100
112
pad =zeros(Int64, ndimsM)
@@ -121,7 +133,7 @@ function LinearAlgebra.mul!(x_temp::AbstractArray{T,2}, A::AbstractDiffEqComposi
0 commit comments