💡 Did you know that #FluidFFT lets you do much more than computing #FourierTransform and its inverse?

With an "OperatorsPseudoSpectral2D" (or 3D) class you can compute transforms, compute derivatives, divergence, curl, gradients, apply dealiasing etc easily and efficiently!

You don't have to grok how FFTs are arranged numerically and what wave numbers are. It simplifies things. Here is an example from the archives

https://fluiddyn.netlify.app/intensely-edgy-cat-with-fluidfft

https://fluidfft.readthedocs.io/en/latest/generated/fluidfft.fft2d.operators.html

#pseudospectral

Intensely edgy cat with FluidFFT

This is a reimplementaion of Patrick Bos's notebook which showcases xtensor-fftw. Here, we use fluidfft instead. Setup¶ In [1]: import fluidfft # fft, ifft and other operators import numpy as np # numpy arrays! # for displaying images from PIL import Image import urllib import io import matplotlib.pyplot as plt In [2]: # We go one step further and directly load from the internet

FluidDyn blog

#TIL how Fourier transforms and #pseudospectral methods are intimately related to #FEM. What was missing from the picture is how a tool for numerical integration could be used for numerical differentiation.

If you think about it, Fourier transforms are also expressed as integration over an interval in space. When you differentiate a function it only affects the basis. For example:

exp(ikx) -> ik * exp(ikx)

1/2