openPSTD  2.0
Open source simulation for sound propagation in urban environments
Classes | Public Member Functions | Public Attributes | List of all members
OpenPSTD::Kernel::WisdomCache Class Reference

Storage of the accumulated wisdom in the simulation. More...

#include <WisdomCache.h>

Collaboration diagram for OpenPSTD::Kernel::WisdomCache:
Collaboration graph

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, Discretizationcomputed_discretization
 
std::map< std::string, Planset_FFTWcached_fftw_plans
 

Detailed Description

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.

Constructor & Destructor Documentation

OpenPSTD::Kernel::WisdomCache::WisdomCache ( )

Initializer for the cache.

Initialize only a single instance to optimize computations.

Member Function Documentation

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.

Parameters
dxgrid size
Nnumber of grid points
Returns
: Struct with wave discretization values.
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.

Parameters
fft_lengthLength of the planned FFT
fft_batch_sizeBatch size of the planned FFT

The documentation for this class was generated from the following files: