SpECTRE  v2024.04.12
Spectral::Swsh::CoefficientsMetadata Class Reference

A container for libsharp metadata for the spin-weighted spherical harmonics modal representation. More...

#include <SwshCoefficients.hpp>

Classes

class  CoefficientsIndexIterator
 An iterator for easily traversing a libsharp-compatible spin-weighted spherical harmonic modal representation. The operator*() returns a LibsharpCoefficientInfo, which contains two offsets, transform_of_real_part_offset and transform_of_imag_part_offset, and the l_max, l and m associated with the values at those offsets. More...
 

Public Member Functions

 CoefficientsMetadata (size_t l_max)
 
 CoefficientsMetadata (const CoefficientsMetadata &)=delete
 
 CoefficientsMetadata (CoefficientsMetadata &&)=default
 
CoefficientsMetadataoperator= (const CoefficientsMetadata &)=delete
 
CoefficientsMetadataoperator= (CoefficientsMetadata &&)=default
 
sharp_alm_info * get_sharp_alm_info () const
 
size_t l_max () const
 
size_t size () const
 returns the number of (complex) entries in a libsharp-compatible coefficients vector. This includes the factor of 2 associated with needing to store both the transform of the real and imaginary parts, so is the full size of the result of a libsharp swsh transform.
 
CoefficientsMetadata::CoefficientsIndexIterator begin () const
 Get a bidirectional iterator to the start of the series of modes.
 
CoefficientsMetadata::CoefficientsIndexIterator cbegin () const
 Get a bidirectional iterator to the start of the series of modes.
 
CoefficientsMetadata::CoefficientsIndexIterator end () const
 Get a bidirectional iterator to the end of the series of modes.
 
CoefficientsMetadata::CoefficientsIndexIterator cend () const
 Get a bidirectional iterator to the end of the series of modes.
 

Detailed Description

A container for libsharp metadata for the spin-weighted spherical harmonics modal representation.

Details

The CoefficientsMetadata class acts as a memory-safe container for a sharp_alm_info*, required for use of libsharp transform utilities. The libsharp utilities are currently constructed to only provide user functions with collocation data for spin-weighted functions and derivatives. This class also provides an iterator for easily traversing a libsharp-compatible modal representation.

Note
The libsharp representation of coefficients is altered from the standard mathematical definitions in a nontrivial way. There are a number of important features to the data storage of the coefficients.
  • they are stored as a set of complex values, but each vector of complex values is the transform of only the real or imaginary part of the collocation data
  • because each vector of complex coefficients is related to the transform of a set of doubles, only (about) half of the m's are stored (m >= 0), because the remaining m modes are determinable by conjugation from the positive m modes, given that they represent the transform of a purely real or purely imaginary collocation quantity
  • they are stored in an l-varies-fastest, triangular representation. To be concrete, for an l_max=2, the order of coefficient storage is (l, m): [(0, 0), (1, 0), (2, 0), (1, 1), (2, 1), (2, 2)]
  • due to the restriction of representing only the transform of real quantities, the m=0 modes always have vanishing imaginary component.

The documentation for this class was generated from the following file: