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

Replace SWFFT #27

Closed
ajnonaka opened this issue Apr 14, 2021 · 2 comments
Closed

Replace SWFFT #27

ajnonaka opened this issue Apr 14, 2021 · 2 comments

Comments

@ajnonaka
Copy link
Contributor

The current SWFFT implementation of the structure factor is a bit brittle in parallel (only works for sure if the # of processors = the # of grids; the actual requirement may be slightly looser but this may not be coded up correctly on our end)

We may want to consider what WarpX does using standard FFTW libraries.

Also, the shifting algorithm (to put k=0 in the center) is performed on one grid and eventually may not fit in memory for large problems.

@ajnonaka
Copy link
Contributor Author

ajnonaka commented Jun 9, 2021

In https://github.com/ajnonaka/fft-test.git directory fft-test/local I have a serial implementation of fftw given input multifab data. I figured out the complex conjugate reflecting to make it match SWFFT (which needs to be shifted again to put k=0 at the center)

For domains from (0,0,0) to (Nx-1,Ny-1,Nz-1)

For any cells with i index >= Nx/2, these values are complex conjugates of the corresponding entry where (Nx-i,Ny-j,Nz-k) UNLESS that index is zero, in which case you use 0.

e.g. for an 8^3 domain, any cell with i index

Cell (6,2,3) is complex conjugate of (2,6,5)

Cell (4,1,0) is complex conjugate of (4,7,0) (note that the FFT is computed for 0 <= i <= Nx/2)

@ajnonaka
Copy link
Contributor Author

I believe for all the structure factor FFTs (including flattened multifabs 3D->2D and 2D->1D) that serial FFTW has now been implemented. I have tested this for both dimensionalities, full and flattened multifabs, parallel runs with multiple grids on the regular domain, and non-cubic domains. Leaving this issue open until a few more tests have been run.

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

1 participant