FML
|
This namespace contains various grids for holding data shared across different tasks. More...
Data Structures | |
class | FFTWGrid |
Class for holding grids and performing real-to-complex and complex-to-real FFTs using FFTW with MPI. More... | |
class | FourierRange |
For range based for-loops over the fourier-grid. Loop over all local cells. More... | |
class | LoopIteratorFourier |
An iterator that deal with looping through the fourier grid. More... | |
class | LoopIteratorReal |
An iterator that deal with looping through a real grid. More... | |
class | MPIGrid |
A simple multidimensional grid-class for any type that works over MPI. More... | |
class | MPIMultiGrid |
A stack of _Nlevel MPIGrids with \( N^{\rm NDIM} / 2^{\rm Level} \) cells in each level. More... | |
class | RealRange |
For range based for-loops over the real-grid. Loop over all local cells. More... | |
Typedefs | |
using | IndexInt = long long int |
Functions | |
template<int N> | |
void | fftw_r2c (FFTWGrid< N > &in_grid, FFTWGrid< N > &out_grid) |
template<int N> | |
void | fftw_c2r (FFTWGrid< N > &in_grid, FFTWGrid< N > &out_grid) |
void | init_fftw (int *argc, char ***argv) |
void | finalize_fftw () |
void | set_fftw_nthreads (int nthreads) |
template<class T > | |
double | AbsoluteValue (T &x) |
OPS (+=) | |
OPS (-=) | |
OPS * | OPS (/=)#undef OPS#define OPS(OP) \ template< int NDIM, class T > \ template< class U > \ auto MPIGrid< NDIM, T >::operator OP(const U &rhs) ->MPIGrid< NDIM, T > &{ \ for(IndexInt i=0;i< _NtotLocal;i++) \ this->_y[_NtotLocalLeft+i] OP rhs;\ return *this;\ } OPS(+= |
template<int N> | |
void | whitening_fourier_space (FFTWGrid< N > &fourier_grid) |
Take a fourier grid and divide each mode by its norm: \( f(k) \to f(k) / |f(k)| \). More... | |
template<int N> | |
void | smoothing_filter_fourier_space (FFTWGrid< N > &fourier_grid, double smoothing_scale, std::string smoothing_method) |
Low-pass filters (tophat, gaussian, sharpk) More... | |
template<int N> | |
void | convolution_fourier_space (const FFTWGrid< N > &fourier_grid_f, const FFTWGrid< N > &fourier_grid_g, FFTWGrid< N > &fourier_grid_result) |
From two fourier grids, f and g, compute the convolution \( f(k) * g(k) = \int d^{\rm N}q f(q) g(k-q) \) This is done via multuplication in reals-space. More... | |
template<int N> | |
void | convolution_real_space (const FFTWGrid< N > &real_grid_f, const FFTWGrid< N > &real_grid_g, FFTWGrid< N > &real_grid_result) |
From two real grids, f and g, compute the convolution \( f(x) * g(x) = \int d^{\rm N}y f(y) g(x-y) \) This is done via multiplication in fourier-space. More... | |
template<int N> | |
void | compute_grid_PDF (const FFTWGrid< N > &real_grid, int nbins, std::vector< double > &x, std::vector< double > &pdf) |
This computes the PDF of whatever quantity is in the grid (e.g. More... | |
This namespace contains various grids for holding data shared across different tasks.
using FML::GRID::IndexInt = typedef long long int |
double FML::GRID::AbsoluteValue | ( | T & | x | ) |
void FML::GRID::compute_grid_PDF | ( | const FFTWGrid< N > & | real_grid, |
int | nbins, | ||
std::vector< double > & | x, | ||
std::vector< double > & | |||
) |
This computes the PDF of whatever quantity is in the grid (e.g.
the density if its a density grid) The binning is set to be linear. The range is set by the values we find in the grid This realy belongs in the namespace CORRELATIONFUNCTIONS so should move it there
N | The dimension of the grid |
[in] | real_grid | |
[in] | nbins | Number of bins |
[out] | x | Bins for the quantity we are computing the PDF of |
[out] | The binned PDF normalized such that \( \int_{-\infty}^\infty p(x)dx = 1\). |
Definition at line 245 of file SmoothingFourier.h.
void FML::GRID::convolution_fourier_space | ( | const FFTWGrid< N > & | fourier_grid_f, |
const FFTWGrid< N > & | fourier_grid_g, | ||
FFTWGrid< N > & | fourier_grid_result | ||
) |
From two fourier grids, f and g, compute the convolution \( f(k) * g(k) = \int d^{\rm N}q f(q) g(k-q) \) This is done via multuplication in reals-space.
We allocate one temporary grid and perform 3 fourier tranforms.
N | dimension of the grid |
[in] | fourier_grid_f | The fourier grid f |
[in] | fourier_grid_g | The fourier grid g |
[out] | fourier_grid_result | Fourier grid containing the convolution of the two gridsf |
Definition at line 134 of file SmoothingFourier.h.
void FML::GRID::convolution_real_space | ( | const FFTWGrid< N > & | real_grid_f, |
const FFTWGrid< N > & | real_grid_g, | ||
FFTWGrid< N > & | real_grid_result | ||
) |
From two real grids, f and g, compute the convolution \( f(x) * g(x) = \int d^{\rm N}y f(y) g(x-y) \) This is done via multiplication in fourier-space.
We allocate one temporary grid and perform 3 fourier tranforms. We can merge this with convolution_fourier_space and just have one method and get do the real or fourier space convolution depening on the status of the grids, but its easy to forget to set the status so we have two methods for this.
N | dimension of the grid |
[in] | real_grid_f | The real grid f |
[in] | real_grid_g | The real grid g |
[out] | real_grid_result | Real grid containing the convolution of the two grids. |
Definition at line 190 of file SmoothingFourier.h.
Definition at line 1225 of file FFTWGrid.h.
Definition at line 1236 of file FFTWGrid.h.
void FML::GRID::finalize_fftw | ( | ) |
Definition at line 293 of file Global.cpp.
void FML::GRID::init_fftw | ( | int * | argc, |
char *** | argv | ||
) |
Definition at line 279 of file Global.cpp.
FML::GRID::OPS | ( | + | ) |
FML::GRID::OPS | ( | - | ) |
OPS * FML::GRID::OPS | ( | / | ) |
void FML::GRID::set_fftw_nthreads | ( | int | nthreads | ) |
Definition at line 300 of file Global.cpp.
void FML::GRID::smoothing_filter_fourier_space | ( | FFTWGrid< N > & | fourier_grid, |
double | smoothing_scale, | ||
std::string | smoothing_method | ||
) |
Low-pass filters (tophat, gaussian, sharpk)
N | The dimension of the grid |
[out] | fourier_grid | The fourier grid we do the smoothing of |
[in] | smoothing_scale | The smoothing radius of the filter (in units of the boxsize) |
[in] | smoothing_method | The smoothing filter (tophat, gaussian, sharpk) |
Definition at line 55 of file SmoothingFourier.h.
void FML::GRID::whitening_fourier_space | ( | FFTWGrid< N > & | fourier_grid | ) |
Take a fourier grid and divide each mode by its norm: \( f(k) \to f(k) / |f(k)| \).
N | The dimension of the grid |
[out] | fourier_grid | The fourier grid we do the whitening on |
Definition at line 27 of file SmoothingFourier.h.