OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
ippl::FFT< RCTransform, RealField > Class Template Reference

real-to-complex FFT class More...

#include <FFT.h>

Inheritance diagram for ippl::FFT< RCTransform, RealField >:
Inheritance graph
Collaboration diagram for ippl::FFT< RCTransform, RealField >:
Collaboration graph

Public Types

using Complex_t = Kokkos::complex< Real_t >
 
using ComplexField = typename Field< Complex_t, Dim, typename RealField::Mesh_t, typename RealField::Centering_t, typename RealField::execution_space >::uniform_type
 
using heffteBackend = Backend
 
using workspace_t = typename FFT< heffteBackend >::template buffer_container< BufferType >
 
using Layout_t = FieldLayout< Dim >
 

Public Member Functions

 FFT (const Layout_t &layoutInput, const Layout_t &layoutOutput, const ParameterList &params)
 Create a new FFT object with the layout for the input and output Fields and parameters for heffte. More...
 
void warmup (RealField &f, ComplexField &g)
 
void transform (TransformDirection direction, RealField &f, ComplexField &g)
 

Protected Types

using temp_view_type = typename Kokkos::View< typename FieldType::view_type::data_type, Kokkos::LayoutLeft, typename FieldType::memory_space >::uniform_type
 

Protected Member Functions

void domainToBounds (const NDIndex< Dim > &domain, std::array< long long, 3 > &low, std::array< long long, 3 > &high)
 
void setup (const heffte::box3d< long long > &inbox, const heffte::box3d< long long > &outbox, const ParameterList &params)
 setup performs the initialization necessary. More...
 

Protected Attributes

std::shared_ptr< heffte::fft3d_r2c< heffteBackend, long long > > heffte_m
 
workspace_t workspace_m
 
temp_view_type< RealField > tempField
 

Private Types

using Real_t = typename RealField::value_type
 
using Base = FFTBase< RealField, heffte::fft3d_r2c, typename detail::HeffteBackendType< typename RealField ::memory_space >::backend, typename Kokkos::complex< typename RealField::value_type > >
 

Private Attributes

Base::template temp_view_type< ComplexFieldtempFieldComplex
 

Static Private Attributes

static constexpr unsigned Dim = RealField::dim
 

Detailed Description

template<typename RealField>
class ippl::FFT< RCTransform, RealField >

real-to-complex FFT class

Definition at line 219 of file FFT.h.

Member Typedef Documentation

◆ Base

template<typename RealField >
using ippl::FFT< RCTransform, RealField >::Base = FFTBase< RealField , heffte::fft3d_r2c, typename detail::HeffteBackendType<typename RealField ::memory_space>:: backend , typename Kokkos::complex<typename RealField::value_type> >
private

Definition at line 224 of file FFT.h.

◆ Complex_t

template<typename RealField >
using ippl::FFT< RCTransform, RealField >::Complex_t = Kokkos::complex<Real_t>

Definition at line 228 of file FFT.h.

◆ ComplexField

template<typename RealField >
using ippl::FFT< RCTransform, RealField >::ComplexField = typename Field<Complex_t, Dim, typename RealField::Mesh_t, typename RealField::Centering_t, typename RealField::execution_space>::uniform_type

Definition at line 229 of file FFT.h.

◆ heffteBackend

template<typename RealField >
using ippl::FFTBase< Field, FFT, Backend, BufferType >::heffteBackend = Backend

Definition at line 148 of file FFT.h.

◆ Layout_t

template<typename RealField >
using ippl::FFTBase< Field, FFT, Backend, BufferType >::Layout_t = FieldLayout<Dim>

Definition at line 150 of file FFT.h.

◆ Real_t

template<typename RealField >
using ippl::FFT< RCTransform, RealField >::Real_t = typename RealField::value_type
private

Definition at line 223 of file FFT.h.

◆ temp_view_type

using ippl::FFTBase< RealField , heffte::fft3d_r2c , detail::HeffteBackendType< RealField ::memory_space >::backend , Kokkos::complex< RealField::value_type > >::temp_view_type = typename Kokkos::View<typename FieldType::view_type::data_type, Kokkos::LayoutLeft, typename FieldType::memory_space>::uniform_type
protectedinherited

Definition at line 167 of file FFT.h.

