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

Commit 021c60d

Browse files
committed
Added Array concretization for PeriodicBC
and size(Q::BoundaryPaddedArray)
1 parent 7ce6675 commit 021c60d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/derivative_operators/BC_operators.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ Base.:*(Q::AffineBC, u) = BoundaryPaddedVector(Q.a_l ⋅ u[1:length(Q.a_l)] + Q.
129129

130130
Base.size(Q::AbstractBC) = (Inf, Inf) #Is this nessecary?
131131
Base.length(Q::BoundaryPaddedVector) = length(Q.u) + 2
132+
Base.size(Q::BoundaryPaddedVector) = (length(Q),)
132133
Base.lastindex(Q::BoundaryPaddedVector) = Base.length(Q)
133134

134135
function Base.getindex(Q::BoundaryPaddedVector,i)
@@ -148,6 +149,12 @@ function LinearAlgebra.Array(Q::AffineBC{T,V}, N::Int) where {T,V}
148149
return (Q_L, Q_b)
149150
end
150151

152+
LinearAlgebra.Array(Q::PeriodicBC{T}, N::Int) where T = [transpose(zeros(T, N-1)) one(T); Diagonal(ones(T,N)); one(T) transpose(zeros(T, N-1))]
153+
#TODO: Concretize DirichletBC
154+
155+
151156
function LinearAlgebra.Array(Q::BoundaryPaddedVector)
152157
return [Q.l; Q.u; Q.r]
153158
end
159+
160+
#TODO: Implement Sparse concretization

0 commit comments

Comments
 (0)