openPSTD
2.0
Open source simulation for sound propagation in urban environments
|
Storage of the accumulated wisdom in the simulation. More...
#include <WisdomCache.h>
Classes | |
struct | Discretization |
Storage of the wave number discretizations. More... | |
struct | Planset_FFTW |
Storage of the plans used in the Fast Fourier Transform. More... | |
Public Member Functions | |
Discretization | get_discretization (float dx, int N) |
Obtain the discretization for the given grid size and number of grid points. More... | |
Planset_FFTW | get_fftw_planset (int fft_length, int fft_batch_size) |
Obtain an FFTW plan for the given fft length and batch size. More... | |
WisdomCache () | |
Initializer for the cache. More... | |
Public Attributes | |
std::map< int, Discretization > | computed_discretization |
std::map< std::string, Planset_FFTW > | cached_fftw_plans |
Storage of the accumulated wisdom in the simulation.
Purpose: Discretize wave numbers dynamically, and optimize them for FFT computations. Also contains the plans for FFTW.
OpenPSTD::Kernel::WisdomCache::WisdomCache | ( | ) |
Initializer for the cache.
Initialize only a single instance to optimize computations.
WisdomCache::Discretization OpenPSTD::Kernel::WisdomCache::get_discretization | ( | float | dx, |
int | N | ||
) |
Obtain the discretization for the given grid size and number of grid points.
If discretization is unknown, it is computed and stored for future reference.
dx | grid size |
N | number of grid points |
WisdomCache::Planset_FFTW OpenPSTD::Kernel::WisdomCache::get_fftw_planset | ( | int | fft_length, |
int | fft_batch_size | ||
) |
Obtain an FFTW plan for the given fft length and batch size.
If the plan does not exist yet, it is created and cached.
fft_length | Length of the planned FFT |
fft_batch_size | Batch size of the planned FFT |