def qapamfft_from_etafft(self, eta_fft, params=None): """eta (fft) ---> q, ap, am (fft)""" if params is None: params = self.params q_fft = -params.f * eta_fft ap_fft = 0.5 * laplacian_fft(eta_fft, self.K2) am_fft = ap_fft.copy() return q_fft, ap_fft, am_fft
def afft_from_uxuyetafft(self, ux_fft, uy_fft, eta_fft, params=None): if params is None: params = self.params a_fft = laplacian_fft(eta_fft, self.K2) if params.f != 0: rot_fft = self.rotfft_from_vecfft(ux_fft, uy_fft) a_fft += params.f / params.c2 * rot_fft return a_fft
def qdafft_from_uxuyetafft(self, ux_fft, uy_fft, eta_fft, params=None): if params is None: params = self.params div_fft = self.divfft_from_vecfft(ux_fft, uy_fft) rot_fft = self.rotfft_from_vecfft(ux_fft, uy_fft) q_fft = rot_fft - params.f * eta_fft ageo_fft = params.f / params.c2 * rot_fft + laplacian_fft( eta_fft, self.K2 ) return q_fft, div_fft, ageo_fft
def rotfft_from_qfft(self, q_fft, params=None): """Compute ux, uy and eta in Fourier space.""" if params is None: params = self.params Kappa2_not0 = self.Kappa2_not0 else: Kappa2_not0 = self.K2_not0 + params.kd2 rot_fft = laplacian_fft( invlaplacian_fft(q_fft, Kappa2_not0, rank), self.K2 ) return rot_fft
def uxuyetafft_from_qfft(self, q_fft, params=None): """Compute ux, uy and eta in Fourier space.""" if params is None: params = self.params Kappa2_not0 = self.Kappa2_not0 else: Kappa2_not0 = self.K2_not0 + params.kd2 ilq_fft = invlaplacian_fft(q_fft, Kappa2_not0, rank) rot_fft = laplacian_fft(ilq_fft, self.K2) ux_fft, uy_fft = self.vecfft_from_rotfft(rot_fft) if params.f == 0: eta_fft = self.create_arrayK(value=0) else: eta_fft = -params.f * ilq_fft / params.c2 return ux_fft, uy_fft, eta_fft