191191# Transforms
192192# ##
193193
194- const FiniteZernike{T} = SubQuasiArray{T,2 ,Zernike{T},<: Tuple {<: Inclusion ,<: BlockSlice{BlockRange1{OneTo{Int}}} }}
195-
196- function grid (S:: FiniteZernike{T} ) where T
197- N = blocksize (S,2 ) ÷ 2 + 1 # polynomial degree
198- M = 4 N- 3
194+ function grid (S:: Zernike{T} , B:: Block{1} ) where T
195+ N = Int (B) ÷ 2 + 1 # matrix rows
196+ M = 4 N- 3 # matrix columns
199197
200198 r = sinpi .((N .- (0 : N- 1 ) .- one (T)/ 2 ) ./ (2 N))
201199
@@ -206,26 +204,21 @@ end
206204
207205_angle (rθ:: RadialCoordinate ) = rθ. θ
208206
209- function plotgrid (S:: FiniteZernike{T } ) where T
210- N = blocksize (S, 2 ) ÷ 2 + 1 # polynomial degree
211- g = grid (parent (S)[:, Block .( OneTo (2 N))] ) # double sampling
207+ function plotgrid (S:: Zernike{T} , B :: Block{1 } ) where T
208+ N = Int (B ) ÷ 2 + 1 # polynomial degree
209+ g = grid (S, Block ( min (2 N, MAX_PLOT_BLOCKS)) ) # double sampling
212210 θ = [map (_angle,g[1 ,:]); 0 ]
213- [permutedims (RadialCoordinate .(1 ,θ)); g g[:,1 ]; permutedims (RadialCoordinate .(0 ,θ))]
214- end
215-
216- function plotgrid (S:: SubQuasiArray{<:Any,2,<:Zernike} )
217- kr,jr = parentindices (S)
218- Z = parent (S)
219- plotgrid (Z[kr,Block .(OneTo (Int (findblock (axes (Z,2 ),maximum (jr)))))])
211+ [permutedims (RadialCoordinate .(1 ,θ));
212+ g g[:,1 ];
213+ permutedims (RadialCoordinate .(0 ,θ))]
220214end
221215
222-
223216function plotvalues (u:: ApplyQuasiVector{T,typeof(*),<:Tuple{Zernike, AbstractVector}} , x) where T
224217 Z,c = u. args
225- CS = blockcolsupport (c )
226- N = Int (last (CS) ) ÷ 2 + 1 # polynomial degree
227- F = ZernikeITransform {T} (2 N , Z. a, Z. b)
228- C = F * c[Block .(OneTo (2 N ))] # transform to grid
218+ B = findblock ( axes (Z, 2 ), last ( colsupport (c)) )
219+ N = Int (B ) ÷ 2 + 1 # polynomial degree
220+ F = ZernikeITransform {T} (min ( 2 N, MAX_PLOT_BLOCKS) , Z. a, Z. b)
221+ C = F * c[Block .(OneTo (min ( 2 N, MAX_PLOT_BLOCKS) ))] # transform to grid
229222 [permutedims (u[x[1 ,:]]); # evaluate on edge of disk
230223 C C[:,1 ];
231224 fill (u[x[end ,1 ]], 1 , size (x,2 ))] # evaluate at origin and repeat
262255* (P:: ZernikeTransform{T} , f:: Matrix{T} ) where T = ModalTrav (P. disk2cxf \ (P. analysis * f))
263256* (P:: ZernikeITransform , f:: AbstractVector ) = P. synthesis * (P. disk2cxf * ModalTrav (f). matrix)
264257
265- factorize (S :: FiniteZernike {T} ) where T = TransformFactorization ( grid (S ), ZernikeTransform {T} (blocksize (S, 2 ), parent (S) . a, parent (S) . b) )
258+ plan_grid_transform (Z :: Zernike {T}, B :: Tuple{Block{1}} , dims = 1 : 1 ) where T = grid (Z,B[ 1 ] ), ZernikeTransform {T} (Int (B[ 1 ] ), Z . a, Z . b )
266259
260+ # #
261+ # Laplacian
262+ # ##
267263
268264@simplify function * (Δ:: Laplacian , WZ:: Weighted{<:Any,<:Zernike} )
269265 @assert WZ. P. a == 0 && WZ. P. b == 1
0 commit comments