|
SpECTRE
v2026.04.01
|
Matrices for filtering spectral coefficients. More...
Functions | |
| Matrix | exponential_filter (const Mesh< 1 > &mesh, double alpha, unsigned half_power) |
| Returns a Matrix by which to multiply the nodal coefficients to apply a stable exponential filter. | |
| const Matrix & | zero_lowest_modes (const Mesh< 1 > &mesh, size_t number_of_modes_to_zero) |
| Zeros the lowest number_of_modes_to_zero modal coefficients. Note that the matrix must be applied to a nodal representation. | |
| template<typename TagsList> | |
| void | ZernikeB2_disk_exponential_filter (gsl::not_null< Variables< TagsList > * > u, const Mesh< 2 > &mesh, double alpha, unsigned half_power) |
| Filters the tensors stored within a Variables being represented by ZernikeB2 basis functions. | |
| template<typename TagsList> | |
| void | ZernikeB2_cylinder_exponential_filter (gsl::not_null< Variables< TagsList > * > u, const Mesh< 3 > &mesh, double alpha, unsigned half_power) |
| Filters the tensors stored within a Variables being represented by ZernikeB2 \(\times\) Legendre basis functions. | |
Matrices for filtering spectral coefficients.
| Matrix Spectral::filtering::exponential_filter | ( | const Mesh< 1 > & | mesh, |
| double | alpha, | ||
| unsigned | half_power ) |
Returns a Matrix by which to multiply the nodal coefficients to apply a stable exponential filter.
The exponential filter rescales the modal coefficients according to:
\begin{align*} c_i\to c_i \exp\left[-\alpha \left(\frac{i}{N}\right)^{2m}\right] \end{align*}
where \(c_i\) are the zero-indexed modal coefficients, \(N\) is the basis degree (number of grid points per element per dimension minus one), \(\alpha\) determines how much the coefficients are rescaled, and \(m\) determines how aggressive/broad the filter is (lower values means filtering more coefficients). Setting \(\alpha=36\) results in setting the highest coefficient to machine precision, effectively zeroing it out.
| void Spectral::filtering::ZernikeB2_cylinder_exponential_filter | ( | gsl::not_null< Variables< TagsList > * > | u, |
| const Mesh< 3 > & | mesh, | ||
| double | alpha, | ||
| unsigned | half_power ) |
Filters the tensors stored within a Variables being represented by ZernikeB2 \(\times\) Legendre basis functions.
Representing functions on a filled cylinder requires special basis functions, namely a filled disk with ZernikeB2 cross Legendre. This requires inherently two-dimensional basis functions, meaning the radial and angular spectral spaces are intertwined. This function goes to that combined modal space, applies the exponential filter, transforms back, and then filters the third I1 dimension.
| void Spectral::filtering::ZernikeB2_disk_exponential_filter | ( | gsl::not_null< Variables< TagsList > * > | u, |
| const Mesh< 2 > & | mesh, | ||
| double | alpha, | ||
| unsigned | half_power ) |
Filters the tensors stored within a Variables being represented by ZernikeB2 basis functions.
Representing functions on a filled disk requires special basis functions, namely ZernikeB2. These are inherently two-dimensional, meaning the radial and angular spectral spaces are intertwined. This function goes to that combined modal space, applies the exponential filter, and transforms back.
| const Matrix & Spectral::filtering::zero_lowest_modes | ( | const Mesh< 1 > & | mesh, |
| size_t | number_of_modes_to_zero ) |
Zeros the lowest number_of_modes_to_zero modal coefficients. Note that the matrix must be applied to a nodal representation.
Given a function \(u\)
\begin{align} u(x)=\sum_{i=0}^N c_i P_i(x), \end{align}
where \(c_i\) are the modal coefficients and \(P_i(x)\) is the basis (e.g. Legendre polynomials), the filter matrix will take the nodal representation of \(u\) and zero out the lowest number_of_modes_to_zero modal coefficients. That is, after the filter is applied \(u\to\bar{u}\) is
\begin{align} \bar{u}(x)=\sum_{i=k}^N c_i P_i(x), \end{align}
where \(k\) is the number of modes set to zero. The output \(\bar{u}\) is also in the nodal representation.