SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
Spectral::Zernike< Dim > Class Template Reference

A collection of helper functions for the radial functions used in Zernike polyomials. More...

#include <Zernike.hpp>

Static Public Member Functions

template<typename T>
static T basis_function_value (size_t n, size_t m, const T &xi)
 Value of the basis function \(\Phi^m_n(\xi) = R^m_n(r)\), where \(r \equiv \frac{1}{2} (\xi + 1)\), implemented from [143].
static std::pair< DataVector, DataVectorcompute_collocation_points_and_weights (size_t num_points)
 Collocation points \({x_i}\) and quadrature weights \({w_i}\).
static Matrix differentiation_matrix (size_t num_points, Parity parity)
 Matrix \(D_{i,j}\) used to obtain the first derivative for a given parity.
template<typename T>
static Matrix interpolation_matrix (size_t num_points, const T &target_points, Parity parity)
 Matrix used to interpolate to the target_points.

Detailed Description

template<size_t Dim>
class Spectral::Zernike< Dim >

A collection of helper functions for the radial functions used in Zernike polyomials.

Member Function Documentation

◆ differentiation_matrix()

template<size_t Dim>
Matrix Spectral::Zernike< Dim >::differentiation_matrix ( size_t num_points,
Parity parity )
static

Matrix \(D_{i,j}\) used to obtain the first derivative for a given parity.

Due to the clustering of Zernike collocation toward the upper side, the generic implementation of derivatives with barycentric weights yields large errors. By utilizing the fact that the Zernike bases' \(m\) corresponds to parity of representable functions, we can extend the function to negative \(r\) before forming the matrix, greatly improving accuracy.

◆ interpolation_matrix()

template<size_t Dim>
template<typename T>
Matrix Spectral::Zernike< Dim >::interpolation_matrix ( size_t num_points,
const T & target_points,
Parity parity )
static

Matrix used to interpolate to the target_points.

Due to the clustering of Zernike collocation toward the upper side, the generic barycentric interpolation yields large errors. By utilizing the fact that the Zernike bases' \(m\) corresponds to parity of representable functions, we extend the function to negative \(r\) before forming the matrix, greatly improving accuracy.

The returned matrix \(M\) has \(n_\mathrm{target}\) rows and num_points columns, so that \(f_\mathrm{target} = M f_\mathrm{source}\).

This should only be used for ZernikeB1. To interpolate ZernikeB2 or ZernikeB3, look at Irregular or Cardinal.


The documentation for this class was generated from the following file:
  • src/NumericalAlgorithms/Spectral/BasisFunctions/Zernike.hpp