High Performance Plasticity  0.5.0
spectralUtils.h File Reference

A simple deleter for malloc'd memory. More...

#include <mpi.h>
#include <cmath>
#include <vector>
#include <complex>
#include <fftw3-mpi.h>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <memory>
#include <stdint.h>
#include <string.h>
#include <hpp/config.h>
#include <hpp/hdfUtils.h>
#include <hpp/tensor.h>
#include <hpp/mpiUtils.h>
#include <hpp/simdUtils.h>
#include <hpp/stdlibReplacements.h>
Include dependency graph for spectralUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  hpp::FreeDelete
 
struct  hpp::FFTWConfigRealND
 
class  hpp::SpectralDataset< U >
 
class  hpp::SpectralDatasetID
 
class  hpp::SpectralDatabase< U >
 
class  hpp::SpectralDatabaseUnified< U >
 

Namespaces

 hpp
 

Macros

#define HPP_DEFAULT_ALIGNMENT   32
 
#define HPP_DEFAULT_UNIFIED_COORDS_NAME   "unified_coords"
 
#define HPP_DEFAULT_COORDS_SUFFIX   "_coords"
 
#define HPP_DEFAULT_COEFFS_SUFFIX   "_vals"
 

Functions

int hpp::fftwFlat2 (int i0, int i1, int N0, int N1)
 
int hpp::fftwFlat4 (int i0, int i1, int i2, int i3, const std::vector< ptrdiff_t > &N)
 
FFTWConfigRealND hpp::prepareFFTWConfigRealND (const std::vector< ptrdiff_t > &realDims, MPI_Comm comm)
 
void hpp::destroyConfigRealND (FFTWConfigRealND &cfg)
 
double hpp::fftwComplexMag (fftw_complex comps)
 
bool hpp::operator< (const SpectralDatasetID &l, const SpectralDatasetID &r)
 
bool hpp::operator== (const SpectralDatasetID &l, const SpectralDatasetID &r)
 
std::string hpp::getCoordsName (std::string baseName)
 
std::string hpp::getCoeffsName (std::string baseName)
 
template<typename U >
std::string hpp::getComponentSuffix (const std::vector< U > &componentIdx)
 
std::string hpp::getDefaultCoeffsDatasetName (SpectralDatasetID dsetID)
 
template<typename U >
void hpp::loadSpectralDatabase (hpp::HDF5Handler &infile, std::string dsetNameCoords, std::string dsetNameCoeffs, std::vector< hsize_t > componentIdx, std::vector< std::vector< unsigned int >> &coordsList, std::vector< std::complex< U >> &coeffList, unsigned int nTerms, unsigned int refineMult=1)
 Load a spectral database. More...
 
template<typename U >
std::complex< U > hpp::TruncatedIFFTNDSingleSquare (const unsigned int spatialDim, const std::vector< std::complex< U >> &expTable, const std::vector< std::vector< unsigned int >> &spectralCoordsList, const std::vector< std::complex< U >> &coeffs, std::vector< unsigned int > spatialCoord, unsigned int nTerms)
 TruncatedIFFTND where all dimensions have the same number of points. More...
 
template<typename U >
hpp::TruncatedIFFTNDSingleSquareReal (const unsigned int spatialDim, const std::vector< std::complex< U >> &expTable, const std::vector< std::vector< unsigned int >> &spectralCoordsList, const std::vector< std::complex< U >> &coeffs, std::vector< unsigned int > spatialCoord, unsigned int nTerms)
 
template<typename U >
hpp::TruncatedIFFTNDSingleSquareRealScalar (const unsigned int nDims, const unsigned int spatialDim, const U expTable[], const int spectralCoordsList[], const U coeffs[], std::vector< unsigned int > spatialCoord, unsigned int nTerms)
 Scalar implementation of hpp.TruncatedIFFTNDSingleSquareReal. More...
 
template<typename U >
hpp::TruncatedIFFTNDSingleSquareRealScalar (const unsigned int nDims, const unsigned int spatialDim, const int spectralCoordsList[], const U coeffs[], std::vector< unsigned int > spatialCoord, unsigned int nTerms)
 
template<typename U >
hpp::TruncatedIFFT4DSingleSquareReal (const unsigned int spatialDim, const U expTable[], const int spectralCoordsList[], const U coeffs[], const std::vector< unsigned int > &spatialCoord, unsigned int nTerms)
 AVX implementation of hpp.TruncatedIFFT4DSingleSquareReal. More...
 
template<typename U >
hpp::TruncatedIFFTNDSingleSquareReal (const unsigned int nDims, const unsigned int spatialDim, const U expTable[], const int spectralCoordsList[], const U coeffs[], const std::vector< unsigned int > &spatialCoord, unsigned int nTerms)
 
template<typename U >
hpp::TruncatedIFFT4DSingleSquareReal (const unsigned int spatialDim, const int spectralCoordsList[], const U coeffs[], const std::vector< unsigned int > &spatialCoord, unsigned int nTerms)
 
template<typename U >
hpp::TruncatedIFFTNDSingleSquareReal (const unsigned int nDims, const unsigned int spatialDim, const int spectralCoordsList[], const U coeffs[], const std::vector< unsigned int > &spatialCoord, unsigned int nTerms)
 
void hpp::evaluateSpectralCompressionErrorFull (std::string rawDBName, std::string spectralDBName, std::string errorDBName, unsigned int nTermsMax, std::string outFilename, MPI_Comm comm)
 
void hpp::evaluateSpectralCompressionErrorAxisSlice (std::string rawDBName, std::string spectralDBName, std::vector< std::string > dsetBasenames, unsigned int nTermsMax, unsigned int refineMult, std::vector< int > axisSlice, std::string outFilename, MPI_Comm comm)
 Evaluate the error incurred in the spectral reresentation of a database. More...
 
void hpp::evaluateSpectralCompressionErrorFullUnified (std::string rawDBName, std::string spectralDBName, std::string errorDBName, unsigned int nTermsMax, std::string outFilename, MPI_Comm comm)
 
void hpp::evaluateSpectralCompressionErrorAxisSliceUnified (std::string rawDBName, std::string spectralDBName, std::vector< std::string > dsetBasenames, unsigned int nTermsMax, unsigned int refineMult, std::vector< int > axisSlice, std::string outFilename, MPI_Comm comm)
 Evaluate the error incurred in the spectral reresentation of a database. More...
 

Detailed Description

A simple deleter for malloc'd memory.

A spectral database for DFTs of real data.

Specifically for DFTs of real data.

A unique ID for a spectral dataset.

A dataset containing the truncated N-dimensional DFT of a scalar.

The coordinates and coefficients are stored in aligned

Currently assumes that database is square

This is specifically for "unified" coefficient datasets, which here means that there is a single ordering of the dominant components that all of the coefficients follow.

Macro Definition Documentation

#define HPP_DEFAULT_ALIGNMENT   32
#define HPP_DEFAULT_COEFFS_SUFFIX   "_vals"
#define HPP_DEFAULT_COORDS_SUFFIX   "_coords"
#define HPP_DEFAULT_UNIFIED_COORDS_NAME   "unified_coords"