![]() |
OpenPFC
0.1.4
Phase Field Crystal simulation framework
|
Fast Fourier Transform interface for spectral methods. More...
#include "core/decomposition.hpp"#include "openpfc/backends/heffte_adapter.hpp"#include "openpfc/core/backend_tags.hpp"#include "openpfc/core/databuffer.hpp"#include "openpfc/core/world.hpp"#include "openpfc/fft/kspace.hpp"#include <heffte.h>#include <iostream>#include <memory>#include <mpi.h>

Go to the source code of this file.
Classes | |
| struct | pfc::fft::layout::FFTLayout |
| Structure to hold the layout of FFT data. More... | |
| struct | pfc::fft::IFFT |
| struct | pfc::fft::FFT_Impl< BackendTag > |
| FFT class for distributed-memory parallel Fourier transforms. More... | |
Typedefs | |
| using | pfc::fft::layout::box3di = heffte::box3d< int > |
| using | pfc::fft::layout::Decomposition = pfc::decomposition::Decomposition |
| using | pfc::fft::Decomposition = pfc::decomposition::Decomposition |
| using | pfc::fft::RealVector = std::vector< double > |
| using | pfc::fft::ComplexVector = std::vector< std::complex< double > > |
| using | pfc::fft::box3di = heffte::box3d< int > |
| Type alias for 3D integer box. | |
| using | pfc::fft::RealDataBuffer = core::DataBuffer< backend::CpuTag, double > |
| using | pfc::fft::ComplexDataBuffer = core::DataBuffer< backend::CpuTag, std::complex< double > > |
| using | pfc::fft::fft_r2c = heffte::fft3d_r2c< heffte::backend::fftw > |
| FFTW backend (CPU) | |
| using | pfc::fft::FFT = FFT_Impl< heffte::backend::fftw > |
| using | pfc::FFT = fft::FFT |
| Type alias for FFT class. | |
| using | pfc::FFTLayout = fft::layout::FFTLayout |
| Type alias for FFTLayout class. | |
Enumerations | |
| enum class | pfc::fft::Backend { FFTW , CUDA } |
| FFT backend selection. More... | |
Functions | |
| const FFTLayout | pfc::fft::layout::create (const Decomposition &decomposition, int r2c_direction) |
| Creates an FFTLayout object based on the given decomposition and parameters. | |
| const auto & | pfc::fft::layout::get_real_box (const FFTLayout &layout, int i) |
| const auto & | pfc::fft::layout::get_complex_box (const FFTLayout &layout, int i) |
| auto | pfc::fft::layout::get_r2c_direction (const FFTLayout &layout) |
| template<typename BackendTag > | |
| const auto & | pfc::fft::get_fft_object (const FFT_Impl< BackendTag > &fft) noexcept |
| template<typename BackendTag > | |
| auto | pfc::fft::get_inbox (const FFT_Impl< BackendTag > &fft) noexcept |
| template<typename BackendTag > | |
| auto | pfc::fft::get_outbox (const FFT_Impl< BackendTag > &fft) noexcept |
| FFT | pfc::fft::create (const FFTLayout &fft_layout, int rank_id, plan_options options) |
| Creates an FFT object based on the given FFTLayout and rank ID. | |
| FFT | pfc::fft::create (const Decomposition &decomposition, int rank_id) |
| Creates an FFT object based on the given decomposition and rank ID. | |
| FFT | pfc::fft::create (const Decomposition &decomposition) |
| Creates an FFT object based on the given decomposition. | |
| std::unique_ptr< IFFT > | pfc::fft::create_with_backend (const FFTLayout &fft_layout, int rank_id, plan_options options, Backend backend) |
| Creates an FFT object with runtime backend selection. | |
| std::unique_ptr< IFFT > | pfc::fft::create_with_backend (const Decomposition &decomposition, int rank_id, Backend backend) |
| Creates an FFT object with runtime backend selection. | |
Fast Fourier Transform interface for spectral methods.
This file defines the FFT class and related utilities for performing distributed parallel FFT operations using HeFFTe. OpenPFC uses spectral methods where derivatives and other spatial operations are efficiently computed in Fourier space.
The FFT class provides:
Typical usage:
This file is part of the Core Infrastructure module, providing the foundation for spectral method computations in phase-field simulations.
|
strong |
FFT backend selection.
Specifies which FFT library backend to use for computations.
| Enumerator | |
|---|---|
| FFTW | CPU-based FFT using FFTW (default) |
| CUDA | GPU-based FFT using cuFFT (requires CUDA support) |
| FFT pfc::fft::create | ( | const Decomposition & | decomposition | ) |
Creates an FFT object based on the given decomposition.
| decomposition | The Decomposition object defining the domain decomposition. |
| std::logic_error,if | decomposition size and rank size do not match. |
| const FFTLayout pfc::fft::layout::create | ( | const Decomposition & | decomposition, |
| int | r2c_direction | ||
| ) |
Creates an FFTLayout object based on the given decomposition and parameters.
| decomposition | The Decomposition object defining the domain decomposition. |
| r2c_direction | The direction of real-to-complex symmetry. |
| FFT pfc::fft::create | ( | const Decomposition & | decomposition, |
| int | rank_id | ||
| ) |
Creates an FFT object based on the given decomposition and rank ID.
| decomposition | The Decomposition object defining the domain decomposition. |
| rank_id | The rank ID of the current process in the MPI communicator. |
Creates an FFT object based on the given FFTLayout and rank ID.
| fft_layout | The FFTLayout object defining the FFT configuration. |
| rank_id | The rank ID of the current process in the MPI communicator. |
| options | Plan options for configuring the FFT behavior. |
| std::unique_ptr< IFFT > pfc::fft::create_with_backend | ( | const Decomposition & | decomposition, |
| int | rank_id, | ||
| Backend | backend | ||
| ) |
Creates an FFT object with runtime backend selection.
| decomposition | The Decomposition object defining the domain decomposition. |
| rank_id | The rank ID of the current process in the MPI communicator. |
| backend | The FFT backend to use (FFTW, CUDA, etc.) |
| std::runtime_error | if backend is not supported or not compiled in |

| std::unique_ptr< IFFT > pfc::fft::create_with_backend | ( | const FFTLayout & | fft_layout, |
| int | rank_id, | ||
| plan_options | options, | ||
| Backend | backend | ||
| ) |
Creates an FFT object with runtime backend selection.
| fft_layout | The FFTLayout object defining the FFT configuration. |
| rank_id | The rank ID of the current process in the MPI communicator. |
| options | Plan options for configuring the FFT behavior. |
| backend | The FFT backend to use (FFTW, CUDA, etc.) |
| std::runtime_error | if backend is not supported or not compiled in |

