ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
P3MFFTBackend< FloatType, FFTConfig > Struct Template Referenceabstract

Abstract interface for the P3M reciprocal-space FFT. More...

#include <P3MFFTBackend.hpp>

+ Inheritance diagram for P3MFFTBackend< FloatType, FFTConfig >:

Public Types

using ComplexType = std::complex< FloatType >
 
using RSpaceScalar = FloatType
 Real-space scalar type.
 

Public Member Functions

virtual ~P3MFFTBackend ()=default
 
virtual Utils::Vector3i ks_local_ld_index () const =0
 Lower-left corner of this rank's k-space box (global coords).
 
virtual Utils::Vector3i ks_local_ur_index () const =0
 Upper-right corner (exclusive) of this rank's k-space box.
 
virtual Utils::Vector3i ks_local_size () const =0
 Extent of this rank's k-space box.
 
virtual Utils::Vector3i rs_local_size () const =0
 Extent of this rank's real-space (no-halo) box.
 
virtual RSpaceScalarforward_input_buffer ()=0
 Persistent, transform-ready buffer for the caller to fill with the no-halo real-space input; holds product(rs_local_size()) elements.
 
virtual void forward (RSpaceScalar const *in, ComplexType *out)=0
 Forward transform (real/complex charge density to k-space).
 
virtual void backward (ComplexType *in, RSpaceScalar *out)=0
 Backward transform (k-space field to real space).
 

Detailed Description

template<typename FloatType, class FFTConfig>
struct P3MFFTBackend< FloatType, FFTConfig >

Abstract interface for the P3M reciprocal-space FFT.

P3M only ever touches the FFT through this handful of methods: the k-space box geometry accessors and the forward/backward transforms. Concrete backends (heFFTe for the general/distributed case, kokkos-fft for the single-rank case) implement it, so the solver is agnostic to which one is active. The transform buffers are flat, contiguous, no-halo arrays; halo exchange is handled outside the FFT.

Definition at line 37 of file P3MFFTBackend.hpp.

Member Typedef Documentation

◆ ComplexType

template<typename FloatType , class FFTConfig >
using P3MFFTBackend< FloatType, FFTConfig >::ComplexType = std::complex<FloatType>

Definition at line 38 of file P3MFFTBackend.hpp.

◆ RSpaceScalar

template<typename FloatType , class FFTConfig >
using P3MFFTBackend< FloatType, FFTConfig >::RSpaceScalar = FloatType

Real-space scalar type.

P3M's real-space buffers (charge density, E-field) are physically real in both configs, so this is always FloatType. For a c2c backend (use_r2c=false) the imaginary part is dropped on the backward transform via heFFTe's real-output convenience overload, matching the pre-backend-interface behaviour where the templated forward/backward transforms of P3MFFT accepted real pointers for either config.

Definition at line 47 of file P3MFFTBackend.hpp.

Constructor & Destructor Documentation

◆ ~P3MFFTBackend()

template<typename FloatType , class FFTConfig >
virtual P3MFFTBackend< FloatType, FFTConfig >::~P3MFFTBackend ( )
virtualdefault

Member Function Documentation

◆ backward()

template<typename FloatType , class FFTConfig >
virtual void P3MFFTBackend< FloatType, FFTConfig >::backward ( ComplexType in,
RSpaceScalar out 
)
pure virtual

Backward transform (k-space field to real space).

The input buffer is non-const by contract: a backend may destroy it during the transform (FFTW's multi-dimensional c2r has no preserve-input mode, so the kokkos-fft backend runs it in place). Callers must recompute the k-space input before reading it again.

Implemented in P3MFFTHeffte< FloatType, FFTConfig >.

◆ forward()

template<typename FloatType , class FFTConfig >
virtual void P3MFFTBackend< FloatType, FFTConfig >::forward ( RSpaceScalar const in,
ComplexType out 
)
pure virtual

Forward transform (real/complex charge density to k-space).

Implemented in P3MFFTHeffte< FloatType, FFTConfig >.

◆ forward_input_buffer()

template<typename FloatType , class FFTConfig >
virtual RSpaceScalar * P3MFFTBackend< FloatType, FFTConfig >::forward_input_buffer ( )
pure virtual

Persistent, transform-ready buffer for the caller to fill with the no-halo real-space input; holds product(rs_local_size()) elements.

Passing it back as forward's in lets a backend transform it in place.

Implemented in P3MFFTHeffte< FloatType, FFTConfig >.

◆ ks_local_ld_index()

template<typename FloatType , class FFTConfig >
virtual Utils::Vector3i P3MFFTBackend< FloatType, FFTConfig >::ks_local_ld_index ( ) const
pure virtual

Lower-left corner of this rank's k-space box (global coords).

Implemented in P3MFFTHeffte< FloatType, FFTConfig >.

◆ ks_local_size()

template<typename FloatType , class FFTConfig >
virtual Utils::Vector3i P3MFFTBackend< FloatType, FFTConfig >::ks_local_size ( ) const
pure virtual

Extent of this rank's k-space box.

Implemented in P3MFFTHeffte< FloatType, FFTConfig >.

◆ ks_local_ur_index()

template<typename FloatType , class FFTConfig >
virtual Utils::Vector3i P3MFFTBackend< FloatType, FFTConfig >::ks_local_ur_index ( ) const
pure virtual

Upper-right corner (exclusive) of this rank's k-space box.

Implemented in P3MFFTHeffte< FloatType, FFTConfig >.

◆ rs_local_size()

template<typename FloatType , class FFTConfig >
virtual Utils::Vector3i P3MFFTBackend< FloatType, FFTConfig >::rs_local_size ( ) const
pure virtual

Extent of this rank's real-space (no-halo) box.

Implemented in P3MFFTHeffte< FloatType, FFTConfig >.


The documentation for this struct was generated from the following file: