Hello,
I recently used the example in "ExampleCodes/FFT/EnergySpectrum" to compute turbulent kinetic energy. The result of the calculation from the spectrum was found to be different from a calculation from velocities in the case of isotropic homogeneous turbulence. On further investigation, this is because the R2C Hermitian output array is of size (nx/2+1,ny,nz).
I solve the problem using C2C representing the input array as complex numbers with imaginary part = 0. This way you get the full complex output. Another possibility could be to use the Hermitian symmetry to reconstruct the full output.
@WeiqunZhang I'm tagging you here because I see you've created this example. Do you want me to create a pull request with my solution (i.e. using C2C instead of R2C)?
Thank you