SpECTRE  v2026.09.05
Loading...
Searching...
No Matches
Spectral::HalfFourier Class Reference

A collection of helper functions for the half-Fourier spectral basis. More...

#include <HalfFourier.hpp>

Static Public Member Functions

static DataVector collocation_points (size_t num_points)
 Collocation points \(\{\phi_j\}\).
static DataVector quadrature_weights (size_t num_points)
 Quadrature weights \(\{w_j\}\).
static Matrix even_differentiation_matrix (size_t num_points)
 Differentiation matrix \(D^{\text{even}}_{ij}\) for even-parity functions.
static Matrix odd_differentiation_matrix (size_t num_points)
 Differentiation matrix \(D^{\text{odd}}_{ij}\) for odd-parity functions.
template<typename T>
static Matrix even_interpolation_matrix (size_t num_points, const T &target_points)
 Interpolation matrix for even-parity functions to target_points.
template<typename T>
static Matrix odd_interpolation_matrix (size_t num_points, const T &target_points)
 Interpolation matrix for odd-parity functions to target_points.
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 for a given parity.

Detailed Description

A collection of helper functions for the half-Fourier spectral basis.

Details

The half-Fourier basis represents functions on the interval \(\phi \in [0, \pi)\) using \(N\) equispaced interior collocation points \(\phi_j = (j + \tfrac{1}{2})\pi/N\) for \(j = 0, \ldots, N-1\).

Functions of even parity under \(\phi \to -\phi\) (i.e. those satisfying \(f(-\phi)=f(\phi)\)) are expanded in cosines:

\[f(\phi) = \sum_{n=0}^{N-1} a_n \cos(n\phi) \]

Functions of odd parity under \(\phi \to -\phi\) (i.e. those satisfying \(f(-\phi)=-f(\phi)\)) are expanded in sines:

\[f(\phi) = \sum_{n=1}^{N} b_n \sin(n\phi) \]

The derivative \(\partial / \partial \phi\) maps even-parity functions to odd-parity functions and vice versa.

This basis is intended for use in the Cartoon method for axisymmetric problems on a cylinder, where the azimuthal direction covers only half a circle due to the reflection symmetry, and the parity boundary conditions are internal to the spectral representation.

Member Function Documentation

◆ collocation_points()

DataVector Spectral::HalfFourier::collocation_points ( size_t num_points)
static

Collocation points \(\{\phi_j\}\).

Details

The collocation points on the interval \((0, \pi)\) are given by

\[\phi_j = \frac{(j + \tfrac{1}{2})\pi}{N} \]

◆ even_differentiation_matrix()

Matrix Spectral::HalfFourier::even_differentiation_matrix ( size_t num_points)
static

Differentiation matrix \(D^{\text{even}}_{ij}\) for even-parity functions.

Details

Maps an even-parity function (expanded in cosines) to its derivative, which is an odd-parity function (expanded in sines). Explicitly:

\[D^{\text{even}}_{ij} = \frac{2}{N} \sum_{n=1}^{N-1} (-n) \sin(n\phi_i) \cos(n\phi_j) \]

◆ even_interpolation_matrix()

template<typename T>
Matrix Spectral::HalfFourier::even_interpolation_matrix ( size_t num_points,
const T & target_points )
static

Interpolation matrix for even-parity functions to target_points.

Details

Using the discrete cosine transform (DCT-II) representation, the interpolation weights at a target point \(x\) are:

\[I^{\text{even}}_j(x) = \frac{1}{N}\left[1 + 2\sum_{n=1}^{N-1} \cos(nx)\cos(n\phi_j)\right] \]

◆ interpolation_matrix()

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

Matrix used to interpolate to the target_points for a given parity.

Details

Dispatches to even_interpolation_matrix when parity is Parity::Even and to odd_interpolation_matrix when it is Parity::Odd. This mirrors the interface of Zernike<1>::interpolation_matrix.

◆ odd_differentiation_matrix()

Matrix Spectral::HalfFourier::odd_differentiation_matrix ( size_t num_points)
static

Differentiation matrix \(D^{\text{odd}}_{ij}\) for odd-parity functions.

Details

Maps an odd-parity function (expanded in sines) to its derivative, which is an even-parity function (expanded in cosines). Explicitly:

\[D^{\text{odd}}_{ij} = \frac{2}{N} \sum_{n=1}^{N-1} n \cos(n\phi_i) \sin(n\phi_j) \]

Note that \(D^{\text{even}} = -(D^{\text{odd}})^T\).

◆ odd_interpolation_matrix()

template<typename T>
Matrix Spectral::HalfFourier::odd_interpolation_matrix ( size_t num_points,
const T & target_points )
static

Interpolation matrix for odd-parity functions to target_points.

Details

Using the discrete sine transform (DST-II) representation, the interpolation weights at a target point \(x\) are:

\[I^{\text{odd}}_j(x) = \frac{2}{N}\sum_{n=1}^{N-1} \sin(nx)\sin(n\phi_j) + \frac{1}{N}\sin(Nx)\sin(N\phi_j) \]

where the Nyquist mode \(n=N\) carries half the weight of the other modes.

◆ quadrature_weights()

DataVector Spectral::HalfFourier::quadrature_weights ( size_t num_points)
static

Quadrature weights \(\{w_j\}\).

Details

The quadrature weights are uniform:

\[w_j = \frac{\pi}{N} \]


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