SpECTRE
v2024.12.16
|
Performs interpolation for spin-weighted spherical harmonics by taking advantage of the Clenshaw method of expanding recurrence relations. More...
#include <SwshInterpolation.hpp>
Public Member Functions | |
SwshInterpolator (const SwshInterpolator &)=default | |
SwshInterpolator (SwshInterpolator &&)=default | |
SwshInterpolator & | operator= (const SwshInterpolator &)=default |
SwshInterpolator & | operator= (SwshInterpolator &&)=default |
SwshInterpolator (const DataVector &theta, const DataVector &phi, size_t l_max) | |
template<int Spin> | |
void | interpolate (gsl::not_null< SpinWeighted< ComplexDataVector, Spin > * > interpolated, const SpinWeighted< ComplexModalVector, Spin > &goldberg_modes) const |
Perform the Clenshaw recurrence sum, returning by pointer interpolated of interpolating the goldberg_modes at the collocation points passed to the constructor. More... | |
template<int Spin> | |
void | interpolate (gsl::not_null< SpinWeighted< ComplexDataVector, Spin > * > interpolated, const SpinWeighted< ComplexDataVector, Spin > &libsharp_collocation) const |
Perform the Clenshaw recurrence sum, returning by pointer interpolated of interpolating function represented by libsharp_collocation at the target points passed to the constructor. More... | |
template<int Spin> | |
void | direct_evaluation_swsh_at_l_min (gsl::not_null< SpinWeighted< ComplexDataVector, Spin > * > harmonic, int m) const |
Evaluate the SWSH function at the lowest | |
template<int Spin> | |
void | evaluate_swsh_at_l_min_plus_one (gsl::not_null< SpinWeighted< ComplexDataVector, Spin > * > harmonic, const SpinWeighted< ComplexDataVector, Spin > &harmonic_at_l_min, int m) const |
Evaluate the SWSH function at the next-to-lowest | |
template<int Spin> | |
void | evaluate_swsh_m_recurrence_at_l_min (gsl::not_null< SpinWeighted< ComplexDataVector, Spin > * > harmonic, int m) const |
Evaluate the SWSH function at the lowest | |
template<int Spin> | |
void | clenshaw_sum (gsl::not_null< SpinWeighted< ComplexDataVector, Spin > * > interpolation, const SpinWeighted< ComplexDataVector, Spin > &l_min_harmonic, const SpinWeighted< ComplexDataVector, Spin > &l_min_plus_one_harmonic, const SpinWeighted< ComplexModalVector, Spin > &goldberg_modes, int m) const |
Perform the core Clenshaw interpolation at fixed interpolation . More... | |
void | pup (PUP::er &p) |
Serialization for Charm++. | |
Performs interpolation for spin-weighted spherical harmonics by taking advantage of the Clenshaw method of expanding recurrence relations.
During construction, we cache several functions of the target interpolation points that will be used during the Clenshaw evaluation. A new SwshInterpolator
object must be created for each new set of target points, but the member function SwshInterpolator::interpolate()
may be called on several different coefficients or collocation sets, and of different spin-weights.
This utility obtains the Clenshaw interpolation constants from a StaticCache
, so that 'universal' quantities can be calculated only once per execution and re-used on each interpolation.
We evaluate the recurrence coefficients
The core Clenshaw recurrence is in the
where
The coefficients to cache are inferred from a mechanical but lengthy calculation involving the recurrence relation for the Jacobi polynomials. The result is:
where
The beta_constant
. The alpha_prefactor
and alpha_constant
member variables.
In addition, it is efficient to cache recurrence coefficients necessary for generating the first couple of spin-weighted spherical harmonic functions for each
The member variable harmonic_at_l_min_prefactors
holds the prefactors for directly evaluating the harmonics at
where
and
The member variable harmonic_m_recurrence_prefactors
holds the prefactors necessary to evaluate the lowest harmonics for each
where
and
Finally, the member variable harmonic_at_l_min_plus_one_recurrence_prefactors
holds the prefactors necessary to evaluate parts of the recurrence relations from the lowest
where
void Spectral::Swsh::SwshInterpolator::clenshaw_sum | ( | gsl::not_null< SpinWeighted< ComplexDataVector, Spin > * > | interpolation, |
const SpinWeighted< ComplexDataVector, Spin > & | l_min_harmonic, | ||
const SpinWeighted< ComplexDataVector, Spin > & | l_min_plus_one_harmonic, | ||
const SpinWeighted< ComplexModalVector, Spin > & | goldberg_modes, | ||
int | m | ||
) | const |
Perform the core Clenshaw interpolation at fixed interpolation
.
Included in the public interface for thorough testing, most use cases should just use the interpolate
member function.
void Spectral::Swsh::SwshInterpolator::direct_evaluation_swsh_at_l_min | ( | gsl::not_null< SpinWeighted< ComplexDataVector, Spin > * > | harmonic, |
int | m | ||
) | const |
Evaluate the SWSH function at the lowest
Included in the public interface for thorough testing, most use cases should just use the SwshInterpolator::interpolate()
member function.
void Spectral::Swsh::SwshInterpolator::evaluate_swsh_at_l_min_plus_one | ( | gsl::not_null< SpinWeighted< ComplexDataVector, Spin > * > | harmonic, |
const SpinWeighted< ComplexDataVector, Spin > & | harmonic_at_l_min, | ||
int | m | ||
) | const |
Evaluate the SWSH function at the next-to-lowest
Included in the public interface for thorough testing, most use cases should just use the SwshInterpolator::interpolate()
member function.
void Spectral::Swsh::SwshInterpolator::evaluate_swsh_m_recurrence_at_l_min | ( | gsl::not_null< SpinWeighted< ComplexDataVector, Spin > * > | harmonic, |
int | m | ||
) | const |
Evaluate the SWSH function at the lowest
Included in the public interface for thorough testing, most use cases should just use the SwshInterpolator::interpolate()
member function.
void Spectral::Swsh::SwshInterpolator::interpolate | ( | gsl::not_null< SpinWeighted< ComplexDataVector, Spin > * > | interpolated, |
const SpinWeighted< ComplexDataVector, Spin > & | libsharp_collocation | ||
) | const |
Perform the Clenshaw recurrence sum, returning by pointer interpolated
of interpolating function represented by libsharp_collocation
at the target points passed to the constructor.
The core Clenshaw recurrence is in the
The recurrence in ClenshawRecurrenceConstants
.
void Spectral::Swsh::SwshInterpolator::interpolate | ( | gsl::not_null< SpinWeighted< ComplexDataVector, Spin > * > | interpolated, |
const SpinWeighted< ComplexModalVector, Spin > & | goldberg_modes | ||
) | const |
Perform the Clenshaw recurrence sum, returning by pointer interpolated
of interpolating the goldberg_modes
at the collocation points passed to the constructor.
The core Clenshaw recurrence is in the
The recurrence in ClenshawRecurrenceConstants
.