SpECTRE Documentation Coverage Report
Current view: top level - NumericalAlgorithms/Spectral - ModalToNodalMatrix.hpp Hit Total Coverage
Commit: 107e15b340886ae54549b1baa4bfc92e676f667e Lines: 6 7 85.7 %
Date: 2026-09-17 16:38:56
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             : /// \cond
       9             : class Matrix;
      10             : template <size_t>
      11             : class Mesh;
      12             : namespace Spectral {
      13             : enum class Basis : uint8_t;
      14             : enum class Parity : uint8_t;
      15             : enum class Quadrature : uint8_t;
      16             : }  // namespace Spectral
      17             : /// \endcond
      18             : 
      19             : namespace Spectral {
      20             : /*!
      21             :  * \brief %Matrix used to transform from the spectral coefficients (modes) of a
      22             :  * function to its nodal coefficients. Also referred to as the _Vandermonde
      23             :  * matrix_.
      24             :  *
      25             :  * \details The Vandermonde matrix is computed as
      26             :  * \f$\mathcal{V}_{ij}=\Phi_j(\xi_i)\f$ where the \f$\Phi_j(x)\f$ are the
      27             :  * spectral basis functions used in the modal expansion
      28             :  * \f$u(x)=\sum_j \widetilde{u}_j\Phi_j(x)\f$, e.g. normalized Legendre
      29             :  * polynomials, and the \f$\xi_i\f$ are the collocation points used to construct
      30             :  * the interpolating Lagrange polynomials in the nodal expansion
      31             :  * \f$u(x)=\sum_j u_j l_j(x)\f$. Then the Vandermonde matrix arises as
      32             :  * \f$u(\xi_i)=u_i=\sum_j \widetilde{u}_j\Phi_j(\xi_i)=\sum_j
      33             :  * \mathcal{V}_{ij}\widetilde{u}_j\f$.
      34             :  *
      35             :  * \param num_points The number of collocation points
      36             : 
      37             :  * \see nodal_to_modal_matrix(size_t)
      38             :  */
      39             : template <Basis BasisType, Quadrature QuadratureType>
      40           1 : const Matrix& modal_to_nodal_matrix(size_t num_points);
      41             : 
      42             : /*!
      43             :  * \brief %Matrix used to transform from the spectral coefficients (modes) of a
      44             :  * function to its nodal coefficients. This two-index version is used for
      45             :  * two-dimensional basis function (i.e. Zernike with GaussRadauUpper
      46             :  * quadrature).
      47             :  *
      48             :  * For Zernike, \f$m\f$ is the angular index and \f$N\f$ is the
      49             :  * maximum supported spectral index (usually taken to be the maximum value,
      50             :  * \f$2 \, \texttt{num_points}-2\f$). Note that the size of a spectral space
      51             :  * vector is \f$(N - m) / 2 + 1\f$, using integer division.
      52             :  *
      53             :  * \see modal_to_nodal_matrix(size_t)
      54             :  */
      55             : template <Basis BasisType, Quadrature QuadratureType>
      56           1 : const Matrix& modal_to_nodal_matrix(size_t num_points, size_t m, size_t N);
      57             : 
      58             : /*!
      59             :  * \brief Transformation matrix from modal to nodal coefficients for a
      60             :  * one-dimensional mesh.
      61             :  *
      62             :  * \see modal_to_nodal_matrix(size_t)
      63             :  */
      64           1 : const Matrix& modal_to_nodal_matrix(const Mesh<1>& mesh);
      65             : 
      66             : /*!
      67             :  * \brief Transformation matrix from modal to nodal coefficients for a
      68             :  * one-dimensional mesh with a Zernike basis.
      69             :  *
      70             :  * \see modal_to_nodal_matrix(size_t, size_t, size_t)
      71             :  */
      72           1 : const Matrix& modal_to_nodal_matrix(const Mesh<1>& mesh, size_t m, size_t N);
      73             : 
      74             : /*!
      75             :  * \brief %Matrix used to transform from the spectral coefficients (modes) of a
      76             :  * function to its nodal coefficients, for a parity-dependent basis such as
      77             :  * `Basis::HalfFourier`.
      78             :  *
      79             :  * \param num_points The number of collocation points
      80             :  * \param parity The parity of the function (`Parity::Even` or `Parity::Odd`)
      81             :  *
      82             :  * \see modal_to_nodal_matrix(size_t)
      83             :  */
      84             : template <Basis BasisType, Quadrature QuadratureType>
      85           1 : const Matrix& modal_to_nodal_matrix(size_t num_points, Parity parity);
      86             : 
      87             : /*!
      88             :  * \brief Transformation matrix from modal to nodal coefficients for a
      89             :  * one-dimensional mesh with a parity-dependent basis such as
      90             :  * `Basis::HalfFourier`.
      91             :  *
      92             :  * \see modal_to_nodal_matrix(size_t, Parity)
      93             :  */
      94           1 : const Matrix& modal_to_nodal_matrix(const Mesh<1>& mesh, Parity parity);
      95             : }  // namespace Spectral

Generated by: LCOV version 1.14