SIRIUS 7.5.0
Electronic structure library and applications
|
Helper class to create FFT grids of given sizes and compute indices in space- and frequency domains. More...
#include <fft3d_grid.hpp>
Inherits std::array< int, 3 >.
Public Member Functions | |
Grid () | |
Default constructor. More... | |
Grid (std::array< int, 3 > initial_dims__) | |
Create FFT grid with initial dimensions. More... | |
const std::pair< int, int > & | limits (int idim__) const |
Limits of a given dimension. More... | |
int | num_points () const |
Total size of the FFT grid. More... | |
template<int d> | |
int | coord_by_freq (int i__) const |
Get coordinate in range [0, N_d) by the frequency index. More... | |
std::array< int, 3 > | coord_by_freq (int i0__, int i1__, int i2__) const |
Return {x, y, z} coordinates by frequency indices. More... | |
template<int d> | |
int | freq_by_coord (int x__) const |
Get frequency by coordinate. More... | |
std::array< int, 3 > | freq_by_coord (int x__, int y__, int z__) const |
Return 3d vector of frequencies corresponding to {x, y, z} position in the FFT buffer. More... | |
int | index_by_coord (int x__, int y__, int z__) const |
Linear index inside FFT buffer by grid coordinates. More... | |
int | index_by_freq (int i0__, int i1__, int i2__) const |
Return linear index of a plane-wave harmonic with fractional coordinates (i0, i1, i2) inside FFT buffer. More... | |
Private Member Functions | |
int | find_grid_size (int n) |
Find smallest optimal grid size starting from n. More... | |
void | find_grid_size (std::array< int, 3 > initial_dims__) |
Find grid sizes and limits for all three dimensions. More... | |
Private Attributes | |
std::array< std::pair< int, int >, 3 > | grid_limits_ |
Reciprocal space range. More... | |
Helper class to create FFT grids of given sizes and compute indices in space- and frequency domains.
Definition at line 37 of file fft3d_grid.hpp.
|
inline |
Default constructor.
Definition at line 91 of file fft3d_grid.hpp.
|
inline |
Create FFT grid with initial dimensions.
Definition at line 96 of file fft3d_grid.hpp.
|
inlineprivate |
Find smallest optimal grid size starting from n.
Definition at line 44 of file fft3d_grid.hpp.
|
inlineprivate |
Find grid sizes and limits for all three dimensions.
Definition at line 62 of file fft3d_grid.hpp.
|
inline |
Limits of a given dimension.
Definition at line 102 of file fft3d_grid.hpp.
|
inline |
Total size of the FFT grid.
Definition at line 109 of file fft3d_grid.hpp.
|
inline |
Get coordinate in range [0, N_d) by the frequency index.
Definition at line 116 of file fft3d_grid.hpp.
|
inline |
Return {x, y, z} coordinates by frequency indices.
Definition at line 125 of file fft3d_grid.hpp.
|
inline |
Get frequency by coordinate.
Definition at line 132 of file fft3d_grid.hpp.
|
inline |
Return 3d vector of frequencies corresponding to {x, y, z} position in the FFT buffer.
Definition at line 141 of file fft3d_grid.hpp.
|
inline |
Linear index inside FFT buffer by grid coordinates.
Definition at line 147 of file fft3d_grid.hpp.
|
inline |
Return linear index of a plane-wave harmonic with fractional coordinates (i0, i1, i2) inside FFT buffer.
Definition at line 153 of file fft3d_grid.hpp.
|
private |
Reciprocal space range.
Definition at line 41 of file fft3d_grid.hpp.