SIRIUS 7.5.0
Electronic structure library and applications
Classes | Typedefs | Functions | Variables
sirius::fft Namespace Reference

FFT-related functions and objects. More...

Classes

class  Grid
 Helper class to create FFT grids of given sizes and compute indices in space- and frequency domains. More...
 
class  Gvec
 A set of G-vectors for FFTs and G+k basis functions. More...
 
class  Gvec_fft
 Stores information about G-vector partitioning between MPI ranks for the FFT transformation. More...
 
class  Gvec_shells
 Helper class to manage G-vector shells and redistribute G-vectors for symmetrization. More...
 
struct  SpFFT_Grid
 Type traits to handle Spfft grid for different precision type. More...
 
struct  SpFFT_Grid< double >
 
struct  SpFFT_Grid< std::complex< double > >
 
struct  SpFFT_Transform
 Type traits to handle Spfft driver for different precision type. More...
 
struct  SpFFT_Transform< double >
 
struct  SpFFT_Transform< std::complex< double > >
 
struct  z_column_descriptor
 Descriptor of the z-column (x,y fixed, z varying) of the G-vectors. More...
 

Typedefs

template<typename T >
using spfft_grid_type = typename SpFFT_Grid< T >::type
 
template<typename T >
using spfft_transform_type = typename SpFFT_Transform< T >::type
 
template<typename F , typename T , typename ... Args>
using enable_return = typename std::enable_if< std::is_same< typename std::result_of< F(Args...)>::type, T >::value, void >::type
 

Functions

template<typename T , typename F >
enable_return< F, T, int > spfft_input (spfft_transform_type< T > &spfft__, F &&fr__)
 Load data from real-valued lambda. More...
 
template<typename T , typename F >
enable_return< F, std::complex< T >, int > spfft_input (spfft_transform_type< T > &spfft__, F &&fr__)
 Load data from complex-valued lambda. More...
 
template<typename T >
void spfft_input (spfft_transform_type< T > &spfft__, T const *data__)
 Input CPU data to CPU buffer of SpFFT. More...
 
template<typename T , typename F >
void spfft_multiply (spfft_transform_type< T > &spfft__, F &&fr__)
 
template<typename T >
void spfft_output (spfft_transform_type< T > &spfft__, T *data__)
 Output CPU data from the CPU buffer of SpFFT. More...
 
template<typename T >
void spfft_output (spfft_transform_type< T > &spfft__, std::complex< T > *data__)
 
template<typename T >
size_t spfft_grid_size (T const &spfft__)
 Total size of the SpFFT transformation grid. More...
 
template<typename T >
size_t spfft_grid_size_local (T const &spfft__)
 Local size of the SpFFT transformation grid. More...
 
auto split_z_dimension (int size_z__, mpi::Communicator const &comm_fft__)
 Split z-dimenstion of size_z between MPI ranks of the FFT communicator. More...
 
auto get_min_grid (double cutoff__, r3::matrix< double > M__)
 Get the minimum grid that circumscribes the cutoff sphere. More...
 
Gvec send_recv (mpi::Communicator const &comm__, Gvec const &gv_src__, int source__, int dest__)
 
void serialize (serializer &s__, Gvec const &gv__)
 
void deserialize (serializer &s__, Gvec &gv__)
 
void serialize (serializer &s__, z_column_descriptor const &zcol__)
 Serialize a single z-column descriptor. More...
 
void deserialize (serializer &s__, z_column_descriptor &zcol__)
 Deserialize a single z-column descriptor. More...
 
void serialize (serializer &s__, std::vector< z_column_descriptor > const &zcol__)
 Serialize a vector of z-column descriptors. More...
 
void deserialize (serializer &s__, std::vector< z_column_descriptor > &zcol__)
 Deserialize a vector of z-column descriptors. More...
 
std::shared_ptr< Gvecgkvec_factory (double gk_cutoff__, mpi::Communicator const &comm__)
 This is only for debug purpose. More...
 
std::shared_ptr< Gvecgkvec_factory (r3::vector< double > vk__, r3::matrix< double > reciprocal_lattice_vectors__, double gk_cutoff__, mpi::Communicator const &comm__=mpi::Communicator::self(), bool gamma__=false)
 
void print (std::ostream &out__, Gvec const &gvec__)
 

Variables

const std::map< SpfftProcessingUnitType, sddk::memory_tspfft_memory_t
 

Detailed Description

FFT-related functions and objects.

Typedef Documentation

◆ spfft_grid_type

template<typename T >
using sirius::fft::spfft_grid_type = typedef typename SpFFT_Grid<T>::type

Definition at line 57 of file fft.hpp.

◆ spfft_transform_type

template<typename T >
using sirius::fft::spfft_transform_type = typedef typename SpFFT_Transform<T>::type

Definition at line 78 of file fft.hpp.

◆ enable_return

template<typename F , typename T , typename ... Args>
using sirius::fft::enable_return = typedef typename std::enable_if<std::is_same<typename std::result_of<F(Args...)>::type, T>::value, void>::type

Definition at line 86 of file fft.hpp.

Function Documentation

◆ spfft_input() [1/3]

template<typename T , typename F >
enable_return< F, T, int > sirius::fft::spfft_input ( spfft_transform_type< T > &  spfft__,
F &&  fr__ 
)
inline

Load data from real-valued lambda.

Definition at line 91 of file fft.hpp.

◆ spfft_input() [2/3]

template<typename T , typename F >
enable_return< F, std::complex< T >, int > sirius::fft::spfft_input ( spfft_transform_type< T > &  spfft__,
F &&  fr__ 
)
inline

Load data from complex-valued lambda.

Definition at line 119 of file fft.hpp.

◆ spfft_input() [3/3]

template<typename T >
void sirius::fft::spfft_input ( spfft_transform_type< T > &  spfft__,
T const *  data__ 
)
inline

Input CPU data to CPU buffer of SpFFT.

Definition at line 140 of file fft.hpp.

◆ spfft_multiply()

template<typename T , typename F >
void sirius::fft::spfft_multiply ( spfft_transform_type< T > &  spfft__,
F &&  fr__ 
)
inline

Definition at line 146 of file fft.hpp.

◆ spfft_output() [1/2]

template<typename T >
void sirius::fft::spfft_output ( spfft_transform_type< T > &  spfft__,
T *  data__ 
)
inline

Output CPU data from the CPU buffer of SpFFT.

Definition at line 173 of file fft.hpp.

◆ spfft_output() [2/2]

template<typename T >
void sirius::fft::spfft_output ( spfft_transform_type< T > &  spfft__,
std::complex< T > *  data__ 
)
inline

Definition at line 199 of file fft.hpp.

◆ spfft_grid_size()

template<typename T >
size_t sirius::fft::spfft_grid_size ( T const &  spfft__)
inline

Total size of the SpFFT transformation grid.

Definition at line 221 of file fft.hpp.

◆ spfft_grid_size_local()

template<typename T >
size_t sirius::fft::spfft_grid_size_local ( T const &  spfft__)
inline

Local size of the SpFFT transformation grid.

Definition at line 228 of file fft.hpp.

◆ split_z_dimension()

auto sirius::fft::split_z_dimension ( int  size_z__,
mpi::Communicator const &  comm_fft__ 
)
inline

Split z-dimenstion of size_z between MPI ranks of the FFT communicator.

SpFFT works with any z-distribution of the real-space FFT buffer. Here we split the z-dimenstion using block distribution.

Definition at line 236 of file fft.hpp.

◆ get_min_grid()

auto sirius::fft::get_min_grid ( double  cutoff__,
r3::matrix< double >  M__ 
)
inline

Get the minimum grid that circumscribes the cutoff sphere.

Definition at line 161 of file fft3d_grid.hpp.

◆ send_recv()

Gvec sirius::fft::send_recv ( mpi::Communicator const &  comm__,
Gvec const &  gv_src__,
int  source__,
int  dest__ 
)

Definition at line 560 of file gvec.cpp.

◆ serialize() [1/3]

void sirius::fft::serialize ( serializer s__,
Gvec const &  gv__ 
)

Definition at line 744 of file gvec.cpp.

◆ deserialize() [1/3]

void sirius::fft::deserialize ( serializer s__,
Gvec gv__ 
)

Definition at line 765 of file gvec.cpp.

◆ serialize() [2/3]

void sirius::fft::serialize ( serializer s__,
z_column_descriptor const &  zcol__ 
)
inline

Serialize a single z-column descriptor.

Definition at line 80 of file gvec.hpp.

◆ deserialize() [2/3]

void sirius::fft::deserialize ( serializer s__,
z_column_descriptor zcol__ 
)
inline

Deserialize a single z-column descriptor.

Definition at line 90 of file gvec.hpp.

◆ serialize() [3/3]

void sirius::fft::serialize ( serializer s__,
std::vector< z_column_descriptor > const &  zcol__ 
)
inline

Serialize a vector of z-column descriptors.

Definition at line 100 of file gvec.hpp.

◆ deserialize() [3/3]

void sirius::fft::deserialize ( serializer s__,
std::vector< z_column_descriptor > &  zcol__ 
)
inline

Deserialize a vector of z-column descriptors.

Definition at line 109 of file gvec.hpp.

◆ gkvec_factory() [1/2]

std::shared_ptr< Gvec > sirius::fft::gkvec_factory ( double  gk_cutoff__,
mpi::Communicator const &  comm__ 
)
inline

This is only for debug purpose.

Definition at line 1042 of file gvec.hpp.

◆ gkvec_factory() [2/2]

std::shared_ptr< Gvec > sirius::fft::gkvec_factory ( r3::vector< double >  vk__,
r3::matrix< double >  reciprocal_lattice_vectors__,
double  gk_cutoff__,
mpi::Communicator const &  comm__ = mpi::Communicator::self(),
bool  gamma__ = false 
)
inline

Definition at line 1049 of file gvec.hpp.

◆ print()

void sirius::fft::print ( std::ostream &  out__,
Gvec const &  gvec__ 
)
inline

Definition at line 1055 of file gvec.hpp.

Variable Documentation

◆ spfft_memory_t

const std::map<SpfftProcessingUnitType, sddk::memory_t> sirius::fft::spfft_memory_t
Initial value:
= {
{SPFFT_PU_HOST, sddk::memory_t::host},
{SPFFT_PU_GPU, sddk::memory_t::device}
}

Definition at line 80 of file fft.hpp.