SpECTRE  2021.08.02
Filters::Exponential< FilterIndex > Class Template Reference

A cached exponential filter. More...

#include <ExponentialFilter.hpp>

Classes

struct  Alpha
 The value of exp(-alpha) is what the highest modal coefficient is rescaled by. More...
 
struct  DisableForDebugging
 Turn the filter off. More...
 
struct  HalfPower
 Half of the exponent in the exponential. More...
 

Public Types

using options = tmpl::list< Alpha, HalfPower, DisableForDebugging >
 

Public Member Functions

 Exponential (double alpha, unsigned half_power, bool disable_for_debugging) noexcept
 
const Matrixfilter_matrix (const Mesh< 1 > &mesh) const noexcept
 A cached matrix used to apply the filter to the given mesh.
 
bool disable_for_debugging () const noexcept
 
void pup (PUP::er &p) noexcept
 

Static Public Member Functions

static std::string name () noexcept
 

Static Public Attributes

static constexpr Options::String help = {"An exponential filter."}
 

Friends

template<size_t LocalFilterIndex>
bool operator== (const Exponential< LocalFilterIndex > &lhs, const Exponential< LocalFilterIndex > &rhs) noexcept
 

Detailed Description

template<size_t FilterIndex>
class Filters::Exponential< FilterIndex >

A cached exponential filter.

Applies an exponential filter in each logical direction to each component of the tensors TagsToFilter. The exponential filter rescales the 1d modal coefficients \(c_i\) as:

\begin{align*} c_i\to c_i \exp\left[-\alpha_{\mathrm{ef}} \left(\frac{i}{N}\right)^{2\beta_{\mathrm{ef}}}\right] \end{align*}

where \(N\) is the basis degree (number of grid points per element per dimension minus one), \(\alpha_{\mathrm{ef}}\) determines how much the coefficients are rescaled, and \(\beta_{\mathrm{ef}}\) (given by the HalfPower option) determines how aggressive/broad the filter is (lower values means filtering more coefficients). Setting \(\alpha_{\mathrm{ef}}=36\) results in effectively zeroing the highest coefficient (in practice it gets rescaled by machine epsilon). The same \(\alpha_{\mathrm{ef}}\) and \(\beta_{\mathrm{ef}}\) are used in each logical direction. For a discussion of filtering see section 5.3 of [58].

Design decision:

  • The reason for the size_t template parameter is to allow for different Alpha and HalfPower parameters for different tensors while still being able to cache the matrices. If different Alpha or HalfPower parameters are desired for filtering different tensors, then multiple filters must be inserted into the GlobalCache with different FilterIndex values. In the input file these will be specified as ExpFilterFILTER_INDEX, e.g.
    options.parse(
    "Filtering:\n"
    " ExpFilter0:\n"
    " Alpha: 36\n"
    " HalfPower: 32\n"
    " DisableForDebugging: False\n"
    " ExpFilter1:\n"
    " Alpha: 36\n"
    " HalfPower: 12\n"
    " DisableForDebugging: False\n");