◆ workspace_t

template<typename RealField >
using ippl::FFTBase< Field, FFT, Backend, BufferType >::workspace_t = typename FFT<heffteBackend>::template buffer_container<BufferType>

Definition at line 149 of file FFT.h.

Constructor & Destructor Documentation

◆ FFT()

template<typename RealField >
ippl::FFT< RCTransform, RealField >::FFT ( const Layout_t layoutInput,
const Layout_t layoutOutput,
const ParameterList params 
)

Create a new FFT object with the layout for the input and output Fields and parameters for heffte.

Create a new FFT object of type RCTransform, with given input and output layouts and heffte parameters.

Heffte requires to pass a 3D array even for 2D and 1D FFTs we just have to make the length in other dimensions to be 1.

Definition at line 172 of file FFT.hpp.

Member Function Documentation

◆ domainToBounds()

void ippl::FFTBase< RealField , heffte::fft3d_r2c , detail::HeffteBackendType< RealField ::memory_space >::backend , T >::domainToBounds ( const NDIndex< Dim > &  domain,
std::array< long long, 3 > &  low,
std::array< long long, 3 > &  high 
)
protectedinherited

Static cast to detail::long long (uint64_t) is necessary, as heffte::box3d requires it like that.

Definition at line 158 of file FFT.hpp.

◆ setup()

void ippl::FFTBase< RealField , heffte::fft3d_r2c , detail::HeffteBackendType< RealField ::memory_space >::backend , T >::setup ( const heffte::box3d< long long > &  inbox,
const heffte::box3d< long long > &  outbox,
const ParameterList params 
)
protectedinherited

setup performs the initialization necessary.

Definition at line 160 of file FFT.hpp.

◆ transform()

template<typename RealField >
void ippl::FFT< RCTransform, RealField >::transform ( TransformDirection  direction,
RealField &  f,
ComplexField g 
)

Perform FFT

Parameters
directionForward or backward transformation
fField whose transformation to compute
gField in which to store the transformation

This copy to a temporary Kokkos view is needed because of following reasons: 1) heffte wants the input and output fields without ghost layers 2) heffte accepts data in layout left (by default) eventhough this can be changed during heffte box creation

Definition at line 203 of file FFT.hpp.

References ippl::apply(), ippl::BACKWARD, Dim, ippl::FORWARD, ippl::getRangePolicy(), ippl::parallel_for(), and ippl::detail::shrinkView().

Here is the call graph for this function:

◆ warmup()

template<typename RealField >
void ippl::FFT< RCTransform, RealField >::warmup ( RealField &  f,
ComplexField g 
)

Warmup the FFT object by forward & backward FFT on an empty field

Parameters
fField whose transformation to compute
gField in which to store the transformation

Definition at line 197 of file FFT.hpp.

References ippl::BACKWARD, and ippl::FORWARD.

Member Data Documentation

◆ Dim

template<typename RealField >
constexpr unsigned ippl::FFT< RCTransform, RealField >::Dim = RealField::dim
staticconstexprprivate

Definition at line 222 of file FFT.h.

◆ heffte_m

std::shared_ptr<heffte::fft3d_r2c <heffteBackend, long long> > ippl::FFTBase< RealField , heffte::fft3d_r2c , detail::HeffteBackendType< RealField ::memory_space >::backend , Kokkos::complex< RealField::value_type > >::heffte_m
protectedinherited

Definition at line 163 of file FFT.h.

◆ tempField

temp_view_type<RealField > ippl::FFTBase< RealField , heffte::fft3d_r2c , detail::HeffteBackendType< RealField ::memory_space >::backend , Kokkos::complex< RealField::value_type > >::tempField
protectedinherited

Definition at line 170 of file FFT.h.

◆ tempFieldComplex

template<typename RealField >
Base::template temp_view_type<ComplexField> ippl::FFT< RCTransform, RealField >::tempFieldComplex
private

Definition at line 256 of file FFT.h.

◆ workspace_m

workspace_t ippl::FFTBase< RealField , heffte::fft3d_r2c , detail::HeffteBackendType< RealField ::memory_space >::backend , Kokkos::complex< RealField::value_type > >::workspace_m
protectedinherited

Definition at line 164 of file FFT.h.


The documentation for this class was generated from the following files: