Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modification of spectral fields in IFFT #9

Open
tb6g16 opened this issue Dec 17, 2021 · 1 comment
Open

Modification of spectral fields in IFFT #9

tb6g16 opened this issue Dec 17, 2021 · 1 comment

Comments

@tb6g16
Copy link
Member

tb6g16 commented Dec 17, 2021

Turns out that one (of possibly more) errors with the local residual was the modification of the spectral field during the IFFT.

To remedy I have added a couple methods with an extra auxiliary spectral field that can be modified during the transform without problem. This obviously isn't particularly desirable since it necessitates an extra spectral array. The ultimate solution will probably come from digging through the docs in extreme detail (I've had a cursory look already and found nothing).

Fields.jl/src/fft.jl

Lines 92 to 102 in 0741e73

function (f::IFFTPlan!{Ny, Nz, Nt})(u::PhysicalField{Ny, Nz, Nt},
::SpectralField{Ny, Nz, Nt},
û_tmp::SpectralField{Ny, Nz, Nt}) where {Ny, Nz, Nt}
# copy spectral contents to temporary field
û_tmp .=
# perform transform
FFTW.unsafe_execute!(f.plan, parent(û_tmp), parent(u))
return u
end

@gasagna
Copy link
Member

gasagna commented Jan 17, 2022

As referenced in #11 (which can be closed), it's fine to have this method. Only use it where necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants