@@ -8,7 +8,7 @@ ContinuousPolynomial{o}(pts) where {o} = ContinuousPolynomial{o,Float64}(pts)
88ContinuousPolynomial {o,T} (P:: ContinuousPolynomial ) where {o,T} = ContinuousPolynomial {o,T} (P. points)
99ContinuousPolynomial {o} (P:: ContinuousPolynomial ) where {o} = ContinuousPolynomial {o,eltype(P)} (P)
1010
11- PiecewisePolynomial (P:: ContinuousPolynomial{0 ,T} ) where {T} = PiecewisePolynomial (Legendre {T} (), P. points)
11+ PiecewisePolynomial (P:: ContinuousPolynomial{o ,T} ) where {o, T} = PiecewisePolynomial (Legendre {T} (), P. points)
1212
1313axes (B:: ContinuousPolynomial{0} ) = axes (PiecewisePolynomial (B))
1414axes (B:: ContinuousPolynomial{1} ) =
4444
4545factorize (V:: SubQuasiArray{T,N,<:ContinuousPolynomial{0},<:Tuple{Inclusion,BlockSlice}} , dims... ) where {T,N} =
4646 factorize (view (PiecewisePolynomial (parent (V)), parentindices (V)... ), dims... )
47- grid (V:: SubQuasiArray{T,N,<:ContinuousPolynomial{0},<:Tuple{Inclusion,Any}} ) where {T,N} =
48- grid (view (PiecewisePolynomial (parent (V)), parentindices (V)... ))
49- grid (V:: SubQuasiArray{T,N,<:ContinuousPolynomial,<:Tuple{Inclusion,Any}} ) where {T,N} =
50- grid (view (ContinuousPolynomial {0,T} (parent (V)), parentindices (V)... ))
47+
48+ plan_grid_transform (P:: ContinuousPolynomial{0} , args... ) = plan_grid_transform (PiecewisePolynomial (P), args... )
49+
50+ for grd in (:grid , :plotgrid )
51+ @eval $ grd (C:: ContinuousPolynomial , n... ) = $ grd (PiecewisePolynomial (C), n... )
52+ end
5153
5254function adaptivetransform_ldiv (Q:: ContinuousPolynomial{1,V} , f:: AbstractQuasiVector ) where V
5355 T = promote_type (V, eltype (f))
9496# ######
9597
9698function \ (P:: ContinuousPolynomial{0} , C:: ContinuousPolynomial{1} )
97- T = promote_type (eltype (P), eltype (C))
98- # diag blocks based on
99- # L = Legendre{T}() \ Weighted(Jacobi{T}(1,1))
100- @assert P. points == C. points
101- N = length (P. points)
102- v = mortar (Fill .((convert (T, 2 ): 2 : ∞) ./ (3 : 2 : ∞), N - 1 ))
103- z = Zeros {T} (axes (v))
104- H1 = BlockBroadcastArray (hcat, z, v)
105- M1 = BlockVcat (Zeros {T} (N, 2 ), H1)
106- M2 = BlockVcat (Ones {T} (N, 2 ) / 2 , Zeros {T} ((axes (v, 1 ), Base. OneTo (2 ))))
107- H3 = BlockBroadcastArray (hcat, z, - v)
108- M3 = BlockVcat (Hcat (Ones {T} (N) / 2 , - Ones {T} (N) / 2 ), H3)
109- dat = BlockHcat (M1, M2, M3)'
110- _BandedBlockBandedMatrix (dat, axes (P, 2 ), (1 , 1 ), (0 , 1 ))
111- end
112-
113- function \ (P:: ContinuousPolynomial{0, <:Any, <:AbstractRange} , C:: ContinuousPolynomial{1, <:Any, <:AbstractRange} )
11499 T = promote_type (eltype (P), eltype (C))
115100 @assert P. points == C. points
116101 v = (convert (T, 2 ): 2 : ∞) ./ (3 : 2 : ∞)
@@ -132,7 +117,7 @@ function grammatrix(A::ContinuousPolynomial{0,T}) where T
132117 N = length (r) - 1
133118 hs = diff (r)
134119 M = grammatrix (Legendre {T} ())
135- ArrowheadMatrix {T} (Diagonal (Fill (hs[ 1 ], N) ), (), (), [Diagonal (M. diag[2 : end ] * h/ 2 ) for h in hs])
120+ ArrowheadMatrix {T} (Diagonal (hs ), (), (), [Diagonal (M. diag[2 : end ] * h/ 2 ) for h in hs])
136121end
137122
138123function grammatrix (A:: ContinuousPolynomial{0,T, <:AbstractRange} ) where T
@@ -196,7 +181,7 @@ function diff(C::ContinuousPolynomial{1,T}; dims=1) where T
196181 H = BlockBroadcastArray (hcat, z, v)
197182 M = BlockVcat (Hcat (Ones {T} (N) .* [zero (T); s] , - Ones {T} (N) .* [s; zero (T)] ), H)
198183 P = ContinuousPolynomial {0} (C)
199- ApplyQuasiMatrix (* , P, _BandedBlockBandedMatrix (M' , ( axes (P, 2 ), axes (C, 2 ) ), (0 , 0 ), (0 , 1 )))
184+ ApplyQuasiMatrix (* , P, _BandedBlockBandedMatrix (M' , axes (P, 2 ), (0 , 0 ), (0 , 1 )))
200185end
201186
202187function weaklaplacian (C:: ContinuousPolynomial{1,T,<:AbstractRange} ) where T
@@ -210,3 +195,12 @@ function weaklaplacian(C::ContinuousPolynomial{1,T,<:AbstractRange}) where T
210195 Fill (Diagonal (convert (T, - 16 ) .* (1 : ∞) .^ 2 ./ (s .* ((2 : 2 : ∞) .+ 1 ))), N- 1 )))
211196end
212197
198+
199+
200+ # ##
201+ # singularities
202+ # ##
203+
204+ singularities (C:: ContinuousPolynomial{λ} ) where λ = C
205+ basis_singularities (C:: ContinuousPolynomial ) = C
206+ singularitiesbroadcast (_, C:: ContinuousPolynomial ) = C # Assume we stay smooth
0 commit comments