SpFFT | Sparse 3D FFT library with MPI , OpenMP , CUDA and ROCm | GPU library
kandi X-RAY | SpFFT Summary
kandi X-RAY | SpFFT Summary
SpFFT - A 3D FFT library for sparse frequency domain data written in C++ with support for MPI, OpenMP, CUDA and ROCm. Inspired by the need of some computational material science applications with spherical cutoff data in frequency domain, SpFFT provides Fast Fourier Transformations of sparse frequency domain data. For distributed computations with MPI, slab decomposition in space domain and pencil decomposition in frequency domain (sparse data within a pencil / column must be on one rank) is used. Fig. 1: Illustration of a transform, where data on each MPI rank is identified by color.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of SpFFT
SpFFT Key Features
SpFFT Examples and Code Snippets
#include
#include
#include
#include "spfft/spfft.hpp"
int main(int argc, char** argv) {
const int dimX = 2;
const int dimY = 2;
const int dimZ = 2;
std::cout << "Dimensions: x = " << dimX << ", y = " << dimY <
mkdir build
cd build
cmake .. -DSPFFT_OMP=ON -DSPFFT_MPI=ON -DSPFFT_GPU_BACKEND=CUDA -DSPFFT_SINGLE_PRECISION=OFF -DCMAKE_INSTALL_PREFIX=/usr/local
make -j8 install
Community Discussions
Trending Discussions on SpFFT
QUESTION
I want to Fourier transform a function psi(x)
, multiply it by a k-space function exp(-kx^2-ky^2)
, and then inverse Fourier transform the product back to x-space.
But my x-space and k-space grids are centred, and I know that I need fftshift
and ifftshift
to implement my k-space multiplication properly. But I don't understand how they work, so I don't know in which order to implement them. Could someone please tell me if I have done it correctly here?
ANSWER
Answered 2017-Feb-12 at 02:56No you haven’t, but that’s ok, it can be very confusing.
First thing: fft
and ifft
require the origin to be in the beginning of the vector (or in your 2D case, in the top-left of the array). Is the input psi
’s origin centered like KX
? If so, its origin must be shifted to the beginning with ifftshift
. (If not, then just leave it alone.)
Second: since KX
and KY
have origins in their centers, you have to unshift them: you need spfft.ifftshift(np.exp(-(KX**2 + KY**2))
(note the i
).
Finally: your output psi
will therefore have its origin in the beginning. If you want its origin to be centered like KX
, fftshift
it.
In summary:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SpFFT
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page