Accessing coefficient space data on the padded grid when dealiasing

30 views
Skip to first unread message

Semih Tuna

unread,
Jul 13, 2025, 7:39:32 AMJul 13
to Dedalus Users
Hello,

I am solving equations of MHD equations using Dedalus. As part of my (post-processing) analysis, I compute nonlinear expressions obtained from my fields and analyze them in the coefficient space. 

To do so, I read my coefficient space output data (in parallel) and perform operations using Dedalus expressions, evaluate them in coefficient space and later bin them in k-space to get scale-by-scale values of the quantities I am interested in. As far as I understand, when accessing coefficient space layout of a field resulting from a nonlinear expression, I think I loose information because Dedalus discards the padded modes when transforming from grid space to coefficient space. I was wondering whether I could access the full coefficient space data of a Dedalus field (including the padded modes), bypassing the discard phase of dealising.

Let me illustrate what I want to do in an example. Suppose I want to look at the correlation function 

f_lorentz@f_lorentz

where

J = -d3.Laplacian(A)
B = d3.curl(A)
f_lorentz = d3.cross(J, B)

My strategy was to get

np.sum(f_lorentz['c']*f_lorentz['c'], axis= 0)

and later bin this array in k-space to obtain scale-by-scale values of the correlation function. If done properly, the sum over the binned amplitudes should match what I would get from

d3.Average(f_lorentz@f_lorentz)

Indeed I confirmed that the routines I use for binning and summing over modes work perfectly for expressions like B@B, u@B (u is my velocity field): The sum over spectra matches d3.Average() values. However, the expressions involving nonlinear terms such as f_lorentz@f_lorentz don't match d3.Average() values. It seems to me that this is due to dealising, and indeed if I set large wavenumber modes of my fields to zero, nonlinear expressions also agree with d3.Average() values within machine precision.

My questions are:

(i) Can I access the coefficient space data of, e.g., f_lorentz, including the discarded modes during Fourier transform? I tried to do this myself by digging into Dedalus routines that compute Fourier transforms but I am a little confused about permuting axes etc. (I am performing these operations in parallel)

(ii) When computing f_lorentz@f_lorentz, I should also probably set dealias= 2 in my post-processing Dedalus bases, since the nonlinearity is quartic in this example?

I would appreciate any help you could provide me.

Regards,

Semih




Daniel Lecoanet

unread,
Jul 13, 2025, 6:32:23 PMJul 13
to dedalu...@googlegroups.com
Hi Semih,

You could perform your own FT of the dealiased data. For a quintic nonlinearity I believe you need a dealias factor of 5/2.

Daniel

On Jul 13, 2025, at 06:39, Semih Tuna <st3...@columbia.edu> wrote:

Hello,
--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dedalus-users/a13b7ee0-31fe-44ee-96d8-85158189608cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages