0
votes

I have a 3D array of real data that I'd like to transform with a either a DST or DCT along one axis and normal DFT's along the other two axes. The result should be a 3D complex array that holds this transformation's coefficients.

Do you know if the FFTW3 package offers such a routine - possibly in parallel - out of the box? FFTW3 provides such a routine for a simple 3D DFT in all three directions.

And if not, would you might have a hint on how to achieve it the best way in C/C++?

My naive idea: Assembly of DST/DCT followed by a 2D real-to-complex transformation along the first axis inside some wrapping routine. Then, one could think of a 1D decomposition to achieve the parallelism. A 2D would be nicer but much more work.

PS: This transformation is used in a spectral method for solving the Navier-Stokes equation.

1
Have you looked at FFTPACK (note that this is an old Fortran library, old enough that I think it was still FORTRAN....)ad absurdum
Thanks for your help. Yes I did do so. However, FFTPACK is a little slower than FFTW. Also, FFTW offers all building blocks for the needed transformation already so it is just a matter of how to assemble it.mrdy
@DavidBowling What do you mean by old enough? 2decomp.org , github.com/sdsc/p3dfft , ...Vladimir F
@VladimirF-- what I meant is that FFTPACK dates from the days when Fortran was still called FORTRAN, i.e., before Fortran 90. It was just a joke... FFTPACK has been around a long time ;)ad absurdum
David Bowling, I see. BTW @mrdy those libraries I linked provide better parallel decompositions than that one in FFTW. Also there is github.com/mpip/pfft which brings better parallel decompositions over FFTW.Vladimir F

1 Answers

0
votes

Your naive idea is the way to go. Individual dimensions can be transformed independently.