HILA
Loading...
Searching...
No Matches
fft.h File Reference
#include "plumbing/defs.h"
#include "datatypes/cmplx.h"
#include "plumbing/coordinates.h"
#include "plumbing/field.h"
#include "plumbing/timing.h"
#include <fftw3.h>
#include "plumbing/fft_fftw_transform.h"
Include dependency graph for fft.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  hila_fft< cmplx_t >
 

Namespaces

namespace  hila
 Invert diagonal + const. matrix using Sherman-Morrison formula.
 

Functions

Vector< 4, double > convert_to_k (const CoordinateVector &cv)
 Convert momentum space CoordinateVector to wave number k, where -pi/2 < k_i <= pi/2.
 
template<typename T >
void FFT_field (const Field< T > &input, Field< T > &result, const CoordinateVector &directions, fft_direction fftdir=fft_direction::forward)
 
template<typename T >
void FFT_field (const Field< T > &input, Field< T > &result, fft_direction fftdir=fft_direction::forward)
 
void init_pencil_direction (Direction d)
 Initialize fft direction - defined in fft.cpp.
 
size_t pencil_get_buffer_offsets (const Direction dir, const size_t elements, CoordinateVector &offset, CoordinateVector &nmin)
 

Function Documentation

◆ convert_to_k()

Vector< 4, double > convert_to_k ( const CoordinateVector cv)
inline

Convert momentum space CoordinateVector to wave number k, where -pi/2 < k_i <= pi/2.

CoordinateVector is (periodically) modded to valid lattice coordinate, and folded so that if n_i > lattice.size(i), n_i = n_i - lattice.size(i) now k_i = 2 pi n_i / lattice.size(i)

Definition at line 32 of file fft.h.

◆ FFT_field() [1/2]

template<typename T >
void FFT_field ( const Field< T > &  input,
Field< T > &  result,
const CoordinateVector directions,
fft_direction  fftdir = fft_direction::forward 
)
inline

Complex-to-complex FFT transform of a field input, result in result. input and result can be same, "in-place". Both input and output are of type Field<T>, where T must contain complex type, Complex<float> or Complex<double>. directions: if directions[dir] == false (or 0), transform is not done to direction dir. fftdir: direction of the transform itself: fft_direction::forward (default) x -> k fft_direction::inverse k-> x FFT is unnormalized: transform + inverse transform yields source multiplied by the product of the size of the lattice to active directions If all directions are active, result = source * lattice.volume():

Definition at line 376 of file fft.h.

◆ FFT_field() [2/2]

template<typename T >
void FFT_field ( const Field< T > &  input,
Field< T > &  result,
fft_direction  fftdir = fft_direction::forward 
)
inline

Complex-to-complex FFT transform of a field input, result in result. Same as FFT_field(input,result,directions,fftdir) with all directions active.

Definition at line 405 of file fft.h.

◆ init_pencil_direction()

void init_pencil_direction ( Direction  dir)

Initialize fft direction - defined in fft.cpp.

Initialize fft direction - defined in fft.cpp.

Definition at line 61 of file fft.cpp.

◆ pencil_get_buffer_offsets()

size_t pencil_get_buffer_offsets ( const Direction  dir,
const size_t  elements,
CoordinateVector offset,
CoordinateVector nmin 
)

Build offsets to buffer arrays: Fastest Direction = dir, offset 1 next fastest index of complex_t elements in T, offset elem_offset and then other directions, in order Returns element_offset and sets offset and nmin vectors

Definition at line 39 of file fft.cpp.