SpECTRE Documentation Coverage Report
Current view: top level - NumericalAlgorithms/Spectral/BasisFunctions - Zernike.hpp Hit Total Coverage
Commit: 1e29a35ad8559408f21493dc5db8a49a237bb2f0 Lines: 4 5 80.0 %
Date: 2026-03-31 22:27:51
Legend: Lines: hit not hit

          Line data    Source code
       1           0 : // Distributed under the MIT License.
       2             : // See LICENSE.txt for details.
       3             : 
       4             : #pragma once
       5             : 
       6             : #include <cstddef>
       7             : 
       8             : #include "NumericalAlgorithms/Spectral/CollocationPointsAndWeights.hpp"
       9             : 
      10             : /// \cond
      11             : class DataVector;
      12             : class Matrix;
      13             : namespace Spectral {
      14             : enum class Quadrature : uint8_t;
      15             : enum class Parity : uint8_t;
      16             : }  // namespace Spectral
      17             : /// \endcond
      18             : 
      19             : namespace Spectral {
      20             : 
      21             : /*!
      22             :  * \ingroup SpectralGroup
      23             :  *
      24             :  * \brief A collection of helper functions for the radial functions used in
      25             :  * Zernike polyomials
      26             :  *
      27             :  */
      28             : template <size_t Dim>
      29           1 : class Zernike {
      30             :  public:
      31             :   /*!
      32             :    * \brief Value of the basis function \f$\Phi^m_n(\xi) = R^m_n(r)\f$,
      33             :    * where \f$r \equiv \frac{1}{2} (\xi + 1)\f$, implemented from
      34             :    * \cite Matsushima1995
      35             :    */
      36             :   template <typename T>
      37           1 :   static T basis_function_value(size_t n, size_t m, const T& xi);
      38             : 
      39             :   /*!
      40             :    * \brief Collocation points \f${x_i}\f$ and quadrature weights \f${w_i}\f$
      41             :    */
      42             :   static std::pair<DataVector, DataVector>
      43           1 :   compute_collocation_points_and_weights(size_t num_points);
      44             : 
      45             :   /*!
      46             :    * \brief Matrix \f$D_{i,j}\f$ used to obtain the first derivative for a
      47             :    * given parity.
      48             :    *
      49             :    * Due to the clustering of Zernike collocation toward the upper side, the
      50             :    * generic implementation of derivatives with barycentric weights yields
      51             :    * large errors. By utilizing the fact that the Zernike bases' \f$m\f$
      52             :    * corresponds to parity of representable functions, we can extend the
      53             :    * function to negative \f$r\f$ before forming the matrix, greatly improving
      54             :    * accuracy.
      55             :    */
      56           1 :   static Matrix differentiation_matrix(size_t num_points, Parity parity);
      57             : };
      58             : }  // namespace Spectral

Generated by: LCOV version 1.14