CExA-project / ddc

DDC is a discrete domain computation library.
https://ddc.mdls.fr
Other
32 stars 3 forks source link

How to retrieve null frequency for the discrete fourier transform #144

Open tpadioleau opened 1 year ago

tpadioleau commented 1 year ago

In the context of solving the Poisson equation one needs to identify the null frequency as a particular case. For now the user has to assume the null frequency is on the first position of the fourier domain. I think it can be improved.

blegouix commented 1 month ago

I would say, because of: https://github.com/CExA-project/ddc/blob/f2aea58fa84787a750790d62b96b45e39ff72e77/include/ddc/kernels/fft.hpp#L595

And the way FFT is performed by backends, the mode 0 is necessarily at ddc::DiscreteElement<DDimFx>(0), which makes sense and is enough no ?

tpadioleau commented 1 month ago

It should then be an attribute of the discrete dimension IMO. The user should not have to create this discrete element by itself

blegouix commented 1 month ago

For me, if user wants mode 3 he do ddc::DiscreteElement<DDimFx>(3), and this is the same for mode 0, the same logic we have for Deriv type (1 is first derivative, 2 second one etc...). So I am not sure to understand the issue here.