def scale_nodes(L,N,delta=0.5,g=0.,d=0.): from quad import gq from spyctral.scaling import scale_factor [x,w] = gq(N,g=g,d=d) return scale_factor(L,x,delta=delta)
def mjwfft_overhead(N,s=1.,t=1.,shift=0.,scale=1.): from jfft import jacfft_overhead from maps import sqrt_wjacobiw from quad import gq A = s-1 B = t-1 A = int(A) B = int(B) # Use canonical quadrature points [x,w] = gq(N,s=1.,t=1.,scale=scale,shift=shift) # Must multiply by the sqrt of the Jacobian and then do FFT factors = sqrt_wjacobiw(x,s=s,t=t,scale=scale,shift=shift) jo = jacfft_overhead(N,A,B) return [factors, jo]
def mjwifft(U,s=1.,t=1.,shift=0.,scale=1.): from jfft import jacifft from maps import sqrt_wjacobiw from quad import gq A = s-1 B = t-1 A = int(A) B = int(B) N = U.size # Use canonical quadrature points [x,w] = gq(N,s=1.,t=1.,scale=scale,shift=shift) # Inverse transform u = jacifft(U,A,B) # Multiply by factors factors = sqrt_wjacobiw(x,s=s,t=t,scale=scale,shift=shift) return u*factors