project_fft_on_realX doesn't work as expected for FFTWPY
Created originally on Bitbucket by avmo (Ashwin Vishnu)
I found the forcing array generated by compute_forcingc_raw
function to contain some complex values in (ky,kx)=(0,0),(0,kmax),(kmax,0),(kmax,kmax) rows and columns.
#!python
class RamdomSimplePseudoSpectral(NormalizedForcing):
tag = 'random'
def compute_forcingc_raw(self):
"""Random coarse forcing.
To be called only with proc 0.
"""
F_fft = self.oper_coarse.random_arrayK()
self.oper_coarse.project_fft_on_realX(F_fft)
F_fft[self.COND_NO_F] = 0.
return F_fft
This was because project_fft_on_realX
for FFTWPY returns the projected array and not operates on the same array. Correct me if I am wrong.
I replaced that with project_fft_on_realX_seq
in operators_cy as a workaround.